Inherits org::omg::CORBA::LocalObject, and org::omg::PortableServer::ServantActivator.
Public Member Functions | |
ComponentServantManager (Logger logger) | |
Servant | incarnate (byte[] oid, POA adapter) throws ForwardRequest |
synchronized void | etherealize (byte[] oid, POA adapter, Servant serv, boolean cleanup_in_progress, boolean remaining_activations) |
synchronized void | resetWaitForEtherealize () |
synchronized boolean | waitForEtherealize (int maxWaitMillis) |
We use one ComponentServantManager per component POA. It's used to synchronize with component etherealization.
Impl note: until ACS 6.0.x this class inherited from org.omg.PortableServer.ServantActivatorPOA
and was activated like a normal Corba object (componentPOA.set_servant_manager(servantManager._this(m_orb))
. However this form of activation attached the servant manager instance to the ORB or root poa, with the effect that it was not garbage collected together with the component poa (memory leak!). It seems that a POJO (no Corba activation) inheriting from LocalObject
is the correct choice instead.
alma.acs.container.ComponentServantManager.ComponentServantManager | ( | Logger | logger | ) |
Constructor for ComponentServantManager.
logger | Logger to be used by this class. Should be the container logger. |
synchronized void alma.acs.container.ComponentServantManager.etherealize | ( | byte[] | oid, | |
POA | adapter, | |||
Servant | serv, | |||
boolean | cleanup_in_progress, | |||
boolean | remaining_activations | |||
) |
See CORBA spec (2.4) 11.3.5.2 etherealize. This operation is invoked whenever a servant for an object is deactivated, assuming the POA has the USE_SERVANT_MANAGER and RETAIN policies.
This method does not deal with the servant (component) at all, just notifies a thread that has called waitForEtherealize(int).
oid | object Id associated with the object being deactivated. | |
adapter | object reference for the POA in which the object was active. | |
serv | contains reference to the servant associated with the object being deactivated. | |
cleanup_in_progress | if TRUE indicates that destroy or deactivate is called with etherealize_objects param of TRUE. FALSE indicates that etherealize was called due to other reasons. We ignore this parameter. | |
remaining_activations | indicates whether the Servant Manager can destroy a servant. If set to TRUE, the Servant Manager should wait until all invocations in progress have completed. This method seems never to be called with remaining_activations==true . If so, the call is ignored. |
Servant alma.acs.container.ComponentServantManager.incarnate | ( | byte[] | oid, | |
POA | adapter | |||
) | throws ForwardRequest |
This method should never be called, because all components are activated explicitly by the container and therefore should be registered in the active object map. Thus the implementation just throws a OBJECT_NOT_EXIST
exception.
Note that by definition, this method acts as a fallback, if the POA can not find an object in that map (if RETAIN policy is used). The POA could call it after a component has been deactivated (deactivate_object
), in an attempt to serve a new incoming call. This we don't allow though.
synchronized void alma.acs.container.ComponentServantManager.resetWaitForEtherealize | ( | ) |
Resets the flag that gets raised when the etherealize
method gets called. Such a flag is needed because servant etherealization occurs asynchonously some time after POA.destroy has been called. A thread that wants to wait for etherealization must first call resetWaitForEtherealize
, then POA.destroy
, and then waitForEtherealize
.
Referenced by alma.acs.container.corba.AcsCorba.destroyComponentPOA().
synchronized boolean alma.acs.container.ComponentServantManager.waitForEtherealize | ( | int | maxWaitMillis | ) |
Allows a thread to be notified of component servant etherealization.
Since we use one component POA per servant, it is not necessary to distinguish for which servant the etherealize method was called.
maxWaitMillis | the maximum time to wait, or 0 if no timeout should be used. |
Referenced by alma.acs.container.corba.AcsCorba.destroyComponentPOA().