Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes

com.cosylab.acs.maci.manager.ManagerImpl Class Reference

Inheritance diagram for com.cosylab.acs.maci.manager.ManagerImpl:
com.cosylab.acs.maci.Manager com.cosylab.acs.maci.HandleConstants com.cosylab.acs.maci.ManagerConstants

List of all members.

Classes

class  ClientMessageTask
class  ComponentInfoCompletionCallbackImpl
class  DeactivateComponentTask
class  DefaultGroupedRunnable
class  GroupedNotifyTask
interface  GroupedRunnable
class  HandleMonitorEntry
class  ReferenceCountingLock
class  ReleaseComponentResult
class  ReleaseComponentTask
class  RequestComponentTask
class  ServiceComponent
class  ShutdownContainerTask

Public Types

enum  WhyUnloadedReason { REMOVED, TIMEOUT, DISAPPEARED, REPLACED }

Public Member Functions

void setThreadUsage (int precentage)
void initialize (Prevayler prevayler, CDBAccess cdbAccess, Context context, Logger logger, ManagerContainerServices managerContainerServices)
void initializationDone ()
int getHandle ()
void setDomain (String domain)
String getDomain ()
ContainerInfo[] getContainerInfo (int id, int[] handles, String name_wc) throws AcsJNoPermissionEx
ClientInfo[] getClientInfo (int id, int[] handles, String name_wc) throws AcsJNoPermissionEx
ComponentInfo[] getComponentInfo (int id, int[] handles, String name_wc, String type_wc, boolean activeOnly) throws AcsJNoPermissionEx
Component getService (int id, URI curl, boolean activate, StatusHolder status) throws AcsJCannotGetComponentEx, AcsJNoPermissionEx
Component getComponent (int id, URI curl, boolean activate, StatusHolder status) throws AcsJCannotGetComponentEx, AcsJNoPermissionEx
Component getComponentNonSticky (int id, URI curl) throws AcsJCannotGetComponentEx, AcsJNoPermissionEx
void makeComponentImmortal (int id, URI curl, boolean immortalState) throws AcsJCannotGetComponentEx, AcsJNoPermissionEx, AcsJBadParameterEx
ClientInfo login (Client reference) throws AcsJNoPermissionEx
void logout (int id) throws AcsJNoPermissionEx
void logout (int id, boolean pingFailed) throws AcsJNoPermissionEx
int registerComponent (int id, URI curl, String type, Component component) throws AcsJNoPermissionEx, AcsJBadParameterEx
void unregisterComponent (int id, int h) throws AcsJNoPermissionEx, AcsJBadParameterEx
Component restartComponent (int id, URI curl) throws AcsJNoPermissionEx, AcsJBadParameterEx
int releaseComponent (int id, URI curl) throws AcsJNoPermissionEx, AcsJBadParameterEx
void releaseComponentAsync (int id, URI curl, LongCompletionCallback callback) throws AcsJNoPermissionEx, AcsJBadParameterEx
int forceReleaseComponent (int id, URI curl) throws AcsJNoPermissionEx, AcsJBadParameterEx
void releaseComponents (int id, URI[] curls) throws AcsJNoPermissionEx
void shutdownContainer (int id, String containerName, int action) throws AcsJNoPermissionEx
void shutdown (int id, int containers) throws AcsJNoPermissionEx
ClientInfo getClientInfo (int id)
ComponentInfo getComponentInfo (int id)
ComponentInfo getDefaultComponent (int id, String type) throws AcsJNoPermissionEx, NoDefaultComponentException
ComponentInfo getDynamicComponent (int id, ComponentSpec componentSpec, boolean markAsDefault) throws AcsJCannotGetComponentEx, AcsJNoPermissionEx, AcsJIncompleteComponentSpecEx, AcsJInvalidComponentSpecEx, AcsJComponentSpecIncompatibleWithActiveComponentEx
ComponentInfo[] getDynamicComponents (int id, ComponentSpec[] components) throws AcsJNoPermissionEx
ComponentInfo getCollocatedComponent (int id, ComponentSpec componentSpec, boolean markAsDefault, URI targetComponentURI) throws AcsJCannotGetComponentEx, AcsJNoPermissionEx, AcsJIncompleteComponentSpecEx, AcsJInvalidComponentSpecEx, AcsJComponentSpecIncompatibleWithActiveComponentEx
boolean isServiceComponent (String name)
void initializeFederation (Hashtable federationDirectoryProperties) throws CoreException
String toString ()
void reportPrevaylerState (final boolean raise, Throwable alarmEx)
HandleDataStore getContainers ()
HandleDataStore getAdministrators ()
HandleDataStore getClients ()
HandleDataStore getComponents ()
void logHandleRelease (int handle, WhyUnloadedReason reason)
HandleMonitorEntry getHandleReleaseLog (int handle)
Map getUnavailableComponents ()
Map getDefaultComponents ()
Context getRemoteDirectory ()
void setTransport (Transport transport)
void setRemoteDirectory (Context remoteDirectory)
Object getManagerComponentReference ()
Object getRemoteDirectoryComponentReference ()
void setManagerComponentReference (Object managerComponentReference)
void setRemoteDirectoryComponentReference (Object remoteDirectoryComponentReference)
boolean isShuttingDown ()
ManagerShutdown getShutdownImplementation ()
void setShutdownImplementation (ManagerShutdown shutdownImplementation)
long getLockTimeout ()
void setLockTimeout (long l)
void setCDBAccess (CDBAccess cdbAccess)
HashSet getActiveAlarms ()
boolean hasActiveAlarm (String faultMember)
void alarmRaised (String faultMember)
void alarmCleared (String faultMember)

Protected Member Functions

void registerGroupedNotifyTaks (Object key, GroupedRunnable runnable)
synchronized long generateExecutionId ()

Protected Attributes

transient Map< Client,
LinkedList< ClientMessageTask > > 
clientMessageQueue

Static Protected Attributes

static final String FAULT_FAMILY = "Manager"
static final String FAULT_MEMBER = "Prevayler"
static final int FAULT_CODE = 2

Detailed Description

This class is an implementation of MACI com.cosylab.acs.maci.Manager. It provides the actual internal implementation of the Manager functionality in a way independent from the ACS maci Manager IDL interface.

Author:
Matej Sekoranja (matej.sekoranja@cosylab.com)
Version:
@VERSION@
See also:
Manager

Member Enumeration Documentation

Enumerator:
REMOVED 
TIMEOUT 
DISAPPEARED 
REPLACED 

Member Function Documentation

void com.cosylab.acs.maci.manager.ManagerImpl.alarmCleared ( String  faultMember  ) 

Remember that alarms has been cleared.

Referenced by com.cosylab.acs.maci.manager.PingTimerTask.send_alarm().

void com.cosylab.acs.maci.manager.ManagerImpl.alarmRaised ( String  faultMember  ) 

Remember that alarms has been raised.

Referenced by com.cosylab.acs.maci.manager.PingTimerTask.send_alarm().

int com.cosylab.acs.maci.manager.ManagerImpl.forceReleaseComponent ( int  id,
URI  curl 
) throws AcsJNoPermissionEx, AcsJBadParameterEx
synchronized long com.cosylab.acs.maci.manager.ManagerImpl.generateExecutionId (  )  [protected]
HashSet com.cosylab.acs.maci.manager.ManagerImpl.getActiveAlarms (  ) 
Returns:
the activeAlarms
HandleDataStore com.cosylab.acs.maci.manager.ManagerImpl.getAdministrators (  ) 

Returns the administrators.

Returns:
HandleDataStore
ClientInfo [] com.cosylab.acs.maci.manager.ManagerImpl.getClientInfo ( int  id,
int[]  handles,
String  name_wc 
) throws AcsJNoPermissionEx
ClientInfo com.cosylab.acs.maci.manager.ManagerImpl.getClientInfo ( int  id  ) 

Get client info. for specified id of Client or Administrator.

Parameters:
id handle of the client whose info. should be returned
returns requested info, null if client with requested handle does not exits
HandleDataStore com.cosylab.acs.maci.manager.ManagerImpl.getClients (  ) 

Returns the clients.

Returns:
HandleDataStore
ComponentInfo com.cosylab.acs.maci.manager.ManagerImpl.getCollocatedComponent ( int  id,
ComponentSpec  componentSpec,
boolean  markAsDefault,
URI  targetComponentURI 
) throws AcsJCannotGetComponentEx, AcsJNoPermissionEx, AcsJIncompleteComponentSpecEx, AcsJInvalidComponentSpecEx, AcsJComponentSpecIncompatibleWithActiveComponentEx
See also:
com.cosylab.acs.maci.Manager.getCollocatedComponent(int, com.cosylab.acs.maci.ComponentSpec, boolean, URI)
Todo:
MF not supported

Todo:
temporary quick implementation (does not look in the CDB if component is not activated)

References com.cosylab.acs.maci.ComponentInfo.getContainerName(), com.cosylab.acs.maci.ComponentInfo.getName(), and com.cosylab.acs.maci.ComponentInfo.getType().

Component com.cosylab.acs.maci.manager.ManagerImpl.getComponent ( int  id,
URI  curl,
boolean  activate,
StatusHolder  status 
) throws AcsJCannotGetComponentEx, AcsJNoPermissionEx
ComponentInfo com.cosylab.acs.maci.manager.ManagerImpl.getComponentInfo ( int  id  ) 

Get component info. for specified id of Component.

Parameters:
id handle of the component whose info. should be returned
returns requested info, null if component with requested handle does not exits
Component com.cosylab.acs.maci.manager.ManagerImpl.getComponentNonSticky ( int  id,
URI  curl 
) throws AcsJCannotGetComponentEx, AcsJNoPermissionEx
HandleDataStore com.cosylab.acs.maci.manager.ManagerImpl.getComponents (  ) 

Returns the components.

Returns:
HandleDataStore
ContainerInfo [] com.cosylab.acs.maci.manager.ManagerImpl.getContainerInfo ( int  id,
int[]  handles,
String  name_wc 
) throws AcsJNoPermissionEx
HandleDataStore com.cosylab.acs.maci.manager.ManagerImpl.getContainers (  ) 

Returns the containers.

Returns:
HandleDataStore
ComponentInfo com.cosylab.acs.maci.manager.ManagerImpl.getDefaultComponent ( int  id,
String  type 
) throws AcsJNoPermissionEx, NoDefaultComponentException
See also:
com.cosylab.acs.maci.Manager.getDefaultComponent(int, java.lang.String)
Map com.cosylab.acs.maci.manager.ManagerImpl.getDefaultComponents (  ) 

Returns the defaultComponents.

Returns:
Map
String com.cosylab.acs.maci.manager.ManagerImpl.getDomain (  ) 
ComponentInfo com.cosylab.acs.maci.manager.ManagerImpl.getDynamicComponent ( int  id,
ComponentSpec  componentSpec,
boolean  markAsDefault 
) throws AcsJCannotGetComponentEx, AcsJNoPermissionEx, AcsJIncompleteComponentSpecEx, AcsJInvalidComponentSpecEx, AcsJComponentSpecIncompatibleWithActiveComponentEx
See also:
com.cosylab.acs.maci.Manager.getDynamicComponent(int, com.cosylab.acs.maci.ComponentSpec, boolean)

Todo:
Is it OK to get here? Always? This is a place where we have to check carefully.

References com.cosylab.acs.maci.ComponentInfo.getName(), and com.cosylab.acs.maci.ComponentInfo.getType().

ComponentInfo [] com.cosylab.acs.maci.manager.ManagerImpl.getDynamicComponents ( int  id,
ComponentSpec[]  components 
) throws AcsJNoPermissionEx
See also:
com.cosylab.acs.maci.Manager.getDynamicComponents(int, com.cosylab.acs.maci.ComponentSpec[])
Todo:
this method still returns null in case of errors and only throws AcsJNoPermissions or a couple of runtime exceptions. Needs to be refactored or, probably better, deprecated.
int com.cosylab.acs.maci.manager.ManagerImpl.getHandle (  ) 

Returns the handle of the Manager.

Returns:
int handle of the Manager.
HandleMonitorEntry com.cosylab.acs.maci.manager.ManagerImpl.getHandleReleaseLog ( int  handle  ) 

Get handle release log.

Parameters:
handle 
Returns:
log or null if it does not exist.
long com.cosylab.acs.maci.manager.ManagerImpl.getLockTimeout (  ) 

Returns lock timeout (deadlock detection time) in ms.

Returns:
lock timeout (deadlock detection time) in ms
Object com.cosylab.acs.maci.manager.ManagerImpl.getManagerComponentReference (  ) 

Returns the managerComponentReference.

Returns:
Object
Context com.cosylab.acs.maci.manager.ManagerImpl.getRemoteDirectory (  ) 

Returns the remoteDirectory.

Returns:
Context
Object com.cosylab.acs.maci.manager.ManagerImpl.getRemoteDirectoryComponentReference (  ) 

Returns the remoteDirectoryComponentReference.

Returns:
Object
Component com.cosylab.acs.maci.manager.ManagerImpl.getService ( int  id,
URI  curl,
boolean  activate,
StatusHolder  status 
) throws AcsJCannotGetComponentEx, AcsJNoPermissionEx
See also:
com.cosylab.acs.maci.Manager.getService(int, java.net.URI, boolean, StatusHolder)
ManagerShutdown com.cosylab.acs.maci.manager.ManagerImpl.getShutdownImplementation (  ) 

Returns the shutdownImplementation.

Returns:
ManagerShutdown
Map com.cosylab.acs.maci.manager.ManagerImpl.getUnavailableComponents (  ) 

Returns the unavailableComponents.

Returns:
Map
boolean com.cosylab.acs.maci.manager.ManagerImpl.hasActiveAlarm ( String  faultMember  ) 
void com.cosylab.acs.maci.manager.ManagerImpl.initializationDone (  ) 

Called from client code after all manager inicialization is done.

void com.cosylab.acs.maci.manager.ManagerImpl.initialize ( Prevayler  prevayler,
CDBAccess  cdbAccess,
Context  context,
Logger  logger,
ManagerContainerServices  managerContainerServices 
)

Initializes Manager.

Parameters:
prevayler implementation of prevayler system
context remote directory implementation
void com.cosylab.acs.maci.manager.ManagerImpl.initializeFederation ( Hashtable  federationDirectoryProperties  )  throws CoreException

Initialize manager federation.

boolean com.cosylab.acs.maci.manager.ManagerImpl.isServiceComponent ( String  name  ) 

Checks if component name is a service component name, list of names is defined in the CDB.

Parameters:
name name to be checked, non-null
Returns:
true if component name is service component name, false otherwise

References com.cosylab.cdb.client.DAOProxy.get_string_seq().

boolean com.cosylab.acs.maci.manager.ManagerImpl.isShuttingDown (  ) 

Return shutdown status of the Manager.

Returns:
shutdown status of the Manager
void com.cosylab.acs.maci.manager.ManagerImpl.logHandleRelease ( int  handle,
WhyUnloadedReason  reason 
)

Log handle release.

Parameters:
handle 
reason 
void com.cosylab.acs.maci.manager.ManagerImpl.logout ( int  id,
boolean  pingFailed 
) throws AcsJNoPermissionEx

Logout client.

Parameters:
id client handle.
pingFailed flag indicating that ping has failed (i.e. reason for logout).
See also:
com.cosylab.acs.maci.Manager.logout(int)
void com.cosylab.acs.maci.manager.ManagerImpl.logout ( int  id  )  throws AcsJNoPermissionEx
void com.cosylab.acs.maci.manager.ManagerImpl.makeComponentImmortal ( int  id,
URI  curl,
boolean  immortalState 
) throws AcsJCannotGetComponentEx, AcsJNoPermissionEx, AcsJBadParameterEx
void com.cosylab.acs.maci.manager.ManagerImpl.registerGroupedNotifyTaks ( Object  key,
GroupedRunnable  runnable 
) [protected]
int com.cosylab.acs.maci.manager.ManagerImpl.releaseComponent ( int  id,
URI  curl 
) throws AcsJNoPermissionEx, AcsJBadParameterEx
void com.cosylab.acs.maci.manager.ManagerImpl.releaseComponentAsync ( int  id,
URI  curl,
LongCompletionCallback  callback 
) throws AcsJNoPermissionEx, AcsJBadParameterEx
void com.cosylab.acs.maci.manager.ManagerImpl.releaseComponents ( int  id,
URI[]  curls 
) throws AcsJNoPermissionEx
See also:
com.cosylab.acs.maci.Manager.releaseComponents(int, URI[])
void com.cosylab.acs.maci.manager.ManagerImpl.reportPrevaylerState ( final boolean  raise,
Throwable  alarmEx 
)

Convenience method for send_alarm with given state.

Parameters:
faultMember 
state 

References alma.alarmsystem.source.ACSFaultState.setDescriptor(), and alma.alarmsystem.source.ACSFaultState.setUserTimestamp().

Component com.cosylab.acs.maci.manager.ManagerImpl.restartComponent ( int  id,
URI  curl 
) throws AcsJNoPermissionEx, AcsJBadParameterEx
void com.cosylab.acs.maci.manager.ManagerImpl.setCDBAccess ( CDBAccess  cdbAccess  ) 

Sets CDB access.

Parameters:
cdbAccess cdbAccess to set.

References com.cosylab.cdb.client.CDBAccess.destroy().

void com.cosylab.acs.maci.manager.ManagerImpl.setDomain ( String  domain  ) 

Set name of the domain, which this manager will handle.

Parameters:
domain name of the domain, which this manager will handle, non-null
See also:
getDomain
void com.cosylab.acs.maci.manager.ManagerImpl.setLockTimeout ( long  l  ) 

Sets lock timeout (deadlock detection time) in ms.

Parameters:
l lock timeout (deadlock detection time) in ms
void com.cosylab.acs.maci.manager.ManagerImpl.setManagerComponentReference ( Object  managerComponentReference  ) 

Sets the managerComponentReference.

Parameters:
managerComponentReference The managerComponentReference to set
void com.cosylab.acs.maci.manager.ManagerImpl.setRemoteDirectory ( Context  remoteDirectory  ) 

Sets the remoteDirectory.

Parameters:
remoteDirectory The remoteDirectory to set
void com.cosylab.acs.maci.manager.ManagerImpl.setRemoteDirectoryComponentReference ( Object  remoteDirectoryComponentReference  ) 

Sets the remoteDirectoryComponentReference.

Parameters:
remoteDirectoryComponentReference The remoteDirectoryComponentReference to set
void com.cosylab.acs.maci.manager.ManagerImpl.setShutdownImplementation ( ManagerShutdown  shutdownImplementation  ) 

Sets the shutdownImplementation.

Parameters:
shutdownImplementation The shutdownImplementation to set
void com.cosylab.acs.maci.manager.ManagerImpl.setThreadUsage ( int  precentage  ) 
void com.cosylab.acs.maci.manager.ManagerImpl.setTransport ( Transport  transport  ) 

Set the transport.

Parameters:
transport 
void com.cosylab.acs.maci.manager.ManagerImpl.shutdown ( int  id,
int  containers 
) throws AcsJNoPermissionEx
void com.cosylab.acs.maci.manager.ManagerImpl.shutdownContainer ( int  id,
String  containerName,
int  action 
) throws AcsJNoPermissionEx
String com.cosylab.acs.maci.manager.ManagerImpl.toString (  ) 

Returns a single-line rendition of this instance into text.

Returns:
internal state of this instance
void com.cosylab.acs.maci.manager.ManagerImpl.unregisterComponent ( int  id,
int  h 
) throws AcsJNoPermissionEx, AcsJBadParameterEx

Member Data Documentation

transient Map<Client, LinkedList<ClientMessageTask> > com.cosylab.acs.maci.manager.ManagerImpl.clientMessageQueue [protected]

Queue (per client) for its messages.

final int com.cosylab.acs.maci.manager.ManagerImpl.FAULT_CODE = 2 [static, protected]
final String com.cosylab.acs.maci.manager.ManagerImpl.FAULT_FAMILY = "Manager" [static, protected]
final String com.cosylab.acs.maci.manager.ManagerImpl.FAULT_MEMBER = "Prevayler" [static, protected]

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