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

alma::acs::container::ComponentAdapter Class Reference

Inheritance diagram for alma::acs::container::ComponentAdapter:

Inheritance graph
[legend]
Collaboration diagram for alma::acs::container::ComponentAdapter:

Collaboration graph
[legend]
List of all members.

Public Member Functions

boolean equals (Object obj)
int hashCode ()
org.omg.CORBA.Object getReference ()
int getHandle ()
String getName ()
String getType ()

Protected Member Functions

void finalize () throws Throwable

Package Functions

 ComponentAdapter (String compName, String type, String code, int compHandle, int containerHandle, String containerName, ComponentLifecycle component, AcsManagerProxy managerProxy, ClassLoader componentClassLoader, AcsLogger logger, AcsCorba acsCorba) throws AcsJContainerEx
ContainerServicesImpl getContainerServices ()
void activateComponent (Servant servant) throws AcsJContainerEx
void initializeComponent () throws ComponentLifecycleException
void executeComponent () throws ComponentLifecycleException
void deactivateComponent () throws AcsJContainerEx
Runnable getComponentAbortionist (final boolean killComponentPOA)
ComponentInfo getComponentInfo ()
ComponentStateManagerImpl getComponentStateManager ()
void setMethodsExcludedFromInvocationLogging (String[] excludedMethods)

Private Member Functions

String[] _getInterfaces ()

Private Attributes

String m_type
String m_code
org.omg.CORBA.Object m_reference
String m_compInstanceName
int[] m_clients
int m_containerHandle
String m_containerName
int m_compHandle
int m_access
String[] m_interfaces
AcsLogger m_containerLogger
ComponentLifecycle m_component
Servant m_servant
POA m_componentPOA
ComponentServantManager compServantManager
final AcsCorba acsCorba
final ClassLoader m_componentClassLoader
final ComponentStateManagerImpl m_componentStateManager
final ContainerServicesImpl m_containerServices
final CleaningDaemonThreadFactory m_threadFactory

Detailed Description

Adapter between the container on the one side and a component with all its child objects on the other. For the component, ComponentAdapter is the container, since it calls the ComponentLifecycle methods. For the container, it represents the component with its meta data.

Author:
hsommer Nov 6, 2002 2:48:13 PM


Constructor & Destructor Documentation

alma::acs::container::ComponentAdapter::ComponentAdapter String  compName,
String  type,
String  code,
int  compHandle,
int  containerHandle,
String  containerName,
ComponentLifecycle  component,
AcsManagerProxy  managerProxy,
ClassLoader  componentClassLoader,
AcsLogger  logger,
AcsCorba  acsCorba
throws AcsJContainerEx [inline, package]
 

Method ComponentAdapter.

Parameters:
compName component instance name (curl)
type IDL type
code Java impl class of the component helper (subclass of ComponentHelper);
compHandle component handle assigned by the manager
containerHandle 
containerName 
component the instance of the component implementation class
managerProxy the shared manager proxy object
componentClassLoader the classloader to be used as the currentThread-ClassLoader when component lifecycle methods are invoked.
logger logger to be used by this class (not by the component though)
acsCorba 
Exceptions:
AcsJContainerServicesEx 


Member Function Documentation

String [] alma::acs::container::ComponentAdapter::_getInterfaces  )  [inline, private]
 

void alma::acs::container::ComponentAdapter::activateComponent Servant  servant  )  throws AcsJContainerEx [inline, package]
 

void alma::acs::container::ComponentAdapter::deactivateComponent  )  throws AcsJContainerEx [inline, package]
 

Deactivates a component.

  1. First the component's POA manager is put into inactive state, so that all incoming calls to this component are rejected. However, we wait for currently executing calls to finish, with a timeout as described below.
    • Rejection applies to requests already received and queued by the ORB (but that have not started executing), as well as to requests that clients will send in the future.
    • Note that entering into the inactive state may take forever if the component hangs in a functional call.
    • Therefore we use a timeout to proceed in such cases where POA manager deactivation does not happen in time. This bears the risk of undesirable behavior caused by calling the cleanUp method while other threads still perform functional calls on the component.
  2. Second the component itself is deactivated:
    • The lifecycle method cleanUp is called, currently without enforcing a timeout.
    • TODO: use a timeout, unless we decide that a client-side timeout for releaseComponent is better.
  3. Third the component is disconnected from CORBA ("etherealized" from the POA).
    • Note that also etherealization may take forever if the component hangs in a call.
    • Therefore we use a timeout to proceed with deactivation in such cases where etherealization does not happen in time.
    • Currently a component that failed to etherealize in time can stay active as long as the container is alive. TODO: check if using the "container sealant" we can identify and stop the active ORB threads.

Exceptions:
AcsJContainerServicesEx 

boolean alma::acs::container::ComponentAdapter::equals Object  obj  )  [inline]
 

todo: check with rest of ACS which fields really make a component unique in the system. Seems kind of undefined.

See also:
java.lang.Object#equals(java.lang.Object)

void alma::acs::container::ComponentAdapter::executeComponent  )  throws ComponentLifecycleException [inline, package]
 

void alma::acs::container::ComponentAdapter::finalize  )  throws Throwable [inline, protected]
 

Returns:
true if the component managed by this adapter declares itself to be stateless.

Runnable alma::acs::container::ComponentAdapter::getComponentAbortionist final boolean  killComponentPOA  )  [inline, package]
 

Returns a Runnable that can abort the component in the following way.

  1. Sets the component state to ABORTING
  2. Calls ComponentLifecycle#aboutToAbort()
  3. Sets the component state to DEFUNCT
  4. Kills all surviving user threads created by the component using getThreadFactory
  5. if killComponentPOA==true, destroys the POA for this component;
This method returns immediately, so the caller can then run the returned Runnable in its own thread.

ComponentInfo alma::acs::container::ComponentAdapter::getComponentInfo  )  [inline, package]
 

ComponentStateManagerImpl alma::acs::container::ComponentAdapter::getComponentStateManager  )  [inline, package]
 

To be called by the container to change the component state. In some cases, the state will be changed by this ComponentAdapter though.

Returns:
the ComponentStateManager that gives acces to the state.

ContainerServicesImpl alma::acs::container::ComponentAdapter::getContainerServices  )  [inline, package]
 

int alma::acs::container::ComponentAdapter::getHandle  )  [inline]
 

Returns the handle.

Returns:
int

String alma::acs::container::ComponentAdapter::getName  )  [inline]
 

Returns the name.

Returns:
String

org.omg.CORBA.Object alma::acs::container::ComponentAdapter::getReference  )  [inline]
 

Returns the reference.

Returns:
org.omg.CORBA.Object

String alma::acs::container::ComponentAdapter::getType  )  [inline]
 

Returns the type.

Returns:
String

int alma::acs::container::ComponentAdapter::hashCode  )  [inline]
 

See also:
java.lang.Object#hashCode()

void alma::acs::container::ComponentAdapter::initializeComponent  )  throws ComponentLifecycleException [inline, package]
 

void alma::acs::container::ComponentAdapter::setMethodsExcludedFromInvocationLogging String[]  excludedMethods  )  [inline, package]
 

With this optional call, automatic invocation logging for certain component methods can be disabled. (Data will just be forwarded to containerServices)

Parameters:
excludedMethods 
See also:
ComponentHelper::getComponentMethodsExcludedFromInvocationLogging()


Member Data Documentation

final AcsCorba alma::acs::container::ComponentAdapter::acsCorba [private]
 

ComponentServantManager alma::acs::container::ComponentAdapter::compServantManager [private]
 

int alma::acs::container::ComponentAdapter::m_access [private]
 

int [] alma::acs::container::ComponentAdapter::m_clients [private]
 

String alma::acs::container::ComponentAdapter::m_code [private]
 

int alma::acs::container::ComponentAdapter::m_compHandle [private]
 

String alma::acs::container::ComponentAdapter::m_compInstanceName [private]
 

ComponentLifecycle alma::acs::container::ComponentAdapter::m_component [private]
 

final ClassLoader alma::acs::container::ComponentAdapter::m_componentClassLoader [private]
 

POA alma::acs::container::ComponentAdapter::m_componentPOA [private]
 

final ComponentStateManagerImpl alma::acs::container::ComponentAdapter::m_componentStateManager [private]
 

int alma::acs::container::ComponentAdapter::m_containerHandle [private]
 

AcsLogger alma::acs::container::ComponentAdapter::m_containerLogger [private]
 

String alma::acs::container::ComponentAdapter::m_containerName [private]
 

final ContainerServicesImpl alma::acs::container::ComponentAdapter::m_containerServices [private]
 

String [] alma::acs::container::ComponentAdapter::m_interfaces [private]
 

org.omg.CORBA.Object alma::acs::container::ComponentAdapter::m_reference [private]
 

Servant alma::acs::container::ComponentAdapter::m_servant [private]
 

final CleaningDaemonThreadFactory alma::acs::container::ComponentAdapter::m_threadFactory [private]
 

String alma::acs::container::ComponentAdapter::m_type [private]
 


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