org.apache.axis2.context
Class ServiceContext

java.lang.Object
  extended by org.apache.axis2.context.AbstractContext
      extended by org.apache.axis2.context.ServiceContext
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, SafeSerializable

public class ServiceContext
extends AbstractContext
implements java.io.Externalizable, SafeSerializable

Well this is never clearly defined, what it does or the life-cycle. So do NOT use this as it might not live up to your expectation.

See Also:
Serialized Form

Field Summary
static java.lang.String SERVICE_OBJECT
           
 
Fields inherited from class org.apache.axis2.context.AbstractContext
COPY_PROPERTIES, lastTouchedTime, parent, properties
 
Constructor Summary
ServiceContext()
          Public constructor (only here because this class is Externalizable)
 
Method Summary
 void activate(ConfigurationContext cc)
          This method checks to see if additional work needs to be done in order to complete the object reconstitution.
 OperationContext createOperationContext(AxisOperation axisOp)
           
 OperationContext createOperationContext(QName name)
           
 AxisService getAxisService()
           
 ConfigurationContext getConfigurationContext()
           
 java.lang.String getGroupName()
          Returns a name associated with the ServiceGroupContext associated with this ServiceContext.
 OperationContext getLastOperationContext()
           
 java.lang.String getLogCorrelationIDString()
          Get the ID associated with this object instance.
 EndpointReference getMyEPR()
           
 EndpointReference getMyEPR(java.lang.String transport)
          To get the ERP for a given service , if the transport is present and not running then it will add as a listener to ListenerManager , there it will init that and start the listener , and finally ask the EPR from transport for a given service
 java.lang.String getName()
          Returns a name associated with this ServiceContext.
 ConfigurationContext getRootContext()
           
 ServiceGroupContext getServiceGroupContext()
           
 EndpointReference getTargetEPR()
           
 boolean isCachingOperationContext()
           
 boolean isEquivalent(ServiceContext ctx)
          Compares key parts of the state from the current instance of this class with the specified instance to see if they are equivalent.
 void putContextProperties(ServiceContext context, boolean doParentProperties)
          This will do a copy of the properties from this context object to the properties of the specified context object.
 void readExternal(java.io.ObjectInput inObject)
          Restore the contents of the object that was previously saved.
 void setCachingOperationContext(boolean cacheLastOperationContext)
           
 void setLastOperationContext(OperationContext lastOperationContext)
           
 void setMyEPR(EndpointReference myEPR)
           
 void setTargetEPR(EndpointReference targetEPR)
           
 void writeExternal(java.io.ObjectOutput o)
          Save the contents of this object.
 
Methods inherited from class org.apache.axis2.context.AbstractContext
clearPropertyDifferences, flush, getLastTouchedTime, getLocalProperty, getParent, getProperties, getProperty, getPropertyDifferences, getPropertyNames, getPropertyNonReplicable, isAncestor, mergeProperties, removeProperty, removePropertyNonReplicable, setLastTouchedTime, setNonReplicableProperty, setParent, setProperties, setProperty, touch
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SERVICE_OBJECT

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

ServiceContext

public ServiceContext()
Public constructor (only here because this class is Externalizable)

Method Detail

createOperationContext

public OperationContext createOperationContext(QName name)

createOperationContext

public OperationContext createOperationContext(AxisOperation axisOp)

getAxisService

public AxisService getAxisService()

getConfigurationContext

public ConfigurationContext getConfigurationContext()

getServiceGroupContext

public ServiceGroupContext getServiceGroupContext()

getMyEPR

public EndpointReference getMyEPR(java.lang.String transport)
                           throws AxisFault
To get the ERP for a given service , if the transport is present and not running then it will add as a listener to ListenerManager , there it will init that and start the listener , and finally ask the EPR from transport for a given service

Parameters:
transport - : Name of the transport
Returns:
Throws:
AxisFault

getTargetEPR

public EndpointReference getTargetEPR()

setTargetEPR

public void setTargetEPR(EndpointReference targetEPR)

getMyEPR

public EndpointReference getMyEPR()

setMyEPR

public void setMyEPR(EndpointReference myEPR)

getLastOperationContext

public OperationContext getLastOperationContext()

setLastOperationContext

public void setLastOperationContext(OperationContext lastOperationContext)

isCachingOperationContext

public boolean isCachingOperationContext()

setCachingOperationContext

public void setCachingOperationContext(boolean cacheLastOperationContext)

getName

public java.lang.String getName()
Returns a name associated with this ServiceContext.

Note: this name is from the corresponding AxisService object.

Returns:
The name string, or null if no name can be found

getGroupName

public java.lang.String getGroupName()
Returns a name associated with the ServiceGroupContext associated with this ServiceContext.

Returns:
The name string, or null if no name can be found

writeExternal

public void writeExternal(java.io.ObjectOutput o)
                   throws java.io.IOException
Save the contents of this object.

NOTE: Transient fields and static fields are not saved. Also, objects that represent "static" data are not saved, except for enough information to be able to find matching objects when the message context is re-constituted.

Specified by:
writeExternal in interface java.io.Externalizable
Parameters:
out - The stream to write the object contents to
Throws:
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput inObject)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Restore the contents of the object that was previously saved.

NOTE: The field data must read back in the same order and type as it was written. Some data will need to be validated when resurrected.

Specified by:
readExternal in interface java.io.Externalizable
Parameters:
in - The stream to read the object contents from
Throws:
java.io.IOException
java.lang.ClassNotFoundException

activate

public void activate(ConfigurationContext cc)
This method checks to see if additional work needs to be done in order to complete the object reconstitution. Some parts of the object restored from the readExternal() cannot be completed until we have a configurationContext from the active engine. The configurationContext is used to help this object to plug back into the engine's configuration and deployment objects.

Parameters:
cc - The configuration context object representing the active configuration

putContextProperties

public void putContextProperties(ServiceContext context,
                                 boolean doParentProperties)
This will do a copy of the properties from this context object to the properties of the specified context object.

Parameters:
context - The ServiceContext object to hold the merged properties
doParentProperties - Indicates whether to go up the context hierachy copy the properties at each level

isEquivalent

public boolean isEquivalent(ServiceContext ctx)
Compares key parts of the state from the current instance of this class with the specified instance to see if they are equivalent.

This differs from the java.lang.Object.equals() method in that the equals() method generally looks at both the object identity (location in memory) and the object state (data).

Parameters:
ctx -
Returns:
TRUE if this object is equivalent with the specified object that is, key fields match FALSE, otherwise

getLogCorrelationIDString

public java.lang.String getLogCorrelationIDString()
Get the ID associated with this object instance.

Returns:
A string that can be output to a log file as an identifier for this object instance. It is suitable for matching related log entries.

getRootContext

public ConfigurationContext getRootContext()
Specified by:
getRootContext in class AbstractContext


Copyright © 2007 Apache Web Services Project. All Rights Reserved.