Interface ReferenceFactoryManager

All Superinterfaces:
IDLEntity, Object, Serializable
All Known Implementing Classes:
ReferenceFactoryManagerImpl

public interface ReferenceFactoryManager extends Object, IDLEntity
ReferenceFactoryManager uses the ORB POA to create a specialized reference factory. This is done primarily so that all POAs managed here can be restarted in order to be updated when parts of the ORB configuration are changed. For example, this is used in AS 9 to support dynamic fail over, which requires re-configuring the App server POAs whenever an instance joins or leaves a cluster.

An instance of this interface can be obtained from an ORB by calling resolve_initial_references( "ReferenceFactoryManager" ). The ORB will have an instance of this available if it is started with the property ORBConstants.USER_CONFIGURATOR_PREFIX + "com.sun.corba.ee.impl.oa.rfm.ReferenceManagerConfigurator" set to a value (usually we use "1" as the value, but that does not matter). This will cause the configurator to set up the ORB so that the ReferenceFactoryManager is available, so long as the configurator class is available. Since this code is in the optional package, this just means that the optional ORB package contents must be in the classpath.

Note that this interface is a simulated IDL local interface, but there is no actual IDL for this interface.

Note that the suspend and resume methods must be called from the same thread in order for the thread synchronization to be handled correctly. Calling either of the restart() methods guarantees this, but disallows more complex ORB configuration changes.

  • Method Details

    • getState

      The state of the ReferenceFactoryManager.
      Returns:
      whether the manager is READY or SUSPENDED
    • activate

      void activate()
      Must be called before any other operation. Used to activate the ORB reference creation function.
    • suspend

      void suspend()
      Suspend all CORBA request processing on all references created by ReferenceFactory instances that were created by this ReferenceFactoryManager. This call does not return until after all currently executing calls have completed.
    • resume

      void resume()
      Resume all CORBA request processing on all references created by ReferenceFactory instances that were created by this ReferenceFactoryManager.
    • create

      ReferenceFactory create(String name, String repositoryId, List<Policy> policies, ServantLocator manager)
      Create a new reference factory with the given policies. All such reference factories will be persistent. The ServantLocator is solely responsible for creating servants: no internal caching will be performed. The following policies are always applied here:
      • Servant retention policy NON_RETAIN
      • Request processing policy USE_SERVANT_MANAGER
      • Lifespan policy PERSISTENT
      These policies are required because all are essential to the correct functioning of this class in handling restarts. It is an error for the policies list to contain any value of the above 3 policies. All other policies must be given explicitly in the list.
      Parameters:
      name - is the name of this ReferenceFactory. This is a simple flat name, not a hierarchical name.
      repositoryId - is the repoid to be used when this reference factory creates a new CORBA Object reference.
      policies - are the policies to be used to create the underlying POA.
      manager - locator to use for the reference
      Returns:
      resulting ReferenceFactory with given policies
    • find

      ReferenceFactory find(String[] adapterName)
      Get the ReferenceFactory name from a String[] adapterName, if adapterName is the name of a ReferenceFactory. If not, return null.
      Parameters:
      adapterName - of factory
      Returns:
      found ReferenceFactory, null otherwise
    • find

      Find the ReferenceFactory with the given name. If no such ReferenceFactory exists, return null.
      Parameters:
      name - of factory
      Returns:
      found ReferenceFactory, null otherwise
    • restartFactories

      void restartFactories(Map<String,org.glassfish.pfl.basic.contain.Pair<ServantLocator,List<Policy>>> updates)
      Restart all ReferenceFactories.
      Parameters:
      updates - is a map giving the updated policies for some or all of the ReferenceFactory instances in this ReferenceFactoryManager. This parameter must not be null.
    • restartFactories

      void restartFactories()
      Restart all ReferenceFactories. Equivalent to calling restartFactories( new Map() ).
    • restart

      void restart(Map<String,org.glassfish.pfl.basic.contain.Pair<ServantLocator,List<Policy>>> updates)
      Restart all ReferenceFactories. This is done safely, so that any request against object references created from these factories complete correctly. Restart does not return until all restart activity completes. This method is equivalent to:
       suspend() ;
       try {
           restartFactories( updates ) ;
       } finally {
           resume() ;
       }
       
      Parameters:
      updates - is a map giving the updated policies for some or all of the ReferenceFactory instances in this ReferenceFactoryManager. This parameter must not be null.
    • restart

      void restart()
      Restart all ReferenceFactories. This is done safely, so that any request against object references created from these factories complete correctly. Restart does not return until all restart activity completes. Equivalent to calling restart( new Map() ).
    • isRfmName

      boolean isRfmName(String[] adapterName)