Class ServiceContextBase
java.lang.Object
com.sun.corba.ee.spi.servicecontext.ServiceContextBase
- Direct Known Subclasses:
CodeSetServiceContextImpl
,MaxStreamFormatVersionServiceContextImpl
,ORBVersionServiceContextImpl
,SendingContextServiceContextImpl
,UEInfoServiceContextImpl
,UnknownServiceContextImpl
Base class for all ServiceContext classes.
There is a derived ServiceContext class for each service context that
the ORB supports. Each subclass encapsulates the representation of
the service context and provides any needed methods for manipulating
the service context. Each subclass must provide the following
members:
- a public static final int SERVICE_CONTEXT_ID that gives the OMG (or other) defined id for the service context. This is needed for the registration mechanism defined in ServiceContexts. OMG defined service context ids are taken from section 13.6.7 of ptc/98-12-04.
- a public constructor that takes an InputStream as its argument.
- Appropriate definitions of getId() and writeData(). getId() must return SERVICE_CONTEXT_ID.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate byte[]
Simple default constructor used when subclass is constructed from its representation.protected InputStream
in is the stream containing the service context representation.private static final ORBUtilSystemException
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
protected
Stream constructor used when subclass is constructed from an InputStream. -
Method Summary
Modifier and TypeMethodDescriptionabstract int
getId()
Returns Service context id.toString()
void
write
(OutputStream s, GIOPVersion gv) Write the service context to an output stream.protected abstract void
Writes the data used to represent the subclasses service context into an encapsulation stream.
-
Field Details
-
wrapper
-
data
private byte[] dataSimple default constructor used when subclass is constructed from its representation. -
in
in is the stream containing the service context representation. It is constructed by the stream constructor, and available for use in the subclass stream constructor.
-
-
Constructor Details
-
ServiceContextBase
protected ServiceContextBase() -
ServiceContextBase
Stream constructor used when subclass is constructed from an InputStream. This constructor must be called by super( stream ) in the subclass. After this constructor completes, the service context representation can be read from in. Note that the service context id has been consumed from the input stream before this object is constructed.- Parameters:
s
- stream to use to construct context
-
-
Method Details
-
getId
public abstract int getId()Returns Service context id. Must be overloaded in subclass.- Returns:
- context id
-
write
Write the service context to an output stream. This method must be used for writing the service context to a request or reply header.- Parameters:
s
- stream to write togv
- version of the service context- Throws:
SystemException
- if an error occurred writing to the stream
-
writeData
Writes the data used to represent the subclasses service context into an encapsulation stream. Must be overloaded in subclass.- Parameters:
os
- stream to write to
-
toString
-