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 Aleksander Slominski <as...@cs.indiana.edu> on 2004/11/08 22:39:08 UTC

handlers phases: dependency (and metadata) in handlers?

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][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
> 
>