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

alma::acs::container::ContainerServicesImpl Class Reference

Inheritance diagram for alma::acs::container::ContainerServicesImpl:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ContainerServicesImpl (AcsManagerProxy acsManagerProxy, POA componentPOA, AcsCorba acsCorba, AcsLogger logger, int clientHandle, String clientCurl, ComponentStateManager componentStateManager, ThreadFactory threadFactory)
String getName ()
ComponentStateManager getComponentStateManager ()
AcsLogger getLogger ()
void registerComponentListener (ComponentListener listener)
void fireComponentsAvailable (List< ComponentDescriptor > compDescs)
void fireComponentsUnavailable (List< String > compNames)
void assignUniqueEntityId (EntityT entity) throws AcsJContainerServicesEx
String[] findComponents (String curlWildcard, String typeWildcard) throws AcsJContainerServicesEx
ComponentDescriptor getComponentDescriptor (String curl) throws AcsJContainerServicesEx
org.omg.CORBA.Object getComponent (String curl) throws AcsJContainerServicesEx
org.omg.CORBA.Object getComponentNonSticky (String curl) throws AcsJContainerServicesEx
org.omg.CORBA.Object getDefaultComponent (String componentIDLType) throws AcsJContainerServicesEx
org.omg.CORBA.Object getCollocatedComponent (String compUrl, String targetCompUrl) throws AcsJContainerServicesEx
org.omg.CORBA.Object getCollocatedComponent (ComponentQueryDescriptor spec, boolean markAsDefaul, String targetCompUrl) throws AcsJContainerServicesEx
org.omg.CORBA.Object getDynamicComponent (ComponentQueryDescriptor compDesc, boolean markAsDefault) throws AcsJContainerServicesEx
org.omg.CORBA.Object getDynamicComponent (ComponentSpec compSpec, boolean markAsDefault) throws AcsJContainerServicesEx
org.omg.CORBA.Object getReferenceWithCustomClientSideTimeout (org.omg.CORBA.Object originalCorbaRef, double timeoutSeconds) throws AcsJContainerServicesEx
DAL getCDB () throws AcsJContainerServicesEx
void releaseComponent (String curl)
OffShoot activateOffShoot (Servant servant) throws AcsJContainerServicesEx
void deactivateOffShoot (Servant cbServant) throws AcsJContainerServicesEx
synchronized AdvancedContainerServices getAdvancedContainerServices ()
void releaseAllComponents ()
ThreadFactory getThreadFactory ()

Static Public Attributes

final String PROPERTYNAME_FAKE_UID_FOR_TESTING = "acs.container.fakeUIDsForTesting"

Protected Attributes

final AcsManagerProxy m_acsManagerProxy
final AcsLogger m_logger

Package Functions

public< T > T getTransparentXmlComponent (Class< T > transparentXmlIF, org.omg.CORBA.Object componentReference, Class flatXmlIF) throws AcsJContainerServicesEx
AcsCorba getAcsCorba ()
void setMethodsExcludedFromInvocationLogging (String[] methodsExcludedFromInvocationLogging)

Private Member Functions

void checkOffShootServant (Servant servant) throws AcsJContainerServicesEx

Private Attributes

AdvancedContainerServicesImpl advancedContainerServices
volatile UIDLibrary uidLibrary
volatile IdentifierJ identifierArchive
final boolean fakeUIDsForTesting = Boolean.getBoolean(PROPERTYNAME_FAKE_UID_FOR_TESTING)
volatile AcsLogger componentLogger
final Map< String, org.omg.CORBA.Object > m_usedComponentsMap
final Map< String, org.omg.CORBA.Object > m_usedNonStickyComponentsMap
final Map< String, ComponentDescriptorm_componentDescriptorMap
final int m_clientHandle
final String m_clientName
final AcsCorba acsCorba
final POA m_clientPOA
final ComponentStateManager m_componentStateManager
final ThreadFactory m_threadFactory
volatile String[] methodsExcludedFromInvocationLogging
ComponentListener compListener

Detailed Description

Implementation of the ContainerServices interface. To be used by ACS components, as well as any other clients that need access to components.

This class is "cheap" to instantiate because many resources it uses are singletons and or objects otherwise shared among instances. It should thus be ok to create one instance per component or other client.

This class has to be thread-safe, because a component's functional methods can be called from different ORB threads, or because the component could itself create threads, each of them accessing this object.

Author:
hsommer Apr 1, 2003 2:28:01 PM


Constructor & Destructor Documentation

alma::acs::container::ContainerServicesImpl::ContainerServicesImpl AcsManagerProxy  acsManagerProxy,
POA  componentPOA,
AcsCorba  acsCorba,
AcsLogger  logger,
int  clientHandle,
String  clientCurl,
ComponentStateManager  componentStateManager,
ThreadFactory  threadFactory
[inline]
 

ctor.

Parameters:
acsManagerProxy 
componentPOA the POA for the component. Can be the root POA or some other specialized POA.
acsCorba Encapsulates the ORB and all POAs
logger logger to be used by this class
clientHandle handle to be used for identification when sending requests to the manager. For components, this should be the component handle assigned by the manager; for other clients, it can be the general handle assigned to the client at login.
clientCurl 
componentStateManager can be null if this class is instantiated for a component client outside of a container
threadFactory to be used for getThreadFactory


Member Function Documentation

OffShoot alma::acs::container::ContainerServicesImpl::activateOffShoot Servant  servant  )  throws AcsJContainerServicesEx [inline]
 

See also:
alma.acs.container.ContainerServices::activateOffShoot(org.omg.PortableServer.Servant)

Implements alma::acs::container::ContainerServicesBase.

void alma::acs::container::ContainerServicesImpl::assignUniqueEntityId EntityT  entity  )  throws AcsJContainerServicesEx [inline]
 

See also:
alma.acs.container.ContainerServices::assignUniqueEntityId(EntityT)

Implements alma::acs::container::ContainerServices.

void alma::acs::container::ContainerServicesImpl::checkOffShootServant Servant  servant  )  throws AcsJContainerServicesEx [inline, private]
 

Parameters:
cbServant 
Exceptions:
ContainerException 

void alma::acs::container::ContainerServicesImpl::deactivateOffShoot Servant  cbServant  )  throws AcsJContainerServicesEx [inline]
 

Deactivates the offshoot corba object. Caution: this method returns immediately, while the underlying org.omg.PortableServer.POAOperations#deactivate_object(byte[]) still works on the deactivation. If activateOffShoot(Servant) is called too shortly after deactivation, an exception will be thrown. TODO: find a remedy

Parameters:
cbServant must implement alma.ACS.OffShootOperations.
Exceptions:
AcsJContainerServicesEx if something goes wrong, e.g., if the offshoot servant was not active.

Implements alma::acs::container::ContainerServicesBase.

String [] alma::acs::container::ContainerServicesImpl::findComponents String  curlWildcard,
String  typeWildcard
throws AcsJContainerServicesEx [inline]
 

See also:
alma.acs.container.ContainerServices::findComponents(java.lang.String, java.lang.String)

Implements alma::acs::container::ContainerServices.

void alma::acs::container::ContainerServicesImpl::fireComponentsAvailable List< ComponentDescriptor compDescs  )  [inline]
 

void alma::acs::container::ContainerServicesImpl::fireComponentsUnavailable List< String >  compNames  )  [inline]
 

AcsCorba alma::acs::container::ContainerServicesImpl::getAcsCorba  )  [inline, package]
 

synchronized AdvancedContainerServices alma::acs::container::ContainerServicesImpl::getAdvancedContainerServices  )  [inline]
 

See also:
alma.acs.container.ContainerServices::getAdvancedContainerServices()

Implements alma::acs::container::ContainerServicesBase.

DAL alma::acs::container::ContainerServicesImpl::getCDB  )  throws AcsJContainerServicesEx [inline]
 

See also:
alma.acs.container.ContainerServices::getCDB()

Implements alma::acs::container::ContainerServicesBase.

org.omg.CORBA.Object alma::acs::container::ContainerServicesImpl::getCollocatedComponent ComponentQueryDescriptor  spec,
boolean  markAsDefaul,
String  targetCompUrl
throws AcsJContainerServicesEx [inline]
 

Dynamic version of getCollocatedComponent(String, String).

Parameters:
compSpec the description of the component to be created
markAsDefaul if true, the new component will become the default component for its IDL type.
targetCompUrl targetCompUrl the name (URL) of the target component, in whose container we also want compUrl to run.
Returns:
Exceptions:
AcsJContainerServicesEx If the call failed and no component reference could be obtained.
Since:
ACS 6.0.4

Implements alma::acs::container::ContainerServices.

org.omg.CORBA.Object alma::acs::container::ContainerServicesImpl::getCollocatedComponent String  compUrl,
String  targetCompUrl
throws AcsJContainerServicesEx [inline]
 

Gets a component that will run collocated with a given component.

Parameters:
compUrl the component's name (URL)
targetCompUrl the name (URL) of the target component, in whose container we also want compUrl to run.
Returns:
the component reference, which should be cast using the appropriate CORBA narrow operation. Never null.
Exceptions:
AcsJContainerServicesEx If the call failed and no component reference could be obtained.
Since:
ACS 5.0.3

Implements alma::acs::container::ContainerServices.

org.omg.CORBA.Object alma::acs::container::ContainerServicesImpl::getComponent String  curl  )  throws AcsJContainerServicesEx [inline]
 

See also:
alma.acs.container.ContainerServices::getComponent(String)

Todo:
: think about timeouts

Implements alma::acs::container::ContainerServices.

ComponentDescriptor alma::acs::container::ContainerServicesImpl::getComponentDescriptor String  curl  )  throws AcsJContainerServicesEx [inline]
 

See also:
alma.acs.container.ContainerServices::getComponentDescriptor(java.lang.String)

Implements alma::acs::container::ContainerServices.

org.omg.CORBA.Object alma::acs::container::ContainerServicesImpl::getComponentNonSticky String  curl  )  throws AcsJContainerServicesEx [inline]
 

Gets a non-sticky reference to a component. This is typically used by "weak clients" such as graphical user interfaces that only want to observe the running system without interfering with its functioning.

A non-sticky reference does not bind the Manager to keep alive the Component, and the Client requesting a non-sticky reference is not considered when checking for reference counts. The non-sticky reference should not be released, as that call will fail. The Manager can deactivate Components independently of any non-sticky reference. Since a non-sticky reference is not considered in reference counting, it will also not activate the component if it is not already active. As a consequence, asking for a non-sticky reference to a not-active Component throws an exception. The client represented by id (the handle) must have adequate access rights to access the component.

Parameters:
curl the component URL (component instance name)
Returns:
the CORBA proxy for the component.
Exceptions:
AcsJContainerServicesEx if something goes wrong
Since:
ACS 6.0

Implements alma::acs::container::ContainerServices.

ComponentStateManager alma::acs::container::ContainerServicesImpl::getComponentStateManager  )  [inline]
 

{}

This method should only be called by a component that lives inside a container; a component client that is not a component itself should not call it, would result in a NPE!

See also:
alma.acs.container.ContainerServices::getComponentStateManager()

Implements alma::acs::container::ContainerServices.

org.omg.CORBA.Object alma::acs::container::ContainerServicesImpl::getDefaultComponent String  componentIDLType  )  throws AcsJContainerServicesEx [inline]
 

See also:
alma.acs.container.ContainerServices::getDefaultComponent(java.lang.String)

Implements alma::acs::container::ContainerServices.

org.omg.CORBA.Object alma::acs::container::ContainerServicesImpl::getDynamicComponent ComponentSpec  compSpec,
boolean  markAsDefault
throws AcsJContainerServicesEx [inline]
 

See also:
alma.acs.container.ContainerServices::getDynamicComponent(si.ijs.maci.ComponentSpec, boolean)

Implements alma::acs::container::ContainerServices.

org.omg.CORBA.Object alma::acs::container::ContainerServicesImpl::getDynamicComponent ComponentQueryDescriptor  compDesc,
boolean  markAsDefault
throws AcsJContainerServicesEx [inline]
 

See also:
alma.acs.container.ContainerServices::getDynamicComponent(si.ijs.maci.ComponentSpec, boolean)

Implements alma::acs::container::ContainerServices.

AcsLogger alma::acs::container::ContainerServicesImpl::getLogger  )  [inline]
 

The component must retrieve its logger object from this interface (as opposed to using the ClientLogManager singleton) so that the container is free to give away loggers that are somehow tailored to the particular component.

The goal is to have "componentName" and other fields in all ALMA log entries, and have tool support for filtering logs by component, subsystem, user, ...

See also:
alma.acs.container.ContainerServices::getLogger()

Implements alma::acs::container::ContainerServicesBase.

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

Gets the component name (which the component does not know statically)

See also:
alma.acs.container.ContainerServices::getName()

Implements alma::acs::container::ContainerServicesBase.

org.omg.CORBA.Object alma::acs::container::ContainerServicesImpl::getReferenceWithCustomClientSideTimeout org.omg.CORBA.Object  originalCorbaRef,
double  timeoutSeconds
throws AcsJContainerServicesEx [inline]
 

Wraps a component reference (or offshoot reference etc) such that the given timeout is applied on the client side of calls to this (possibly remote) object. If the total call, including de-/serialization and network travel, takes longer than the given timeout, an org.omg.CORBA.TIMEOUT exception will be thrown.

This allows us to override the general timeout given at the system level (e.g. orb.properties file in case of jacorb) and the container-level timeout given in the CDB container configuration. It is possible to set the timeout to values that are shorter or longer than the default timeout. You should chose a timeout value that matches the expected response time, with a large safety margin of

Note that calls to which the specified timeout should apply must be made on the object reference returned from this method, and not on the original object that gets passed to this method! Some corba implementations may apply the timeout to both objects though, or return the original object.

Parameters:
corbaRef Reference to a component or an offshoot as obtained from some of the other container services methods.
timeoutSeconds the custom client side timeout in seconds, to be used for all calls to the given object reference.
Returns:
A new object reference which should be used to make calls with the specified timeout applied.

Implements alma::acs::container::ContainerServices.

ThreadFactory alma::acs::container::ContainerServicesImpl::getThreadFactory  )  [inline]
 

See also:
alma.acs.container.ContainerServices::getThreadFactory()

Implements alma::acs::container::ContainerServicesBase.

public<T> T alma::acs::container::ContainerServicesImpl::getTransparentXmlComponent Class< T >  transparentXmlIF,
org.omg.CORBA.Object  componentReference,
Class  flatXmlIF
throws AcsJContainerServicesEx [inline, package]
 

{}.

todo: implement: ask AcsContainer if it knows componentReference, and if it has transpXml-IF; if so, get component impl directly; check if respective component helper allows direct calls to transpXmlIF (by not implementing _getInterfaceTranslator, or some explicit flag); move intercepting layer (ContainerSealant) so that it's still in between the components.

See also:
alma.acs.container.ContainerServices::getTransparentXmlComponent(java.lang.Class, org.omg.CORBA.Object, java.lang.Class)

Implements alma::acs::container::ContainerServices.

void alma::acs::container::ContainerServicesImpl::registerComponentListener ComponentListener  listener  )  [inline]
 

Allows a client to register a callback object that gets notified when some component(s) in use by the client (= components the client requested previously) dies or comes back to life (with ComponentListener#includeForeignComponents()==false).

If the client wants to get notified even for components that it does not hold a reference to, then ComponentListener#includeForeignComponents() should return true. ContainerServices

Parameters:
listener 
See also:
si.ijs.maci.ClientOperations::components_available(si.ijs.maci.ComponentInfo[])
Since:
ACS 6.0

Implements alma::acs::container::ContainerServices.

void alma::acs::container::ContainerServicesImpl::releaseAllComponents  )  [inline]
 

void alma::acs::container::ContainerServicesImpl::releaseComponent String  curl  )  [inline]
 

Releases the specified component reference. This involves notification of the manager, as well as calling _release() on the CORBA stub. If the curl is not known to the container, the request will be ignored.

Note that references to other components are released by this method, where the components hosted inside this container act as clients. These referenced components may run inside this or some other container/container.

TODO optionally run in a separate thread to gain speed, especially needed for quick shutdown; consider race condition at the manager with new activation request for the same component though.

See also:
alma.acs.container.ContainerServices::releaseComponent(java.lang.String)

Implements alma::acs::container::ContainerServices.

void alma::acs::container::ContainerServicesImpl::setMethodsExcludedFromInvocationLogging String[]  methodsExcludedFromInvocationLogging  )  [inline, package]
 

With this optional call, automatic invocation logging for certain offshoot methods can be disabled.

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


Member Data Documentation

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

AdvancedContainerServicesImpl alma::acs::container::ContainerServicesImpl::advancedContainerServices [private]
 

ComponentListener alma::acs::container::ContainerServicesImpl::compListener [private]
 

Optional callback object for component available/unavailable notification

volatile AcsLogger alma::acs::container::ContainerServicesImpl::componentLogger [private]
 

final boolean alma::acs::container::ContainerServicesImpl::fakeUIDsForTesting = Boolean.getBoolean(PROPERTYNAME_FAKE_UID_FOR_TESTING) [private]
 

volatile IdentifierJ alma::acs::container::ContainerServicesImpl::identifierArchive [private]
 

final AcsManagerProxy alma::acs::container::ContainerServicesImpl::m_acsManagerProxy [protected]
 

final int alma::acs::container::ContainerServicesImpl::m_clientHandle [private]
 

final String alma::acs::container::ContainerServicesImpl::m_clientName [private]
 

final POA alma::acs::container::ContainerServicesImpl::m_clientPOA [private]
 

final Map<String, ComponentDescriptor> alma::acs::container::ContainerServicesImpl::m_componentDescriptorMap [private]
 

final ComponentStateManager alma::acs::container::ContainerServicesImpl::m_componentStateManager [private]
 

final AcsLogger alma::acs::container::ContainerServicesImpl::m_logger [protected]
 

final ThreadFactory alma::acs::container::ContainerServicesImpl::m_threadFactory [private]
 

final Map<String, org.omg.CORBA.Object> alma::acs::container::ContainerServicesImpl::m_usedComponentsMap [private]
 

final Map<String, org.omg.CORBA.Object> alma::acs::container::ContainerServicesImpl::m_usedNonStickyComponentsMap [private]
 

volatile String [] alma::acs::container::ContainerServicesImpl::methodsExcludedFromInvocationLogging [private]
 

final String alma::acs::container::ContainerServicesImpl::PROPERTYNAME_FAKE_UID_FOR_TESTING = "acs.container.fakeUIDsForTesting" [static]
 

cheat property that allows testing without identifier archive present, because UIDs will be faked

volatile UIDLibrary alma::acs::container::ContainerServicesImpl::uidLibrary [private]
 


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