Class ServiceContextsImpl

java.lang.Object
com.sun.corba.ee.impl.servicecontext.ServiceContextsImpl
All Implemented Interfaces:
ServiceContexts

public class ServiceContextsImpl extends Object implements ServiceContexts
  • Field Details

    • wrapper

      private static final ORBUtilSystemException wrapper
    • creationCount

      private static final AtomicInteger creationCount
    • orb

      private final ORB orb
    • scMap

      private final Map<Integer,Object> 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

      private CodeBase codeBase
    • giopVersion

      private GIOPVersion giopVersion
  • Constructor Details

    • ServiceContextsImpl

      public ServiceContextsImpl(ORB orb)
    • ServiceContextsImpl

      public ServiceContextsImpl(InputStream s)
      Read the Service contexts from the input stream.
      Parameters:
      s - Stream to get context from
    • ServiceContextsImpl

      private ServiceContextsImpl(ServiceContextsImpl scimpl)
  • Method Details

    • getValidSCIds

      private String getValidSCIds()
    • numberValid

      @InfoMethod private void numberValid(int num)
    • readingServiceContextId

      @InfoMethod private void readingServiceContextId(int id)
    • serviceContextLength

      @InfoMethod private void serviceContextLength(int len)
    • createMapFromInputStream

      private void createMapFromInputStream(InputStream is)
      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

      private ServiceContext unmarshal(int scId, byte[] data)
      Find the ServiceContextData for a given scId and unmarshal the bytes.
    • write

      public void write(OutputStream os, GIOPVersion gv)
      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 interface ServiceContexts
      Parameters:
      os - stream to write to
      gv - version to use
    • writeServiceContextsInOrder

      private void writeServiceContextsInOrder(OutputStream os, GIOPVersion gv)
      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

      @InfoMethod private void writingServiceContext(ServiceContext sc)
    • writeMapEntry

      private void writeMapEntry(OutputStream os, int id, Object scObj, GIOPVersion gv)
      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

      public void put(ServiceContext sc)
      Description copied from interface: ServiceContexts
      Add a service context. Silently replaces an existing service context with the same id.
      Specified by:
      put in interface ServiceContexts
      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 interface ServiceContexts
      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

      public ServiceContext get(int id)
      Description copied from interface: ServiceContexts
      Return the service context with scId, or null if not found.
      Specified by:
      get in interface ServiceContexts
      Parameters:
      id - service context id
      Returns:
      ServiceContext with the specified ID
    • copy

      public ServiceContexts copy()
      send back a shallow copy of the ServiceContexts container
      Specified by:
      copy in interface ServiceContexts