You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Deepal Jayasinghe <de...@opensource.lk> on 2004/11/08 10:12:28 UTC

[Axis2] Phase Handlers

Hi all;

I have started to develop a prototype to order the phase handlers. And I have encountered set of questions regarding the phase rules and phase handlers. Following is the format of a handler element.  

 

 <handler/> ::= <handler ref="xs:anyURI"    | (name="xs:anyURI" class="...")>

            <order (before="xs:anyURI" after="xs:anyURI")   | phase="xs:anyURI"

                        phaseFirst="xs:boolean" phaseLast="xs:boolean"/>

    <parameter/>*

  </handler>

 

  1.. What is really mean by before and after is that phase or handler?
  2.. Can phases overlap one another?  
  3.. Is that ok to think each handler should belong to a specific phase and that phase should be specified at the service deployment time (i.e. each hander in the service document should come with a phase)?
  4.. Can I assume that phase of any handler cannot be null, i.e. phase of a handler is not optional. 

Thanks

==================================================
Deepal Jayasinghe
Lanka Software Foundation
0714 817 310

Re: [Axis2][Engine]handlers phases: dependency (and metadata) in handlers?

Posted by Srinath Perera <he...@gmail.com>.
1. But we have information at the deployment time to order the
handlers .. (Do we going in to the level of deciding handler order
looking at the value of the parameter? My gut feeling is we should
leave that to handler by handlers if they need not to run depends on
the some value at the run time. )

2. Processing rules is a expensive processing .. I worrid about the
runtime overhead

I think we should try to do it as much as possible at deploy time.
Thanks
Srinath




On Mon, 08 Nov 2004 16:39:08 -0500, Aleksander Slominski
<as...@cs.indiana.edu> wrote:
> i think handler metadata such as what handlers are required to be run
> before some handler should be part of handler so runtime can check and
> validate that configuration of handlers makes sense ...
> 
> alek
> 
> Deepal Jayasinghe wrote:
> 
> >hi ;
> >
> >I agree with you Ajith ,
> >both before and after should represent handlers , then only handlers can be
> >ordered properly.
> >
> >And I think if some one is going to specify before and after the handlers
> >correspondences to those should be belong to the same Phase ;
> >
> >i.e. for a  hander with the name "B"  and if    before ="C" and after = "A"
> >then all "A", "B","C" should belong to same phase ?
> >
> >thanks
> >
> >Deepal
> >
> >----- Original Message -----
> >From: "Ajith Ranabahu" <aj...@gmail.com>
> >To: <ax...@ws.apache.org>
> >Sent: Monday, November 08, 2004 4:28 PM
> >Subject: Re: [Axis2] Phase Handlers
> >
> >
> >
> >
> >>So does this mean handlers are not in particular order INSIDE the phase?
> >>
> >>
> >>On Mon, 8 Nov 2004 16:22:41 +0600, Deepal Jayasinghe
> >><de...@opensource.lk> wrote:
> >>
> >>
> >>>hi;
> >>>
> >>>In the case of phase order it is true that phase order is not dynamic
> >>>
> >>>
> >and it
> >
> >
> >>>is specified in the server.xml.
> >>>
> >>>if the before and after implies "Hander" resolving phase rule may not be
> >>>
> >>>
> >so
> >
> >
> >>>simple ( L ) , I think before and after may be  "phases" NOT "Handlers".
> >>>
> >>>Thanks
> >>>
> >>>Deepal
> >>>
> >>>
> >>>
> >>>
> >>>----- Original Message -----
> >>>From: "Ajith Ranabahu" <aj...@gmail.com>
> >>>To: <ax...@ws.apache.org>
> >>>Sent: Monday, November 08, 2004 3:58 PM
> >>>Subject: Re: [Axis2] Phase Handlers
> >>>
> >>>
> >>>
> >>>>Hi,
> >>>>I will try to answer these questions as far as I understand. Others
> >>>>can correct me if I am also misundertood!
> >>>>As far as I understand phases are logical groups of handlers. The
> >>>>difference between the "chains" that were in axis 1 and  phases is the
> >>>>ordering. This ordering may be fully/partly dynamic but they govern
> >>>>the order the handlers are arranged. So infact a "phase" refers to the
> >>>>logical ordering of the handlers.
> >>>>
> >>>>On Mon, 8 Nov 2004 15:12:28 +0600, Deepal Jayasinghe
> >>>><de...@opensource.lk> wrote:
> >>>>
> >>>>
> >>>>>Hi all;
> >>>>>I have started to develop a prototype to order the phase handlers.
> >>>>>
> >>>>>
> >And I
> >
> >
> >>>>>have encountered set of questions regarding the phase rules and
> >>>>>
> >>>>>
> >phase
> >
> >
> >>>>>handlers. Following is the format of a handler element.
> >>>>>
> >>>>> <handler/> ::= <handler ref="xs:anyURI"    | (name="xs:anyURI"
> >>>>>class="...")>
> >>>>>
> >>>>>            <order (before="xs:anyURI" after="xs:anyURI")   |
> >>>>>phase="xs:anyURI"
> >>>>>
> >>>>>                        phaseFirst="xs:boolean"
> >>>>>
> >>>>>
> >phaseLast="xs:boolean"/>
> >
> >
> >>>>>    <parameter/>*
> >>>>>
> >>>>>  </handler>
> >>>>>
> >>>>>What is really mean by before and after is that phase or handler?
> >>>>>
> >>>>>
> >>>>In the case of before and after they refer to "handlers". The phases
> >>>>are NOT ordered dynamicaly, they are just static. (we can even give
> >>>>the phase order in the axis global config file if we want to). However
> >>>>every handler MUST belong to at least one phase.
> >>>>
> >>>>
> >>>>
> >>>>>Can phases overlap one another?
> >>>>>
> >>>>>
> >>>>No. Phases should be treated as non-overlapping but you may add a
> >>>>single handler to two phases which means the handler will be invoked
> >>>>twice in the execution.(think about the logging handler) Since
> >>>>handlers are stateless (the complete state is in the messageContext)
> >>>>we can (should be) do this without a problem.
> >>>>
> >>>>
> >>>>
> >>>>>Is that ok to think each handler should belong to a specific phase
> >>>>>
> >>>>>
> >and
> >
> >
> >>>that
> >>>
> >>>
> >>>>>phase should be specified at the service deployment time (i.e. each
> >>>>>
> >>>>>
> >>>hander
> >>>
> >>>
> >>>>>in the service document should come with a phase)?
> >>>>>
> >>>>>
> >>>>mmmm.. Phases are specified at the service deployment (thats ok) but a
> >>>>handler can belong to multiple phases. So a handler may not belong to
> >>>>a specific phase.
> >>>>
> >>>>
> >>>>
> >>>>>Can I assume that phase of any handler cannot be null, i.e. phase of
> >>>>>
> >>>>>
> >a
> >
> >
> >>>>>handler is not optional.
> >>>>>
> >>>>>
> >>>>Yes. a handler MUST belong to a phase. However the deployer may ignore
> >>>>the phase in which case a default phase is assumed. So as far as the
> >>>>internal logic is consided a handler always has a phase
> >>>>
> >>>>
> >>>>
> >>>>>Thanks
> >>>>>
> >>>>>==================================================
> >>>>>Deepal Jayasinghe
> >>>>>Lanka Software Foundation
> >>>>>0714 817 310
> >>>>>
> >>>>>
> >>>>>
> >>>>--
> >>>>Ajith Ranabahu
> >>>>
> >>>>
> >>>>
> >>>>
> >>>
> >>>
> >>--
> >>Ajith Ranabahu
> >>
> >>
> >>
> >>
> >
> >
> >
> >
> 
> --
> The best way to predict the future is to invent it - Alan Kay
> 
>

handlers phases: dependency (and metadata) in handlers?

Posted by Aleksander Slominski <as...@cs.indiana.edu>.
i think handler metadata such as what handlers are required to be run 
before some handler should be part of handler so runtime can check and 
validate that configuration of handlers makes sense ...

alek

Deepal Jayasinghe wrote:

>hi ;
>
>I agree with you Ajith ,
>both before and after should represent handlers , then only handlers can be
>ordered properly.
>
>And I think if some one is going to specify before and after the handlers
>correspondences to those should be belong to the same Phase ;
>
>i.e. for a  hander with the name "B"  and if    before ="C" and after = "A"
>then all "A", "B","C" should belong to same phase ?
>
>thanks
>
>Deepal
>
>----- Original Message ----- 
>From: "Ajith Ranabahu" <aj...@gmail.com>
>To: <ax...@ws.apache.org>
>Sent: Monday, November 08, 2004 4:28 PM
>Subject: Re: [Axis2] Phase Handlers
>
>
>  
>
>>So does this mean handlers are not in particular order INSIDE the phase?
>>
>>
>>On Mon, 8 Nov 2004 16:22:41 +0600, Deepal Jayasinghe
>><de...@opensource.lk> wrote:
>>    
>>
>>>hi;
>>>
>>>In the case of phase order it is true that phase order is not dynamic
>>>      
>>>
>and it
>  
>
>>>is specified in the server.xml.
>>>
>>>if the before and after implies "Hander" resolving phase rule may not be
>>>      
>>>
>so
>  
>
>>>simple ( L ) , I think before and after may be  "phases" NOT "Handlers".
>>>
>>>Thanks
>>>
>>>Deepal
>>>
>>>
>>>
>>>
>>>----- Original Message -----
>>>From: "Ajith Ranabahu" <aj...@gmail.com>
>>>To: <ax...@ws.apache.org>
>>>Sent: Monday, November 08, 2004 3:58 PM
>>>Subject: Re: [Axis2] Phase Handlers
>>>
>>>      
>>>
>>>>Hi,
>>>>I will try to answer these questions as far as I understand. Others
>>>>can correct me if I am also misundertood!
>>>>As far as I understand phases are logical groups of handlers. The
>>>>difference between the "chains" that were in axis 1 and  phases is the
>>>>ordering. This ordering may be fully/partly dynamic but they govern
>>>>the order the handlers are arranged. So infact a "phase" refers to the
>>>>logical ordering of the handlers.
>>>>
>>>>On Mon, 8 Nov 2004 15:12:28 +0600, Deepal Jayasinghe
>>>><de...@opensource.lk> wrote:
>>>>        
>>>>
>>>>>Hi all;
>>>>>I have started to develop a prototype to order the phase handlers.
>>>>>          
>>>>>
>And I
>  
>
>>>>>have encountered set of questions regarding the phase rules and
>>>>>          
>>>>>
>phase
>  
>
>>>>>handlers. Following is the format of a handler element.
>>>>>
>>>>> <handler/> ::= <handler ref="xs:anyURI"    | (name="xs:anyURI"
>>>>>class="...")>
>>>>>
>>>>>            <order (before="xs:anyURI" after="xs:anyURI")   |
>>>>>phase="xs:anyURI"
>>>>>
>>>>>                        phaseFirst="xs:boolean"
>>>>>          
>>>>>
>phaseLast="xs:boolean"/>
>  
>
>>>>>    <parameter/>*
>>>>>
>>>>>  </handler>
>>>>>
>>>>>What is really mean by before and after is that phase or handler?
>>>>>          
>>>>>
>>>>In the case of before and after they refer to "handlers". The phases
>>>>are NOT ordered dynamicaly, they are just static. (we can even give
>>>>the phase order in the axis global config file if we want to). However
>>>>every handler MUST belong to at least one phase.
>>>>
>>>>        
>>>>
>>>>>Can phases overlap one another?
>>>>>          
>>>>>
>>>>No. Phases should be treated as non-overlapping but you may add a
>>>>single handler to two phases which means the handler will be invoked
>>>>twice in the execution.(think about the logging handler) Since
>>>>handlers are stateless (the complete state is in the messageContext)
>>>>we can (should be) do this without a problem.
>>>>
>>>>        
>>>>
>>>>>Is that ok to think each handler should belong to a specific phase
>>>>>          
>>>>>
>and
>  
>
>>>that
>>>      
>>>
>>>>>phase should be specified at the service deployment time (i.e. each
>>>>>          
>>>>>
>>>hander
>>>      
>>>
>>>>>in the service document should come with a phase)?
>>>>>          
>>>>>
>>>>mmmm.. Phases are specified at the service deployment (thats ok) but a
>>>>handler can belong to multiple phases. So a handler may not belong to
>>>>a specific phase.
>>>>
>>>>        
>>>>
>>>>>Can I assume that phase of any handler cannot be null, i.e. phase of
>>>>>          
>>>>>
>a
>  
>
>>>>>handler is not optional.
>>>>>          
>>>>>
>>>>Yes. a handler MUST belong to a phase. However the deployer may ignore
>>>>the phase in which case a default phase is assumed. So as far as the
>>>>internal logic is consided a handler always has a phase
>>>>
>>>>        
>>>>
>>>>>Thanks
>>>>>
>>>>>==================================================
>>>>>Deepal Jayasinghe
>>>>>Lanka Software Foundation
>>>>>0714 817 310
>>>>>
>>>>>          
>>>>>
>>>>--
>>>>Ajith Ranabahu
>>>>
>>>>
>>>>        
>>>>
>>>      
>>>
>>-- 
>>Ajith Ranabahu
>>
>>
>>    
>>
>
>
>  
>


-- 
The best way to predict the future is to invent it - Alan Kay


Re: [Axis2] Phase Handlers

Posted by Deepal Jayasinghe <de...@opensource.lk>.
hi ;

I agree with you Ajith ,
both before and after should represent handlers , then only handlers can be
ordered properly.

And I think if some one is going to specify before and after the handlers
correspondences to those should be belong to the same Phase ;

i.e. for a  hander with the name "B"  and if    before ="C" and after = "A"
then all "A", "B","C" should belong to same phase ?

thanks

Deepal

----- Original Message ----- 
From: "Ajith Ranabahu" <aj...@gmail.com>
To: <ax...@ws.apache.org>
Sent: Monday, November 08, 2004 4:28 PM
Subject: Re: [Axis2] Phase Handlers


> So does this mean handlers are not in particular order INSIDE the phase?
>
>
> On Mon, 8 Nov 2004 16:22:41 +0600, Deepal Jayasinghe
> <de...@opensource.lk> wrote:
> > hi;
> >
> > In the case of phase order it is true that phase order is not dynamic
and it
> > is specified in the server.xml.
> >
> > if the before and after implies "Hander" resolving phase rule may not be
so
> > simple ( L ) , I think before and after may be  "phases" NOT "Handlers".
> >
> > Thanks
> >
> > Deepal
> >
> >
> >
> >
> > ----- Original Message -----
> > From: "Ajith Ranabahu" <aj...@gmail.com>
> > To: <ax...@ws.apache.org>
> > Sent: Monday, November 08, 2004 3:58 PM
> > Subject: Re: [Axis2] Phase Handlers
> >
> > > Hi,
> > > I will try to answer these questions as far as I understand. Others
> > > can correct me if I am also misundertood!
> > > As far as I understand phases are logical groups of handlers. The
> > > difference between the "chains" that were in axis 1 and  phases is the
> > > ordering. This ordering may be fully/partly dynamic but they govern
> > > the order the handlers are arranged. So infact a "phase" refers to the
> > > logical ordering of the handlers.
> > >
> > > On Mon, 8 Nov 2004 15:12:28 +0600, Deepal Jayasinghe
> > > <de...@opensource.lk> wrote:
> > > >
> > > > Hi all;
> > > > I have started to develop a prototype to order the phase handlers.
And I
> > > > have encountered set of questions regarding the phase rules and
phase
> > > > handlers. Following is the format of a handler element.
> > > >
> > > >  <handler/> ::= <handler ref="xs:anyURI"    | (name="xs:anyURI"
> > > > class="...")>
> > > >
> > > >             <order (before="xs:anyURI" after="xs:anyURI")   |
> > > > phase="xs:anyURI"
> > > >
> > > >                         phaseFirst="xs:boolean"
phaseLast="xs:boolean"/>
> > > >
> > > >     <parameter/>*
> > > >
> > > >   </handler>
> > > >
> > > > What is really mean by before and after is that phase or handler?
> > >
> > > In the case of before and after they refer to "handlers". The phases
> > > are NOT ordered dynamicaly, they are just static. (we can even give
> > > the phase order in the axis global config file if we want to). However
> > > every handler MUST belong to at least one phase.
> > >
> > > > Can phases overlap one another?
> > >
> > > No. Phases should be treated as non-overlapping but you may add a
> > > single handler to two phases which means the handler will be invoked
> > > twice in the execution.(think about the logging handler) Since
> > > handlers are stateless (the complete state is in the messageContext)
> > > we can (should be) do this without a problem.
> > >
> > > > Is that ok to think each handler should belong to a specific phase
and
> > that
> > > > phase should be specified at the service deployment time (i.e. each
> > hander
> > > > in the service document should come with a phase)?
> > >
> > > mmmm.. Phases are specified at the service deployment (thats ok) but a
> > > handler can belong to multiple phases. So a handler may not belong to
> > > a specific phase.
> > >
> > > > Can I assume that phase of any handler cannot be null, i.e. phase of
a
> > > > handler is not optional.
> > >
> > > Yes. a handler MUST belong to a phase. However the deployer may ignore
> > > the phase in which case a default phase is assumed. So as far as the
> > > internal logic is consided a handler always has a phase
> > >
> > > > Thanks
> > > >
> > > > ==================================================
> > > > Deepal Jayasinghe
> > > > Lanka Software Foundation
> > > > 0714 817 310
> > > >
> > >
> > >
> > > --
> > > Ajith Ranabahu
> > >
> > >
> >
> >
>
>
> -- 
> Ajith Ranabahu
>
>



Re: [Axis2] Phase Handlers

Posted by Ajith Ranabahu <aj...@gmail.com>.
So does this mean handlers are not in particular order INSIDE the phase?


On Mon, 8 Nov 2004 16:22:41 +0600, Deepal Jayasinghe
<de...@opensource.lk> wrote:
> hi;
> 
> In the case of phase order it is true that phase order is not dynamic and it
> is specified in the server.xml.
> 
> if the before and after implies "Hander" resolving phase rule may not be so
> simple ( L ) , I think before and after may be  "phases" NOT "Handlers".
> 
> Thanks
> 
> Deepal
> 
> 
> 
> 
> ----- Original Message -----
> From: "Ajith Ranabahu" <aj...@gmail.com>
> To: <ax...@ws.apache.org>
> Sent: Monday, November 08, 2004 3:58 PM
> Subject: Re: [Axis2] Phase Handlers
> 
> > Hi,
> > I will try to answer these questions as far as I understand. Others
> > can correct me if I am also misundertood!
> > As far as I understand phases are logical groups of handlers. The
> > difference between the "chains" that were in axis 1 and  phases is the
> > ordering. This ordering may be fully/partly dynamic but they govern
> > the order the handlers are arranged. So infact a "phase" refers to the
> > logical ordering of the handlers.
> >
> > On Mon, 8 Nov 2004 15:12:28 +0600, Deepal Jayasinghe
> > <de...@opensource.lk> wrote:
> > >
> > > Hi all;
> > > I have started to develop a prototype to order the phase handlers. And I
> > > have encountered set of questions regarding the phase rules and phase
> > > handlers. Following is the format of a handler element.
> > >
> > >  <handler/> ::= <handler ref="xs:anyURI"    | (name="xs:anyURI"
> > > class="...")>
> > >
> > >             <order (before="xs:anyURI" after="xs:anyURI")   |
> > > phase="xs:anyURI"
> > >
> > >                         phaseFirst="xs:boolean" phaseLast="xs:boolean"/>
> > >
> > >     <parameter/>*
> > >
> > >   </handler>
> > >
> > > What is really mean by before and after is that phase or handler?
> >
> > In the case of before and after they refer to "handlers". The phases
> > are NOT ordered dynamicaly, they are just static. (we can even give
> > the phase order in the axis global config file if we want to). However
> > every handler MUST belong to at least one phase.
> >
> > > Can phases overlap one another?
> >
> > No. Phases should be treated as non-overlapping but you may add a
> > single handler to two phases which means the handler will be invoked
> > twice in the execution.(think about the logging handler) Since
> > handlers are stateless (the complete state is in the messageContext)
> > we can (should be) do this without a problem.
> >
> > > Is that ok to think each handler should belong to a specific phase and
> that
> > > phase should be specified at the service deployment time (i.e. each
> hander
> > > in the service document should come with a phase)?
> >
> > mmmm.. Phases are specified at the service deployment (thats ok) but a
> > handler can belong to multiple phases. So a handler may not belong to
> > a specific phase.
> >
> > > Can I assume that phase of any handler cannot be null, i.e. phase of a
> > > handler is not optional.
> >
> > Yes. a handler MUST belong to a phase. However the deployer may ignore
> > the phase in which case a default phase is assumed. So as far as the
> > internal logic is consided a handler always has a phase
> >
> > > Thanks
> > >
> > > ==================================================
> > > Deepal Jayasinghe
> > > Lanka Software Foundation
> > > 0714 817 310
> > >
> >
> >
> > --
> > Ajith Ranabahu
> >
> >
> 
> 


-- 
Ajith Ranabahu

Re: [Axis2] Phase Handlers

Posted by Deepal Jayasinghe <de...@opensource.lk>.
hi;

In the case of phase order it is true that phase order is not dynamic and it
is specified in the server.xml.

if the before and after implies "Hander" resolving phase rule may not be so
simple ( L ) , I think before and after may be  "phases" NOT "Handlers".


Thanks

Deepal


----- Original Message ----- 
From: "Ajith Ranabahu" <aj...@gmail.com>
To: <ax...@ws.apache.org>
Sent: Monday, November 08, 2004 3:58 PM
Subject: Re: [Axis2] Phase Handlers


> Hi,
> I will try to answer these questions as far as I understand. Others
> can correct me if I am also misundertood!
> As far as I understand phases are logical groups of handlers. The
> difference between the "chains" that were in axis 1 and  phases is the
> ordering. This ordering may be fully/partly dynamic but they govern
> the order the handlers are arranged. So infact a "phase" refers to the
> logical ordering of the handlers.
>
> On Mon, 8 Nov 2004 15:12:28 +0600, Deepal Jayasinghe
> <de...@opensource.lk> wrote:
> >
> > Hi all;
> > I have started to develop a prototype to order the phase handlers. And I
> > have encountered set of questions regarding the phase rules and phase
> > handlers. Following is the format of a handler element.
> >
> >  <handler/> ::= <handler ref="xs:anyURI"    | (name="xs:anyURI"
> > class="...")>
> >
> >             <order (before="xs:anyURI" after="xs:anyURI")   |
> > phase="xs:anyURI"
> >
> >                         phaseFirst="xs:boolean" phaseLast="xs:boolean"/>
> >
> >     <parameter/>*
> >
> >   </handler>
> >
> > What is really mean by before and after is that phase or handler?
>
> In the case of before and after they refer to "handlers". The phases
> are NOT ordered dynamicaly, they are just static. (we can even give
> the phase order in the axis global config file if we want to). However
> every handler MUST belong to at least one phase.
>
> > Can phases overlap one another?
>
> No. Phases should be treated as non-overlapping but you may add a
> single handler to two phases which means the handler will be invoked
> twice in the execution.(think about the logging handler) Since
> handlers are stateless (the complete state is in the messageContext)
> we can (should be) do this without a problem.
>
> > Is that ok to think each handler should belong to a specific phase and
that
> > phase should be specified at the service deployment time (i.e. each
hander
> > in the service document should come with a phase)?
>
> mmmm.. Phases are specified at the service deployment (thats ok) but a
> handler can belong to multiple phases. So a handler may not belong to
> a specific phase.
>
> > Can I assume that phase of any handler cannot be null, i.e. phase of a
> > handler is not optional.
>
> Yes. a handler MUST belong to a phase. However the deployer may ignore
> the phase in which case a default phase is assumed. So as far as the
> internal logic is consided a handler always has a phase
>
> > Thanks
> >
> > ==================================================
> > Deepal Jayasinghe
> > Lanka Software Foundation
> > 0714 817 310
> >
>
>
> -- 
> Ajith Ranabahu
>
>



Re: [Axis2] Phase Handlers

Posted by Sanjiva Weerawarana <sa...@opensource.lk>.
Ah ok understood. But is that really useful? What value do
you suggest for the default phase???

Sanjiva.

----- Original Message ----- 
From: "Ajith Ranabahu" <aj...@gmail.com>
To: "Sanjiva Weerawarana" <sa...@opensource.lk>; "Axis developer list"
<ax...@ws.apache.org>
Sent: Tuesday, November 09, 2004 9:30 AM
Subject: Re: [Axis2] Phase Handlers


> Hi
> It seems that this is a small misunderstanding :). what I mean by the
> "default phase" is the phase that will be automatically applied if the
> user ignores the phase of a handler. In effect this means that a
> handler MUST have a phase/s associated with it in the runtime.
> If we try to do without the default phases then the user must declare
> the phase/s explicitly for each and every handler. My suggestion of
> "default phases" is to make that much more convenient
>
> Ajith
>
> On Tue, 9 Nov 2004 02:57:34 +0600, Sanjiva Weerawarana
> <sa...@opensource.lk> wrote:
> > +1 to everything except the idea of a "default phase." I'm not
> > convinced that would be necessary or useful ??
> >
> > Sanjiva.
> >
>
> -- 
> Ajith Ranabahu
>


Re: [Axis2] Phase Handlers

Posted by Ajith Ranabahu <aj...@gmail.com>.
Hi
It seems that this is a small misunderstanding :). what I mean by the
"default phase" is the phase that will be automatically applied if the
user ignores the phase of a handler. In effect this means that a
handler MUST have a phase/s associated with it in the runtime.
If we try to do without the default phases then the user must declare
the phase/s explicitly for each and every handler. My suggestion of
"default phases" is to make that much more convenient

Ajith

On Tue, 9 Nov 2004 02:57:34 +0600, Sanjiva Weerawarana
<sa...@opensource.lk> wrote:
> +1 to everything except the idea of a "default phase." I'm not
> convinced that would be necessary or useful ??
> 
> Sanjiva.
> 

-- 
Ajith Ranabahu

Re: [Axis2] Phase Handlers

Posted by Srinath Perera <he...@gmail.com>.
AFAIK we have limited ability specify how the handlers should be
inside a Phase expect, first and last, We talk about the relative
place of handlers at the  summit may be we need something like that
here.

But usually all the handlers in a one usually(thoughts :) ) written by
one Handler developer it leads to less confusion.
Thanks
Srinath 


On Tue, 9 Nov 2004 12:54:50 +0600, Ajith Ranabahu
<aj...@gmail.com> wrote:
> not much of thoughts but I have a single,very important question
> 
> * who/what is going to determine the order of the handlers INSIDE the
> phase then. Lets say you want to run the logging handler (the most
> famous example) before all the handlers. In other words you want it to
> be the first handler of the first phase. How can this be done?
> 
> 
> 
> 
> On Tue, 9 Nov 2004 12:32:34 +0600, Srinath Perera <he...@gmail.com> wrote:
> > Sorry, bit late to catch up  but seems (at least to me:D) we are
> > agreeing on something wrong!!
> > > > > In the case of before and after they refer to "handlers". The phases
> > > > > are NOT ordered dynamicaly, they are just static. (we can even give
> > > > > the phase order in the axis global config file if we want to). However
> > > > > every handler MUST belong to at least one phase.
> >
> > Here we going to decide on before, after refers to Handler names ..
> > not the phase name. To me that is wrong!!!
> > 1) The Handler writers do not know the handlers names of other
> > handlers (Handler names are subjected to change .. the rules based on
> > Handler names do not going to help us like set of defined phase.. so
> > all the rules should based on phases .. not handler names )
> > 2) If before/after is a handlers we do not need phases at all, we can
> > get all the orders by just referring to handlers!
> >
> > To me the rationale for Phases to Exist is handler developers do not
> > know the names of Handlers .. so we have defined phases, encryption
> > Phase, authentication phase ...RM phase logging phase ;)
> > All the rules are based on phases not handlers so the handler
> > developers can say I need to run the RM after authentication but
> > before encryption etc ......with out knowing the finer details about
> > the Encryption or security handlers.
> > thoughts?
> > Thanks
> > Srinath
> >
> 
> 
> --
> Ajith Ranabahu
>

Re: [Axis2] Phase Handlers

Posted by Ajith Ranabahu <aj...@gmail.com>.
not much of thoughts but I have a single,very important question

* who/what is going to determine the order of the handlers INSIDE the
phase then. Lets say you want to run the logging handler (the most
famous example) before all the handlers. In other words you want it to
be the first handler of the first phase. How can this be done?


On Tue, 9 Nov 2004 12:32:34 +0600, Srinath Perera <he...@gmail.com> wrote:
> Sorry, bit late to catch up  but seems (at least to me:D) we are
> agreeing on something wrong!!
> > > > In the case of before and after they refer to "handlers". The phases
> > > > are NOT ordered dynamicaly, they are just static. (we can even give
> > > > the phase order in the axis global config file if we want to). However
> > > > every handler MUST belong to at least one phase.
> 
> Here we going to decide on before, after refers to Handler names ..
> not the phase name. To me that is wrong!!!
> 1) The Handler writers do not know the handlers names of other
> handlers (Handler names are subjected to change .. the rules based on
> Handler names do not going to help us like set of defined phase.. so
> all the rules should based on phases .. not handler names )
> 2) If before/after is a handlers we do not need phases at all, we can
> get all the orders by just referring to handlers!
> 
> To me the rationale for Phases to Exist is handler developers do not
> know the names of Handlers .. so we have defined phases, encryption
> Phase, authentication phase ...RM phase logging phase ;)
> All the rules are based on phases not handlers so the handler
> developers can say I need to run the RM after authentication but
> before encryption etc ......with out knowing the finer details about
> the Encryption or security handlers.
> thoughts?
> Thanks
> Srinath
> 


-- 
Ajith Ranabahu

RE: [Axis2] Phase Handlers

Posted by Eran Chinthaka <ch...@opensource.lk>.
I think now we require a good explanation from the people who were in the
Axis 2 summit.

Can someone express thoughts on this handler phases. Better if its
descriptive.

________________________________

Eran Chinthaka
Lanka Software Foundation
 

> -----Original Message-----
> From: Srinath Perera [mailto:hemapani@gmail.com]
> Sent: Tuesday, November 09, 2004 2:25 PM
> To: axis-dev@ws.apache.org
> Subject: Re: [Axis2] Phase Handlers
> 
> > and I think phase property of a handler is no longer an optional field (
> ?)
> > then the user specify a phase in the phase field and he can also order
> the
> > phases using server.xml
> The adminsitreter will define the pahses and their order at the the
> server.xml file. There should be a defined set of pahses for Axis,e.g.
> Loging|Authentication|Encryption|RM||.......|Dispatch|.. for Phased
> handlers to be useful.
> Thanks
> Srinath




Re: [Axis2] Phase Handlers

Posted by Deepal Jayasinghe <de...@opensource.lk>.
hi;

I agree with you Ajith and I like to add something ;
> 2. before and after will be optional but will denote handlers and which
should belong to the same phase

Deepal

----- Original Message ----- 
From: "Ajith Ranabahu" <aj...@gmail.com>
To: <ax...@ws.apache.org>; "Srinath Perera" <he...@gmail.com>
Sent: Tuesday, November 09, 2004 2:43 PM
Subject: Re: [Axis2] Phase Handlers


> Ok can I make this suggesion. My suggestion is based on the following
> fragment of XML
>
> <handler ref="xs:anyURI"    | (name="xs:anyURI" class="...")>
>             <order (before="xs:anyURI" after="xs:anyURI")   |
phase="xs:anyURI"
>                phaseFirst="xs:boolean" phaseLast="xs:boolean"/>
>     <parameter/>*
>   </handler>
>
>
>
> 1. we make the phase attribute mandatory in the order element
> 2. before and after will be optional but will denote handlers.
> 3. phaseFirst and phaseLast may arouse confusions but lets just keep
> them for the time being.
>
> So the modified DD will look like this
>
> <handler ref="xs:anyURI"    | (name="xs:anyURI" class="...")>
>             <order (before="xs:anyURI" after="xs:anyURI")
phase="xs:anyURI"
>                phaseFirst="xs:boolean" phaseLast="xs:boolean"/>
>     <parameter/>*
>   </handler>
>
> The rational behind this is that when the service is deployed the
> deployer very well knows about the available phases. So specifying
> relative options seems to be YAGNI to me! (the deployer is to say
> where to put his handlers)
>
> thoughts ? :)
>
> Aj
>
>
> On Tue, 9 Nov 2004 14:24:31 +0600, Srinath Perera <he...@gmail.com>
wrote:
> > > and I think phase property of a handler is no longer an optional field
( ?)
> > > then the user specify a phase in the phase field and he can also order
the
> > > phases using server.xml
> > The adminsitreter will define the pahses and their order at the the
> > server.xml file. There should be a defined set of pahses for Axis,e.g.
> > Loging|Authentication|Encryption|RM||.......|Dispatch|.. for Phased
> > handlers to be useful.
> > Thanks
> > Srinath
> >
>
>
> -- 
> Ajith Ranabahu
>
>



Re: [Axis2] Phase Handlers

Posted by Ajith Ranabahu <aj...@gmail.com>.
Ok can I make this suggesion. My suggestion is based on the following
fragment of XML

<handler ref="xs:anyURI"    | (name="xs:anyURI" class="...")>
            <order (before="xs:anyURI" after="xs:anyURI")   | phase="xs:anyURI"
               phaseFirst="xs:boolean" phaseLast="xs:boolean"/>
    <parameter/>*
  </handler>



1. we make the phase attribute mandatory in the order element
2. before and after will be optional but will denote handlers.
3. phaseFirst and phaseLast may arouse confusions but lets just keep
them for the time being.

So the modified DD will look like this

<handler ref="xs:anyURI"    | (name="xs:anyURI" class="...")>
            <order (before="xs:anyURI" after="xs:anyURI")  phase="xs:anyURI"
               phaseFirst="xs:boolean" phaseLast="xs:boolean"/>
    <parameter/>*
  </handler>

The rational behind this is that when the service is deployed the
deployer very well knows about the available phases. So specifying
relative options seems to be YAGNI to me! (the deployer is to say
where to put his handlers)

thoughts ? :)

Aj


On Tue, 9 Nov 2004 14:24:31 +0600, Srinath Perera <he...@gmail.com> wrote:
> > and I think phase property of a handler is no longer an optional field ( ?)
> > then the user specify a phase in the phase field and he can also order the
> > phases using server.xml
> The adminsitreter will define the pahses and their order at the the
> server.xml file. There should be a defined set of pahses for Axis,e.g.
> Loging|Authentication|Encryption|RM||.......|Dispatch|.. for Phased
> handlers to be useful.
> Thanks
> Srinath
> 


-- 
Ajith Ranabahu

Re: [Axis2] Phase Handlers

Posted by Srinath Perera <he...@gmail.com>.
> and I think phase property of a handler is no longer an optional field ( ?)
> then the user specify a phase in the phase field and he can also order the
> phases using server.xml
The adminsitreter will define the pahses and their order at the the
server.xml file. There should be a defined set of pahses for Axis,e.g.
Loging|Authentication|Encryption|RM||.......|Dispatch|.. for Phased
handlers to be useful.
Thanks
Srinath

Re: [Axis2] Phase Handlers

Posted by Deepal Jayasinghe <de...@opensource.lk>.
hi  all (Srinath);

If before and after implies phase , how can we order handlers inside a phase
?

and I think phase property of a handler is no longer an optional field ( ?)
then the user specify a phase in the phase field and he can also order the
phases using server.xml

so what it really mean by after and before SHOULD mean phases ?

for me this is bit confusion :(

Deepal



----- Original Message ----- 
From: "Srinath Perera" <he...@gmail.com>
To: <ax...@ws.apache.org>
Sent: Tuesday, November 09, 2004 12:32 PM
Subject: Re: [Axis2] Phase Handlers


> Sorry, bit late to catch up  but seems (at least to me:D) we are
> agreeing on something wrong!!
> > > > In the case of before and after they refer to "handlers". The phases
> > > > are NOT ordered dynamicaly, they are just static. (we can even give
> > > > the phase order in the axis global config file if we want to).
However
> > > > every handler MUST belong to at least one phase.
>
> Here we going to decide on before, after refers to Handler names ..
> not the phase name. To me that is wrong!!!
> 1) The Handler writers do not know the handlers names of other
> handlers (Handler names are subjected to change .. the rules based on
> Handler names do not going to help us like set of defined phase.. so
> all the rules should based on phases .. not handler names )
> 2) If before/after is a handlers we do not need phases at all, we can
> get all the orders by just referring to handlers!
>
> To me the rationale for Phases to Exist is handler developers do not
> know the names of Handlers .. so we have defined phases, encryption
> Phase, authentication phase ...RM phase logging phase ;)
> All the rules are based on phases not handlers so the handler
> developers can say I need to run the RM after authentication but
> before encryption etc ......with out knowing the finer details about
> the Encryption or security handlers.
> thoughts?
> Thanks
> Srinath
>
>



Re: [Axis2] Phase Handlers

Posted by Srinath Perera <he...@gmail.com>.
Sorry, bit late to catch up  but seems (at least to me:D) we are
agreeing on something wrong!!
> > > In the case of before and after they refer to "handlers". The phases
> > > are NOT ordered dynamicaly, they are just static. (we can even give
> > > the phase order in the axis global config file if we want to). However
> > > every handler MUST belong to at least one phase.

Here we going to decide on before, after refers to Handler names ..
not the phase name. To me that is wrong!!!
1) The Handler writers do not know the handlers names of other
handlers (Handler names are subjected to change .. the rules based on
Handler names do not going to help us like set of defined phase.. so
all the rules should based on phases .. not handler names )
2) If before/after is a handlers we do not need phases at all, we can
get all the orders by just referring to handlers!

To me the rationale for Phases to Exist is handler developers do not
know the names of Handlers .. so we have defined phases, encryption
Phase, authentication phase ...RM phase logging phase ;)
All the rules are based on phases not handlers so the handler
developers can say I need to run the RM after authentication but
before encryption etc ......with out knowing the finer details about
the Encryption or security handlers.
thoughts?
Thanks
Srinath

Re: [Axis2] Phase Handlers

Posted by Deepal Jayasinghe <de...@opensource.lk>.
I also don't like the idea of having default phase  and we do not need to
default phase if and only if  phase is not optional.
and then user can specify before and after if he want otherwise we can place
handler any where in the specified phase.

Deepal

----- Original Message ----- 
From: "Sanjiva Weerawarana" <sa...@opensource.lk>
To: <ax...@ws.apache.org>; "Ajith Ranabahu" <aj...@gmail.com>
Sent: Tuesday, November 09, 2004 2:57 AM
Subject: Re: [Axis2] Phase Handlers


> +1 to everything except the idea of a "default phase." I'm not
> convinced that would be necessary or useful ??
>
> Sanjiva.
>
> ----- Original Message ----- 
> From: "Ajith Ranabahu" <aj...@gmail.com>
> To: <ax...@ws.apache.org>
> Sent: Monday, November 08, 2004 3:58 PM
> Subject: Re: [Axis2] Phase Handlers
>
>
> > Hi,
> > I will try to answer these questions as far as I understand. Others
> > can correct me if I am also misundertood!
> > As far as I understand phases are logical groups of handlers. The
> > difference between the "chains" that were in axis 1 and  phases is the
> > ordering. This ordering may be fully/partly dynamic but they govern
> > the order the handlers are arranged. So infact a "phase" refers to the
> > logical ordering of the handlers.
> >
> > On Mon, 8 Nov 2004 15:12:28 +0600, Deepal Jayasinghe
> > <de...@opensource.lk> wrote:
> > >
> > > Hi all;
> > > I have started to develop a prototype to order the phase handlers. And
I
> > > have encountered set of questions regarding the phase rules and phase
> > > handlers. Following is the format of a handler element.
> > >
> > >  <handler/> ::= <handler ref="xs:anyURI"    | (name="xs:anyURI"
> > > class="...")>
> > >
> > >             <order (before="xs:anyURI" after="xs:anyURI")   |
> > > phase="xs:anyURI"
> > >
> > >                         phaseFirst="xs:boolean"
phaseLast="xs:boolean"/>
> > >
> > >     <parameter/>*
> > >
> > >   </handler>
> > >
> > > What is really mean by before and after is that phase or handler?
> >
> > In the case of before and after they refer to "handlers". The phases
> > are NOT ordered dynamicaly, they are just static. (we can even give
> > the phase order in the axis global config file if we want to). However
> > every handler MUST belong to at least one phase.
> >
> > > Can phases overlap one another?
> >
> > No. Phases should be treated as non-overlapping but you may add a
> > single handler to two phases which means the handler will be invoked
> > twice in the execution.(think about the logging handler) Since
> > handlers are stateless (the complete state is in the messageContext)
> > we can (should be) do this without a problem.
> >
> > > Is that ok to think each handler should belong to a specific phase and
> that
> > > phase should be specified at the service deployment time (i.e. each
> hander
> > > in the service document should come with a phase)?
> >
> > mmmm.. Phases are specified at the service deployment (thats ok) but a
> > handler can belong to multiple phases. So a handler may not belong to
> > a specific phase.
> >
> > > Can I assume that phase of any handler cannot be null, i.e. phase of a
> > > handler is not optional.
> >
> > Yes. a handler MUST belong to a phase. However the deployer may ignore
> > the phase in which case a default phase is assumed. So as far as the
> > internal logic is consided a handler always has a phase
> >
> > > Thanks
> > >
> > > ==================================================
> > > Deepal Jayasinghe
> > > Lanka Software Foundation
> > > 0714 817 310
> > >
> >
> >
> > -- 
> > Ajith Ranabahu
> >
>
>
>



Re: [Axis2] Phase Handlers

Posted by Sanjiva Weerawarana <sa...@opensource.lk>.
+1 to everything except the idea of a "default phase." I'm not
convinced that would be necessary or useful ??

Sanjiva.

----- Original Message ----- 
From: "Ajith Ranabahu" <aj...@gmail.com>
To: <ax...@ws.apache.org>
Sent: Monday, November 08, 2004 3:58 PM
Subject: Re: [Axis2] Phase Handlers


> Hi,
> I will try to answer these questions as far as I understand. Others
> can correct me if I am also misundertood!
> As far as I understand phases are logical groups of handlers. The
> difference between the "chains" that were in axis 1 and  phases is the
> ordering. This ordering may be fully/partly dynamic but they govern
> the order the handlers are arranged. So infact a "phase" refers to the
> logical ordering of the handlers.
>
> On Mon, 8 Nov 2004 15:12:28 +0600, Deepal Jayasinghe
> <de...@opensource.lk> wrote:
> >
> > Hi all;
> > I have started to develop a prototype to order the phase handlers. And I
> > have encountered set of questions regarding the phase rules and phase
> > handlers. Following is the format of a handler element.
> >
> >  <handler/> ::= <handler ref="xs:anyURI"    | (name="xs:anyURI"
> > class="...")>
> >
> >             <order (before="xs:anyURI" after="xs:anyURI")   |
> > phase="xs:anyURI"
> >
> >                         phaseFirst="xs:boolean" phaseLast="xs:boolean"/>
> >
> >     <parameter/>*
> >
> >   </handler>
> >
> > What is really mean by before and after is that phase or handler?
>
> In the case of before and after they refer to "handlers". The phases
> are NOT ordered dynamicaly, they are just static. (we can even give
> the phase order in the axis global config file if we want to). However
> every handler MUST belong to at least one phase.
>
> > Can phases overlap one another?
>
> No. Phases should be treated as non-overlapping but you may add a
> single handler to two phases which means the handler will be invoked
> twice in the execution.(think about the logging handler) Since
> handlers are stateless (the complete state is in the messageContext)
> we can (should be) do this without a problem.
>
> > Is that ok to think each handler should belong to a specific phase and
that
> > phase should be specified at the service deployment time (i.e. each
hander
> > in the service document should come with a phase)?
>
> mmmm.. Phases are specified at the service deployment (thats ok) but a
> handler can belong to multiple phases. So a handler may not belong to
> a specific phase.
>
> > Can I assume that phase of any handler cannot be null, i.e. phase of a
> > handler is not optional.
>
> Yes. a handler MUST belong to a phase. However the deployer may ignore
> the phase in which case a default phase is assumed. So as far as the
> internal logic is consided a handler always has a phase
>
> > Thanks
> >
> > ==================================================
> > Deepal Jayasinghe
> > Lanka Software Foundation
> > 0714 817 310
> >
>
>
> -- 
> Ajith Ranabahu
>


Re: [Axis2] Phase Handlers

Posted by Ajith Ranabahu <aj...@gmail.com>.
Hi,
I will try to answer these questions as far as I understand. Others
can correct me if I am also misundertood!
As far as I understand phases are logical groups of handlers. The
difference between the "chains" that were in axis 1 and  phases is the
ordering. This ordering may be fully/partly dynamic but they govern
the order the handlers are arranged. So infact a "phase" refers to the
logical ordering of the handlers.

On Mon, 8 Nov 2004 15:12:28 +0600, Deepal Jayasinghe
<de...@opensource.lk> wrote:
>  
> Hi all;
> I have started to develop a prototype to order the phase handlers. And I
> have encountered set of questions regarding the phase rules and phase
> handlers. Following is the format of a handler element.  
> 
>  <handler/> ::= <handler ref="xs:anyURI"    | (name="xs:anyURI"
> class="...")>
> 
>             <order (before="xs:anyURI" after="xs:anyURI")   |
> phase="xs:anyURI"
> 
>                         phaseFirst="xs:boolean" phaseLast="xs:boolean"/>
> 
>     <parameter/>*
> 
>   </handler>
> 
> What is really mean by before and after is that phase or handler? 

In the case of before and after they refer to "handlers". The phases
are NOT ordered dynamicaly, they are just static. (we can even give
the phase order in the axis global config file if we want to). However
every handler MUST belong to at least one phase.

> Can phases overlap one another?   

No. Phases should be treated as non-overlapping but you may add a
single handler to two phases which means the handler will be invoked
twice in the execution.(think about the logging handler) Since
handlers are stateless (the complete state is in the messageContext)
we can (should be) do this without a problem.

> Is that ok to think each handler should belong to a specific phase and that
> phase should be specified at the service deployment time (i.e. each hander
> in the service document should come with a phase)? 

mmmm.. Phases are specified at the service deployment (thats ok) but a
handler can belong to multiple phases. So a handler may not belong to
a specific phase.

> Can I assume that phase of any handler cannot be null, i.e. phase of a
> handler is not optional. 

Yes. a handler MUST belong to a phase. However the deployer may ignore
the phase in which case a default phase is assumed. So as far as the
internal logic is consided a handler always has a phase

> Thanks
> 
> ==================================================
> Deepal Jayasinghe
> Lanka Software Foundation
> 0714 817 310
> 


-- 
Ajith Ranabahu