Class ServiceContextsImpl
java.lang.Object
com.sun.corba.ee.impl.servicecontext.ServiceContextsImpl
- All Implemented Interfaces:
ServiceContexts
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate CodeBase
private static final AtomicInteger
private GIOPVersion
private final ORB
Map of all ServiceContext objects in this container.private static final ORBUtilSystemException
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
ServiceContextsImpl
(ORB orb) Read the Service contexts from the input stream. -
Method Summary
Modifier and TypeMethodDescriptioncopy()
send back a shallow copy of the ServiceContexts containerprivate void
couldNotFindServiceContextFactory
(int scid) private void
Given the input stream, this fills our service context map.void
delete
(int scId) Remove the service context with the id, if any.private void
foundServiceContextFactory
(int scid) get
(int id) Return the service context with scId, or null if not found.private String
private void
numberValid
(int num) void
put
(ServiceContext sc) Add a service context.private void
readingServiceContextId
(int id) private void
serviceContextIdFound
(int id) private void
serviceContextIdNotFound
(int id) private void
serviceContextLength
(int len) private ServiceContext
unmarshal
(int scId, byte[] data) Find the ServiceContextData for a given scId and unmarshal the bytes.private void
unmarshallingServiceContext
(int id) void
write
(OutputStream os, GIOPVersion gv) Write the service contexts to the output stream.private void
writeMapEntry
(OutputStream os, int id, Object scObj, GIOPVersion gv) Write the given entry from the scMap to the OutputStream.private void
Write the service contexts in scMap in a desired order.private void
private void
writingServiceContextBytesFor
(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:
write
in 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:ServiceContexts
Add a service context. Silently replaces an existing service context with the same id.- Specified by:
put
in interfaceServiceContexts
- Parameters:
sc
- service context to use
-
delete
public void delete(int scId) Description copied from interface:ServiceContexts
Remove the service context with the id, if any.- Specified by:
delete
in 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:ServiceContexts
Return the service context with scId, or null if not found.- Specified by:
get
in interfaceServiceContexts
- Parameters:
id
- service context id- Returns:
- ServiceContext with the specified ID
-
copy
send back a shallow copy of the ServiceContexts container- Specified by:
copy
in interfaceServiceContexts
-