Package org.apache.axis2.context
Class ServiceGroupContext
- java.lang.Object
-
- org.apache.axis2.context.AbstractContext
-
- org.apache.axis2.context.ServiceGroupContext
-
- All Implemented Interfaces:
Externalizable
,Serializable
,SafeSerializable
public class ServiceGroupContext extends AbstractContext implements Externalizable, SafeSerializable
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.apache.axis2.context.AbstractContext
COPY_PROPERTIES, lastTouchedTime, parent, properties
-
-
Constructor Summary
Constructors Constructor Description ServiceGroupContext()
ServiceGroupContext(ConfigurationContext parent, AxisServiceGroup axisServiceGroup)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
activate(ConfigurationContext cc)
Some parts of the object restored from the readExternal deserialization work cannot be completed until we have a configurationContext.void
addServiceContext(ServiceContext srvctx)
Adds the specified service context object to the lists of service contexts for this service group context.ServiceContext
findServiceContext(String name)
Finds the service context object that corresponds to the specified name from the list of service contexts for this service group context.ServiceContext
findServiceContext(AxisService axisSrv)
Finds the service context object that corresponds to the specified AxisService from the list of service contexts for this service group context.AxisServiceGroup
getDescription()
String
getId()
ConfigurationContext
getRootContext()
ServiceContext
getServiceContext(AxisService service)
Gets a service context.Iterator<ServiceContext>
getServiceContexts()
boolean
isEquivalent(ServiceGroupContext 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(ServiceGroupContext context)
This will do a copy of the properties from this context object to the properties of the specified context object.void
readExternal(ObjectInput inObject)
Restore the contents of the object that was previously saved.void
setId(String id)
void
writeExternal(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
-
-
-
-
Constructor Detail
-
ServiceGroupContext
public ServiceGroupContext()
-
ServiceGroupContext
public ServiceGroupContext(ConfigurationContext parent, AxisServiceGroup axisServiceGroup)
-
-
Method Detail
-
getDescription
public AxisServiceGroup getDescription()
-
getId
public String getId()
-
getServiceContext
public ServiceContext getServiceContext(AxisService service) throws AxisFault
Gets a service context. Creates a new one from AxisService. There is no need to store service context inside serviceGroup context as well.- Parameters:
service
- the AxisService for which to get a context- Returns:
- Returns ServiceContext.
- Throws:
AxisFault
- if something goes wrong
-
getServiceContexts
public Iterator<ServiceContext> getServiceContexts()
-
setId
public void setId(String id)
-
addServiceContext
public void addServiceContext(ServiceContext srvctx)
Adds the specified service context object to the lists of service contexts for this service group context.- Parameters:
srvctx
- The ServiceContext object to add
-
findServiceContext
public ServiceContext findServiceContext(String name)
Finds the service context object that corresponds to the specified name from the list of service contexts for this service group context.- Parameters:
name
- The name associated with the ServiceContext- Returns:
- The ServiceContext associated with the name, or null, if none can be found
-
findServiceContext
public ServiceContext findServiceContext(AxisService axisSrv)
Finds the service context object that corresponds to the specified AxisService from the list of service contexts for this service group context.- Parameters:
axisSrv
- the AxisService whose context we're looking for- Returns:
- The ServiceContext associated with the AxisService or null, if none can be found
-
putContextProperties
public void putContextProperties(ServiceGroupContext context)
This will do a copy of the properties from this context object to the properties of the specified context object.- Parameters:
context
- The ServiceGroupContext object to hold the merged properties
-
writeExternal
public void writeExternal(ObjectOutput o) throws 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 interfaceExternalizable
- Parameters:
out
- The stream to write the object contents to- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput inObject) throws IOException, 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 interfaceExternalizable
- Parameters:
in
- The stream to read the object contents from- Throws:
IOException
ClassNotFoundException
-
activate
public void activate(ConfigurationContext cc)
Some parts of the object restored from the readExternal deserialization work cannot be completed until we have a configurationContext. This method checks to see if additional work needs to be done in order to complete the object reconstitution.- Parameters:
cc
- the active ConfigurationContext
-
isEquivalent
public boolean isEquivalent(ServiceGroupContext 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
- The object to compare with- Returns:
- TRUE if this object is equivalent with the specified object that is, key fields match FALSE, otherwise
-
getRootContext
public ConfigurationContext getRootContext()
- Specified by:
getRootContext
in classAbstractContext
-
-