public class ComponentServantManager
extends org.omg.CORBA.LocalObject
implements org.omg.PortableServer.ServantActivator
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.
| Constructor and Description |
|---|
ComponentServantManager(java.util.logging.Logger logger)
Constructor for ComponentServantManager.
|
| Modifier and Type | Method and Description |
|---|---|
void |
etherealize(byte[] oid,
org.omg.PortableServer.POA adapter,
org.omg.PortableServer.Servant serv,
boolean cleanup_in_progress,
boolean remaining_activations)
See CORBA spec (2.4) 11.3.5.2 etherealize.
|
org.omg.PortableServer.Servant |
incarnate(byte[] oid,
org.omg.PortableServer.POA adapter)
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.
|
void |
resetWaitForEtherealize()
Resets the flag that gets raised when the
etherealize method gets called. |
boolean |
waitForEtherealize(int maxWaitMillis)
Allows a thread to be notified of component servant etherealization.
|
_create_request, _create_request, _duplicate, _get_domain_managers, _get_interface_def, _get_interface, _get_policy, _hash, _invoke, _is_a, _is_equivalent, _is_local, _non_existent, _orb, _release, _releaseReply, _request, _request, _servant_postinvoke, _servant_preinvoke, _set_policy_override, validate_connectionpublic ComponentServantManager(java.util.logging.Logger logger)
logger - Logger to be used by this class. Should be the container logger.public org.omg.PortableServer.Servant incarnate(byte[] oid,
org.omg.PortableServer.POA adapter)
throws org.omg.PortableServer.ForwardRequest
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.
incarnate in interface org.omg.PortableServer.ServantActivatorOperationsorg.omg.PortableServer.ForwardRequestServantActivatorOperations.incarnate(byte[], POA)public void etherealize(byte[] oid,
org.omg.PortableServer.POA adapter,
org.omg.PortableServer.Servant serv,
boolean cleanup_in_progress,
boolean remaining_activations)
This method does not deal with the servant (component) at all, just notifies a thread that has called
waitForEtherealize(int).
etherealize in interface org.omg.PortableServer.ServantActivatorOperationsoid - 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.ServantActivatorOperations.etherealize(byte[], POA, Servant, boolean, boolean)public void resetWaitForEtherealize()
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.waitForEtherealize(int)public boolean waitForEtherealize(int maxWaitMillis)
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.