org.apache.axis2.engine
Class Phase

java.lang.Object
  extended byorg.apache.axis2.engine.Phase
All Implemented Interfaces:
Handler
Direct Known Subclasses:
DispatchPhase

public class Phase
extends java.lang.Object
implements Handler

A Phase is an ordered collection of Handlers.


Nested Class Summary
 
Nested classes inherited from class org.apache.axis2.engine.Handler
Handler.InvocationResponse
 
Field Summary
static java.lang.String ALL_PHASES
           
 
Constructor Summary
Phase()
           
Phase(java.lang.String phaseName)
          Constructor Phase.
 
Method Summary
 void addHandler(Handler handler)
          Adds handler to the collection.
 void addHandler(HandlerDescription handler)
          Method addHandler.
 void addHandler(Handler handler, int index)
          Method addHandler.
 void checkPostConditions(MessageContext msgContext)
           
 void checkPreconditions(MessageContext msgContext)
           
 void cleanup()
          Since this might change the whole behavior of Axis2 handlers, and since this is still under discussion (http://marc.theaimsgroup.com/?l=axis-dev&m=114504084929285&w=2) implementation of this method is deferred.
 void flowComplete(MessageContext msgContext)
          This method will be called on each registered handler that had its invoke(...) method called during the processing of the message, once the message processing has completed.
 int getHandlerCount()
           
 HandlerDescription getHandlerDesc()
          Gets the HandlerDescription of a handler.
 java.util.ArrayList getHandlers()
          Gets all the handlers in the phase.
 java.lang.String getName()
          Method getName.
 Parameter getParameter(java.lang.String name)
          Method getParameter.
 java.lang.String getPhaseName()
           
 void init(HandlerDescription handlerdesc)
          Method init.
 Handler.InvocationResponse invoke(MessageContext msgctx)
          invokes all the handlers in this Phase
 void removeHandler(HandlerDescription handler)
          To remove a given hnadler from a phase
 void setName(java.lang.String phaseName)
           
 void setPhaseFirst(Handler phaseFirst)
          Method setPhaseFirst.
 void setPhaseLast(Handler phaseLast)
          Method setPhaseLast.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ALL_PHASES

public static final java.lang.String ALL_PHASES
See Also:
Constant Field Values
Constructor Detail

Phase

public Phase()

Phase

public Phase(java.lang.String phaseName)
Constructor Phase.

Parameters:
phaseName -
Method Detail

addHandler

public void addHandler(Handler handler)
Adds handler to the collection.

Parameters:
handler -

addHandler

public void addHandler(HandlerDescription handler)
                throws PhaseException
Method addHandler.

Parameters:
handler -
Throws:
PhaseException

addHandler

public void addHandler(Handler handler,
                       int index)
Method addHandler.

Parameters:
handler -
index -

checkPostConditions

public void checkPostConditions(MessageContext msgContext)
                         throws AxisFault
Throws:
AxisFault

checkPreconditions

public void checkPreconditions(MessageContext msgContext)
                        throws AxisFault
Throws:
AxisFault

cleanup

public void cleanup()
Description copied from interface: Handler
Since this might change the whole behavior of Axis2 handlers, and since this is still under discussion (http://marc.theaimsgroup.com/?l=axis-dev&m=114504084929285&w=2) implementation of this method is deferred. Note : This method will not be automatically called, from Axis2 engine, until this is fully implemented.

Specified by:
cleanup in interface Handler

init

public void init(HandlerDescription handlerdesc)
Description copied from interface: Handler
Method init.

Specified by:
init in interface Handler
Parameters:
handlerdesc -

invoke

public final Handler.InvocationResponse invoke(MessageContext msgctx)
                                        throws AxisFault
invokes all the handlers in this Phase

Specified by:
invoke in interface Handler
Parameters:
msgctx -
Returns:
An InvocationResponse that indicates what the next step in the message processing should be.
Throws:
AxisFault

flowComplete

public void flowComplete(MessageContext msgContext)
Description copied from interface: Handler
This method will be called on each registered handler that had its invoke(...) method called during the processing of the message, once the message processing has completed. During execution of the flowComplete's, handlers are invoked in the opposite order that they were invoked originally.

Specified by:
flowComplete in interface Handler
Parameters:
msgContext - the MessageContext to process with this Handler.

toString

public java.lang.String toString()

getHandlerCount

public int getHandlerCount()

getHandlerDesc

public HandlerDescription getHandlerDesc()
Description copied from interface: Handler
Gets the HandlerDescription of a handler. This is used as an input to get phaseRule of a handler.

Specified by:
getHandlerDesc in interface Handler
Returns:
Returns HandlerDescription.

getHandlers

public java.util.ArrayList getHandlers()
Gets all the handlers in the phase.

Returns:
Returns an ArrayList of Handlers

getName

public java.lang.String getName()
Description copied from interface: Handler
Method getName.

Specified by:
getName in interface Handler
Returns:
Returns String

getParameter

public Parameter getParameter(java.lang.String name)
Description copied from interface: Handler
Method getParameter.

Specified by:
getParameter in interface Handler
Parameters:
name -
Returns:
Returns Parameter.

getPhaseName

public java.lang.String getPhaseName()
Returns:
Returns the name.

setName

public void setName(java.lang.String phaseName)

setPhaseFirst

public void setPhaseFirst(Handler phaseFirst)
                   throws PhaseException
Method setPhaseFirst.

Parameters:
phaseFirst -
Throws:
PhaseException

setPhaseLast

public void setPhaseLast(Handler phaseLast)
                  throws PhaseException
Method setPhaseLast.

Parameters:
phaseLast -
Throws:
PhaseException

removeHandler

public void removeHandler(HandlerDescription handler)
To remove a given hnadler from a phase

Parameters:
handler -


Copyright © 2004-2007 Apache Software Foundation. All Rights Reserved.