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, 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
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 AcsManagerProxy m_managerProxy
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,
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
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 

References acsCorba, alma::acs::container::corba::AcsCorba::createPOAForComponent(), m_clients, m_code, m_compHandle, m_compInstanceName, m_component, m_componentClassLoader, m_componentPOA, m_componentStateManager, m_containerLogger, m_containerName, m_containerServices, m_interfaces, m_managerProxy, m_threadFactory, m_type, and alma::acs::container::CleaningDaemonThreadFactory::setNewThreadContextClassLoader().


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 

References acsCorba, alma::acs::container::CleaningDaemonThreadFactory::cleanUp(), alma::acs::container::ContainerServicesImpl::cleanUp(), alma::acs::component::ComponentLifecycle::cleanUp(), compServantManager, alma::acs::container::corba::AcsCorba::deactivateComponentPOAManager(), alma::acs::container::corba::AcsCorba::destroyComponentPOA(), alma::acs::logging::AcsLogger::log(), m_compInstanceName, m_component, m_componentClassLoader, m_componentPOA, m_componentStateManager, m_containerLogger, m_containerServices, m_threadFactory, alma::JavaContainerError::wrappers::AcsJContainerEx::setContextInfo(), and alma::acs::container::ComponentStateManagerImpl::setStateByContainer().

Referenced by alma::acs::container::AcsContainer::activate_component(), and alma::acs::container::AcsContainer::deactivate_components().

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)

References getHandle(), getName(), getType(), m_compHandle, m_compInstanceName, and m_type.

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.

References getHandle(), getName(), and m_containerLogger.

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.

References alma::acs::component::ComponentLifecycle::aboutToAbort(), alma::acs::container::CleaningDaemonThreadFactory::cleanUp(), alma::acs::container::ContainerServicesImpl::cleanUp(), getName(), alma::acs::logging::AcsLogger::log(), m_component, m_componentClassLoader, m_componentPOA, m_componentStateManager, m_containerLogger, m_containerServices, m_threadFactory, and alma::acs::container::ComponentStateManagerImpl::setStateByContainer().

Referenced by alma::acs::container::AcsContainer::abortAllComponents().

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.

References m_componentStateManager.

Referenced by alma::acs::container::AcsContainer::abortAllComponents(), and alma::acs::container::AcsContainer::markAndFilterForDeactivation().

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

References m_containerServices.

int alma::acs::container::ComponentAdapter::getHandle (  )  [inline]
String alma::acs::container::ComponentAdapter::getName (  )  [inline]
org.omg.CORBA.Object alma::acs::container::ComponentAdapter::getReference (  )  [inline]

Returns the reference.

Returns:
org.omg.CORBA.Object

References m_reference.

String alma::acs::container::ComponentAdapter::getType (  )  [inline]
int alma::acs::container::ComponentAdapter::hashCode (  )  [inline]
See also:
java.lang.Object::hashCode()

References m_compInstanceName.

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

References m_containerServices, and alma::acs::container::ContainerServicesImpl::setMethodsExcludedFromInvocationLogging().

Referenced by alma::acs::container::AcsContainer::activate_component().


Member Data Documentation

Referenced by getComponentInfo().


The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2