Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

alma::acs::container::ComponentServantManager Class Reference

List of all members.

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)

Private Member Functions

void logStackTrace (String msg)

Private Attributes

Logger m_logger
boolean DEBUG = false
volatile boolean receivedEtherealizeCall

Detailed Description

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.

Author:
hsommer $Id$


Constructor & Destructor Documentation

alma::acs::container::ComponentServantManager::ComponentServantManager Logger  logger  )  [inline]
 

Constructor for ComponentServantManager.

Parameters:
logger Logger to be used by this class. Should be the container logger.


Member Function Documentation

synchronized void alma::acs::container::ComponentServantManager::etherealize byte[]  oid,
POA  adapter,
Servant  serv,
boolean  cleanup_in_progress,
boolean  remaining_activations
[inline]
 

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).

Parameters:
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.
See also:
org.omg.PortableServer.ServantActivatorOperations#etherealize(byte[], POA, Servant, boolean, boolean)

Servant alma::acs::container::ComponentServantManager::incarnate byte[]  oid,
POA  adapter
throws ForwardRequest [inline]
 

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.

See also:
org.omg.PortableServer.ServantActivatorOperations#incarnate(byte[], POA)

void alma::acs::container::ComponentServantManager::logStackTrace String  msg  )  [inline, private]
 

Helper method for debugging, logs the stacktrace.

Parameters:
msg 

synchronized void alma::acs::container::ComponentServantManager::resetWaitForEtherealize  )  [inline]
 

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.

See also:
waitForEtherealize(int)

synchronized boolean alma::acs::container::ComponentServantManager::waitForEtherealize int  maxWaitMillis  )  [inline]
 

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.

Parameters:
maxWaitMillis the maximum time to wait, or 0 if no timeout should be used.
Returns:
true if etherealization occured, false if the operation timed out.


Member Data Documentation

boolean alma::acs::container::ComponentServantManager::DEBUG = false [private]
 

Logger alma::acs::container::ComponentServantManager::m_logger [private]
 

volatile boolean alma::acs::container::ComponentServantManager::receivedEtherealizeCall [private]
 


The documentation for this class was generated from the following file:
Generated on Thu Apr 30 02:52:27 2009 for ACS Java API by doxygen 1.3.8