Public Member Functions | Protected Member Functions | Package Functions

alma.acs.container.ComponentAdapter Class Reference

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
void setComponentXmlTranslatorProxy (Object xmlTranslatorProxy)
ContainerServicesImpl getContainerServices ()
void activateComponent (Servant servant) throws AcsJContainerEx
void initializeComponent () throws ComponentLifecycleException
void executeComponent () throws ComponentLifecycleException
void deactivateComponent () throws AcsJComponentDeactivationUncleanEx, AcsJComponentDeactivationFailedEx
Runnable getComponentAbortionist (final boolean killComponentPOA)
ComponentInfo getComponentInfo ()
ComponentStateManagerImpl getComponentStateManager ()
void setMethodsExcludedFromInvocationLogging (String[] excludedMethods)

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 [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 alma.acs.container.corba.AcsCorba.createPOAForComponent(), and alma.acs.container.CleaningDaemonThreadFactory.setNewThreadContextClassLoader().


Member Function Documentation

void alma.acs.container.ComponentAdapter.activateComponent ( Servant  servant  )  throws AcsJContainerEx [package]
void alma.acs.container.ComponentAdapter.deactivateComponent (  )  throws AcsJComponentDeactivationUncleanEx, AcsJComponentDeactivationFailedEx [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 good enough.
  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.

This method logs errors as FINER if they also cause an exception, and as WARNING if they cannot lead to an exception because other more important error conditions are present.

Exceptions:
ComponentDeactivationUncleanEx,ComponentDeactivationFailedEx 

References alma.acs.container.CleaningDaemonThreadFactory.cleanUp(), alma.acs.container.ContainerServicesImpl.cleanUp(), alma.acs.component.ComponentLifecycle.cleanUp(), alma.acs.container.corba.AcsCorba.deactivateComponentPOAManager(), alma.acs.container.corba.AcsCorba.destroyComponentPOA(), alma.acs.container.ComponentAdapter.getHandle(), alma.acs.logging.AcsLogger.log(), and alma.acs.container.ComponentStateManagerImpl.setStateByContainer().

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

boolean alma.acs.container.ComponentAdapter.equals ( Object  obj  ) 

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 alma.acs.container.ComponentAdapter.getHandle(), alma.acs.container.ComponentAdapter.getName(), and alma.acs.container.ComponentAdapter.getType().

void alma.acs.container.ComponentAdapter.executeComponent (  )  throws ComponentLifecycleException [package]
void alma.acs.container.ComponentAdapter.finalize (  )  throws Throwable [protected]
Returns:
true if the component managed by this adapter declares itself to be stateless.

References alma.acs.container.ComponentAdapter.getHandle(), and alma.acs.container.ComponentAdapter.getName().

Runnable alma.acs.container.ComponentAdapter.getComponentAbortionist ( final boolean  killComponentPOA  )  [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(), alma.acs.container.ComponentAdapter.getName(), alma.acs.logging.AcsLogger.log(), and alma.acs.container.ComponentStateManagerImpl.setStateByContainer().

ComponentInfo alma.acs.container.ComponentAdapter.getComponentInfo (  )  [package]
ComponentStateManagerImpl alma.acs.container.ComponentAdapter.getComponentStateManager (  )  [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 (  )  [package]
int alma.acs.container.ComponentAdapter.getHandle (  ) 
String alma.acs.container.ComponentAdapter.getName (  ) 
org.omg.CORBA.Object alma.acs.container.ComponentAdapter.getReference (  ) 

Returns the reference.

Returns:
org.omg.CORBA.Object
String alma.acs.container.ComponentAdapter.getType (  ) 
int alma.acs.container.ComponentAdapter.hashCode (  ) 
See also:
java.lang.Object.hashCode()
void alma.acs.container.ComponentAdapter.initializeComponent (  )  throws ComponentLifecycleException [package]
void alma.acs.container.ComponentAdapter.setComponentXmlTranslatorProxy ( Object  xmlTranslatorProxy  )  [package]
void alma.acs.container.ComponentAdapter.setMethodsExcludedFromInvocationLogging ( String[]  excludedMethods  )  [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 alma.acs.container.ContainerServicesImpl.setMethodsExcludedFromInvocationLogging().

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


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties