Class ServiceContextsImpl
java.lang.Object
com.sun.corba.ee.impl.servicecontext.ServiceContextsImpl
- All Implemented Interfaces:
ServiceContexts
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate CodeBaseprivate static final AtomicIntegerprivate GIOPVersionprivate final ORBMap of all ServiceContext objects in this container.private static final ORBUtilSystemException -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateServiceContextsImpl(ORB orb) Read the Service contexts from the input stream. -
Method Summary
Modifier and TypeMethodDescriptioncopy()send back a shallow copy of the ServiceContexts containerprivate voidcouldNotFindServiceContextFactory(int scid) private voidGiven the input stream, this fills our service context map.voiddelete(int scId) Remove the service context with the id, if any.private voidfoundServiceContextFactory(int scid) get(int id) Return the service context with scId, or null if not found.private Stringprivate voidnumberValid(int num) voidput(ServiceContext sc) Add a service context.private voidreadingServiceContextId(int id) private voidserviceContextIdFound(int id) private voidserviceContextIdNotFound(int id) private voidserviceContextLength(int len) private ServiceContextunmarshal(int scId, byte[] data) Find the ServiceContextData for a given scId and unmarshal the bytes.private voidunmarshallingServiceContext(int id) voidwrite(OutputStream os, GIOPVersion gv) Write the service contexts to the output stream.private voidwriteMapEntry(OutputStream os, int id, Object scObj, GIOPVersion gv) Write the given entry from the scMap to the OutputStream.private voidWrite the service contexts in scMap in a desired order.private voidprivate voidwritingServiceContextBytesFor(int id)
-
Field Details
-
wrapper
-
creationCount
-
orb
-
scMap
Map of all ServiceContext objects in this container. Keys are java.lang.Integers for service context IDs. Values are either instances of ServiceContext or the unmarshaled byte arrays (unmarshaled on first use). This provides a mild optimization if we don't happen to use a given service context, but it's main advantage is that it allows us to change the order in which we unmarshal them. We need to do the UnknownExceptionInfo service context after the SendingContextRunTime service context so that we can get the CodeBase if necessary. -
codeBase
-
giopVersion
-
-
Constructor Details
-
ServiceContextsImpl
-
ServiceContextsImpl
Read the Service contexts from the input stream.- Parameters:
s- Stream to get context from
-
ServiceContextsImpl
-
-
Method Details
-
getValidSCIds
-
numberValid
@InfoMethod private void numberValid(int num) -
readingServiceContextId
@InfoMethod private void readingServiceContextId(int id) -
serviceContextLength
@InfoMethod private void serviceContextLength(int len) -
createMapFromInputStream
Given the input stream, this fills our service context map. See the definition of scMap for details. Creates a HashMap. Note that we don't actually unmarshal the bytes of the service contexts here. That is done when they are actually requested via get(int). -
couldNotFindServiceContextFactory
@InfoMethod private void couldNotFindServiceContextFactory(int scid) -
foundServiceContextFactory
@InfoMethod private void foundServiceContextFactory(int scid) -
unmarshal
Find the ServiceContextData for a given scId and unmarshal the bytes. -
write
Write the service contexts to the output stream. If they haven't been unmarshaled, we don't have to unmarshal them.- Specified by:
writein interfaceServiceContexts- Parameters:
os- stream to write togv- version to use
-
writeServiceContextsInOrder
Write the service contexts in scMap in a desired order. Right now, the only special case we have is UnknownExceptionInfo, so I'm merely writing it last if present. -
writingServiceContextBytesFor
@InfoMethod private void writingServiceContextBytesFor(int id) -
writingServiceContext
-
writeMapEntry
Write the given entry from the scMap to the OutputStream. See note on giopVersion. The service context should know the GIOP version it is meant for. -
put
Description copied from interface:ServiceContextsAdd a service context. Silently replaces an existing service context with the same id.- Specified by:
putin interfaceServiceContexts- Parameters:
sc- service context to use
-
delete
public void delete(int scId) Description copied from interface:ServiceContextsRemove the service context with the id, if any.- Specified by:
deletein interfaceServiceContexts- Parameters:
scId- service context id
-
serviceContextIdFound
@InfoMethod private void serviceContextIdFound(int id) -
serviceContextIdNotFound
@InfoMethod private void serviceContextIdNotFound(int id) -
unmarshallingServiceContext
@InfoMethod private void unmarshallingServiceContext(int id) -
get
Description copied from interface:ServiceContextsReturn the service context with scId, or null if not found.- Specified by:
getin interfaceServiceContexts- Parameters:
id- service context id- Returns:
- ServiceContext with the specified ID
-
copy
send back a shallow copy of the ServiceContexts container- Specified by:
copyin interfaceServiceContexts
-