public class ManagerImpl extends AbstractPrevalentSystem implements Manager, HandleConstants
Manager| Modifier and Type | Class and Description |
|---|---|
static class |
ManagerImpl.WhyUnloadedReason |
Manager.LongCompletionCallback| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<Client,java.util.LinkedList<com.cosylab.acs.maci.manager.ManagerImpl.ClientMessageTask>> |
clientMessageQueue
Queue (per client) for its messages.
|
protected static int |
FAULT_CODE |
protected static java.lang.String |
FAULT_FAMILY |
protected static java.lang.String |
FAULT_MEMBER |
static java.lang.String |
STATE_PERSISTENCE_DEFAULT |
RELEASE_IMMEDIATELY, RELEASE_NEVER, RELEASE_TIME_UNDEFINEDADMINISTRATOR_MASK, CLIENT_MASK, COMPONENT_MASK, CONTAINER_MASK, HANDLE_MASK, KEY_MASK, MANAGER_MASK, TYPE_MASK| Constructor and Description |
|---|
ManagerImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
alarmCleared(java.lang.String faultMember)
Remember that alarms has been cleared.
|
void |
alarmRaised(java.lang.String faultMember)
Remember that alarms has been raised.
|
int |
forceReleaseComponent(int id,
java.net.URI curl)
Forcefully release a component.
|
protected long |
generateExecutionId() |
java.util.HashSet |
getActiveAlarms() |
HandleDataStore |
getAdministrators()
Returns the administrators.
|
ClientInfo |
getClientInfo(int id)
Get client info.
|
ClientInfo[] |
getClientInfo(int id,
int[] handles,
java.lang.String name_wc)
Get all the information that the Manager has about its known clients.
|
HandleDataStore |
getClients()
Returns the clients.
|
ComponentInfo |
getCollocatedComponent(int id,
ComponentSpec componentSpec,
boolean markAsDefault,
java.net.URI targetComponentURI)
Activation of an co-deployed component.
|
Component |
getComponent(int id,
java.net.URI curl,
boolean activate,
StatusHolder status)
Get a component, activating it if necessary.
|
ComponentInfo |
getComponentInfo(int id)
Get component info.
|
ComponentInfo[] |
getComponentInfo(int id,
int[] handles,
java.lang.String name_wc,
java.lang.String type_wc,
boolean activeOnly)
Get all the information that the Manager has about components.
|
Component |
getComponentNonSticky(int id,
java.net.URI curl)
Get a component, do not activate it and also do not do any reference counting.
|
HandleDataStore |
getComponents()
Returns the components.
|
ContainerInfo[] |
getContainerInfo(int id,
int[] handles,
java.lang.String name_wc)
Get all the information that the Manager has about its known containers.
|
HandleDataStore |
getContainers()
Returns the containers.
|
ComponentInfo |
getDefaultComponent(int id,
java.lang.String type)
Get default component of given type.
|
java.util.Map<java.lang.String,ComponentInfo> |
getDefaultComponents()
Returns the defaultComponents.
|
java.lang.String |
getDomain()
Return the fully qualified name of the domain, e.g., "antenna1.alma.nrao".
|
ComponentInfo |
getDynamicComponent(int id,
ComponentSpec componentSpec,
boolean markAsDefault)
Activation of an dynamic component.
|
ComponentInfo[] |
getDynamicComponents(int id,
ComponentSpec[] components) |
int |
getHandle()
Returns the handle of the Manager.
|
com.cosylab.acs.maci.manager.ManagerImpl.HandleMonitorEntry |
getHandleReleaseLog(int handle)
Get handle release log.
|
long |
getLockTimeout()
Returns lock timeout (deadlock detection time) in ms.
|
java.lang.Object |
getManagerComponentReference()
Returns the managerComponentReference.
|
java.util.Map<java.lang.Integer,com.cosylab.acs.maci.manager.ManagerImpl.HandleMonitorEntry> |
getReleasedHandles()
Get handle released map.
|
javax.naming.Context |
getRemoteDirectory()
Returns the remoteDirectory.
|
java.lang.Object |
getRemoteDirectoryComponentReference()
Returns the remoteDirectoryComponentReference.
|
Component |
getService(int id,
java.net.URI curl,
boolean activate,
StatusHolder status)
Get a service.
|
ManagerShutdown |
getShutdownImplementation()
Returns the shutdownImplementation.
|
java.util.concurrent.atomic.AtomicBoolean |
getStatePersitenceFlag() |
java.util.Map |
getUnavailableComponents()
Returns the unavailableComponents.
|
boolean |
hasActiveAlarm(java.lang.String faultMember)
Flag if alarm is active.
|
void |
initializationDone()
Called from client code after all manager initialization is done.
|
void |
initialize(Prevayler prevayler,
CDBAccess cdbAccess,
javax.naming.Context context,
java.util.logging.Logger logger,
ManagerContainerServices managerContainerServices)
Initializes Manager.
|
void |
initializeFederation(java.util.Hashtable federationDirectoryProperties)
Initialize manager federation.
|
boolean |
isServiceComponent(java.lang.String name)
Checks if component name is a service component name, list of names is defined in the CDB.
|
boolean |
isShuttingDown()
Return shutdown status of the Manager.
|
void |
logHandleCleanup(long maxAgeMs)
Log handle cleanup (removes logs older than maxAgeMs).
|
void |
logHandleRelease(int handle,
ManagerImpl.WhyUnloadedReason reason)
Log handle release.
|
ClientInfo |
login(Client reference)
Login to MACI.
|
void |
logout(int id)
Logout from MACI.
|
void |
logout(int id,
boolean pingFailed)
Logout client.
|
void |
makeComponentImmortal(int id,
java.net.URI curl,
boolean immortalState)
Change mortality state of an component.
|
ClientInfo |
noSyncGetClientInfo(int id)
Get client info.
|
int |
registerComponent(int id,
java.net.URI curl,
java.lang.String type,
Component component)
Register a CORBA object as a component, assigning it a CURL and making it accessible through the Manager.
|
protected void |
registerGroupedNotifyTaks(java.lang.Object key,
com.cosylab.acs.maci.manager.ManagerImpl.GroupedRunnable runnable) |
int |
releaseComponent(int id,
java.net.URI curl)
Release a component.
|
void |
releaseComponentAsync(int id,
java.net.URI curl,
Manager.LongCompletionCallback callback) |
void |
releaseComponents(int id,
java.net.URI[] curls) |
void |
reportPrevaylerState(boolean raise,
java.lang.Throwable alarmEx)
Convenience method for send_alarm with given state.
|
Component |
restartComponent(int id,
java.net.URI curl)
Restart a component.
|
void |
setCDBAccess(CDBAccess cdbAccess)
Sets CDB access.
|
void |
setConnectionThreadUsage(int percentage)
Allows setting the current percentage of used connection threads,
which would typically be updated by an ORB profiler.
|
void |
setDomain(java.lang.String domain)
Set name of the domain, which this manager will handle.
|
void |
setLockTimeout(long l)
Sets lock timeout (deadlock detection time) in ms.
|
void |
setManagerComponentReference(java.lang.Object managerComponentReference)
Sets the managerComponentReference.
|
void |
setRemoteDirectory(javax.naming.Context remoteDirectory)
Sets the remoteDirectory.
|
void |
setRemoteDirectoryComponentReference(java.lang.Object remoteDirectoryComponentReference)
Sets the remoteDirectoryComponentReference.
|
void |
setShutdownImplementation(ManagerShutdown shutdownImplementation)
Sets the shutdownImplementation.
|
void |
setStatePersistence(int id,
boolean enable)
Enable/disable state persistence subsystem.
|
void |
setTransport(Transport transport)
Set the transport.
|
void |
shutdown(int id,
int containers)
Shutdown the Manager.
|
void |
shutdownContainer(int id,
java.lang.String containerName,
int action)
Shutdown a container.
|
java.lang.String |
toString()
Returns a single-line rendition of this instance into text.
|
void |
unregisterComponent(int id,
int h)
Unregister a component from the Manager.
|
protected transient java.util.Map<Client,java.util.LinkedList<com.cosylab.acs.maci.manager.ManagerImpl.ClientMessageTask>> clientMessageQueue
public static final java.lang.String STATE_PERSISTENCE_DEFAULT
protected static final java.lang.String FAULT_FAMILY
protected static final java.lang.String FAULT_MEMBER
protected static final int FAULT_CODE
protected void registerGroupedNotifyTaks(java.lang.Object key,
com.cosylab.acs.maci.manager.ManagerImpl.GroupedRunnable runnable)
public void setConnectionThreadUsage(int percentage)
percentage - threadsUsedPercentagepublic void initialize(Prevayler prevayler,
CDBAccess cdbAccess,
javax.naming.Context context,
java.util.logging.Logger logger,
ManagerContainerServices managerContainerServices)
prevayler - implementation of prevayler systemcontext - remote directory implementationpublic void initializationDone()
public int getHandle()
public void setDomain(java.lang.String domain)
domain - name of the domain, which this manager will handle, non-nullgetDomain()public java.lang.String getDomain()
ManagergetDomain in interface ManagerManager.getDomain()protected long generateExecutionId()
public ContainerInfo[] getContainerInfo(int id, int[] handles, java.lang.String name_wc) throws AcsJNoPermissionEx
ManagergetContainerInfo in interface Managerid - Identification of the caller.handles - Handles of the containers whose information is requested. If this is an empty sequence, the name_wc parameter is used.name_wc - Wildcard that the container's name must match in order for its information to be returned.AcsJNoPermissionExManager.getContainerInfo(int, int[], String)public ClientInfo[] getClientInfo(int id, int[] handles, java.lang.String name_wc) throws AcsJNoPermissionEx
ManagergetClientInfo in interface Managerid - Identification of the caller.handles - Handles of the clients whose information is requested. If this is an empty sequence, the name_wc parameter is used.name_wc - Wildcard that the clients's name must match in order for its information to be returned.AcsJNoPermissionExManager.getClientInfo(int, int[], String)public ComponentInfo[] getComponentInfo(int id, int[] handles, java.lang.String name_wc, java.lang.String type_wc, boolean activeOnly) throws AcsJNoPermissionEx
ManagergetComponentInfo in interface Managerid - Identification of the caller.handles - Handles of the components whose information is requested. If this is an empty sequence, the name_wc and type_wc parameters are used.name_wc - Wildcard that the Component's name must match in order for its information to be returned.type_wc - Wildcard that the Component's type must match in order for its information to be returned.activeOnly - If true returns information only about components that are activated.AcsJNoPermissionExManager.getComponentInfo(int, int[], String, String, boolean)public Component getService(int id, java.net.URI curl, boolean activate, StatusHolder status) throws AcsJCannotGetComponentEx, AcsJNoPermissionEx
ManagergetService in interface ManagerAcsJCannotGetComponentExAcsJNoPermissionExManager.getService(int, java.net.URI, boolean, StatusHolder)public Component getComponent(int id, java.net.URI curl, boolean activate, StatusHolder status) throws AcsJCannotGetComponentEx, AcsJNoPermissionEx
ManagergetComponent in interface Managerid - Identification of the caller. If this is an invalid handle,
or if the caller does not have enough access rights,
a AcsJNoPermissionEx exception is raised.curl - CURL of the component whose reference is to be retrieved.activate - true if the Component is to be activated in case it does not exist.
If set to false, and the Component exist,
a null reference is returned and status is set to COMPONENT_NOT_ACTIVATED.status - Status of the request. One of COMPONENT_ACTIVATED, COMPONENT_DOES_NO_EXIST and COMPONENT_NOT_ACTIVATED.AcsJCannotGetComponentExAcsJNoPermissionExManager.getComponent(int, URI, boolean, StatusHolder)public Component getComponentNonSticky(int id, java.net.URI curl) throws AcsJCannotGetComponentEx, AcsJNoPermissionEx
ManagergetComponentNonSticky in interface Managerid - Identification of the caller. If this is an invalid handle, or if the caller does not have enough access rights, a AcsJNoPermissionEx exception is raised.AcsJCannotGetComponentExAcsJNoPermissionExManager.getComponentNonSticky(int id, URI curl)public void makeComponentImmortal(int id,
java.net.URI curl,
boolean immortalState)
throws AcsJCannotGetComponentEx,
AcsJNoPermissionEx,
AcsJBadParameterEx
ManagerNoResourcesException exception will be thrown.
The caller must be an owner of an component or have administator rights,
otherwise AcsJNoPermissionEx exception will be thrown.makeComponentImmortal in interface Managerid - Identification of the caller. The caller must be an owner of an component or have administator rights.curl - The CURL of the component whose mortality to change.immortalState - New mortality state.AcsJCannotGetComponentExAcsJNoPermissionExAcsJBadParameterExManager.makeComponentImmortal(int, java.net.URI, boolean)public ClientInfo login(Client reference) throws AcsJNoPermissionEx
Managerlogin in interface Managerreference - A reference to the Client.AcsJNoPermissionExManager.login(Client)public void logout(int id)
throws AcsJNoPermissionEx
Managerlogout in interface Managerid - Handle of the Client that is logging outAcsJNoPermissionExManager.logout(int)public void logout(int id,
boolean pingFailed)
throws AcsJNoPermissionEx
id - client handle.pingFailed - flag indicating that ping has failed (i.e. reason for logout).AcsJNoPermissionExManager.logout(int)public int registerComponent(int id,
java.net.URI curl,
java.lang.String type,
Component component)
throws AcsJNoPermissionEx,
AcsJBadParameterEx
ManagerregisterComponent in interface Managerid - Identification of the caller.
The caller must have the REGISTER_COMPONENT access right to perform this operation.curl - CURL that will be assigned to the object. The CURL must be in the Manager's domain, otherwise a fundamental property of domains that one computer belongs to only one domain would be too easy to violate.type - Type of the componentcomponent - Object to be registered as component.AcsJNoPermissionExAcsJBadParameterExManager.registerComponent(int, URI, String, Component)public void unregisterComponent(int id,
int h)
throws AcsJNoPermissionEx,
AcsJBadParameterEx
ManagerunregisterComponent in interface Managerid - Identification of the caller.
The caller must have the REGISTER_COMPONENT access right to perform this operation.h - Component's handle.
The component must have been previously registered through the call to register_component.
If there are clients still using this component, a components_unavailable notification is
issued to all of them, and the component is unregistered.AcsJNoPermissionExAcsJBadParameterExManager.unregisterComponent(int, int)public Component restartComponent(int id, java.net.URI curl) throws AcsJNoPermissionEx, AcsJBadParameterEx
ManagerrestartComponent in interface Managerid - Identification of the caller. If this is an invalid handle,
or if the caller does not have enough access rights,
a AcsJNoPermissionEx exception is raised.curl - CURL of the component whose reference is to be restarted.AcsJNoPermissionExAcsJBadParameterExManager.restartComponent(int, URI)public int releaseComponent(int id,
java.net.URI curl)
throws AcsJNoPermissionEx,
AcsJBadParameterEx
ManagerreleaseComponent in interface Managerid - Identification of the caller. The caller must have previously got the Component through get_component.curl - The CURL of the Component to be released.AcsJNoPermissionExAcsJBadParameterExManager.releaseComponent(int, URI)public void releaseComponentAsync(int id,
java.net.URI curl,
Manager.LongCompletionCallback callback)
throws AcsJNoPermissionEx,
AcsJBadParameterEx
releaseComponentAsync in interface ManagerAcsJNoPermissionExAcsJBadParameterExManager.releaseComponentAsync(int, java.net.URI, com.cosylab.acs.maci.Manager.LongCompletionCallback)public int forceReleaseComponent(int id,
java.net.URI curl)
throws AcsJNoPermissionEx,
AcsJBadParameterEx
ManagerforceReleaseComponent in interface Managerid - Identification of the caller.curl - The CURL of the Component to be released.AcsJNoPermissionExAcsJBadParameterExManager.forceReleaseComponent(int, URI)public void releaseComponents(int id,
java.net.URI[] curls)
throws AcsJNoPermissionEx
AcsJNoPermissionExcom.cosylab.acs.maci.Manager#releaseComponents(int, URI[])public void shutdownContainer(int id,
java.lang.String containerName,
int action)
throws AcsJNoPermissionEx
ManagershutdownContainer in interface Managerid - Identification of the caller. The caller must have the SHUTDOWN_SYSTEM access right.action - The code to send to shutdown method of the container. If 0, the Container's disconnect methods is called instead.AcsJNoPermissionExManager.shutdownContainer(int, java.lang.String, int)public void shutdown(int id,
int containers)
throws AcsJNoPermissionEx
Managershutdown in interface Managerid - Identification of the caller. The caller must have the SHUTDOWN_SYSTEM access right.containers - The code to send to shutdown methods of all containers.
If 0, the Container's shutdown methods are not called.AcsJNoPermissionExManager.shutdown(int, int)public ClientInfo getClientInfo(int id)
Client or Administrator.id - handle of the client whose info. should be returnedreturns - requested info, null if client with requested handle does not exitspublic ClientInfo noSyncGetClientInfo(int id)
Client or Administrator.id - handle of the client whose info. should be returnedreturns - requested info, null if client with requested handle does not exitspublic ComponentInfo getComponentInfo(int id)
Component.id - handle of the component whose info. should be returnedreturns - requested info, null if component with requested handle does not exitspublic ComponentInfo getDefaultComponent(int id, java.lang.String type) throws AcsJNoPermissionEx, NoDefaultComponentException
ManagergetDefaultComponent in interface Managerid - Identification of the caller. If this is an invalid handle,
or if the caller does not have enough access rights,
a AcsJNoPermissionEx exception is raised.type - type of the component whose reference is to be restarted.ComponentInfo of the component. If no defualt component is found
NoDefaultComponentException exception is thrown.AcsJNoPermissionExNoDefaultComponentExceptionManager.getDefaultComponent(int, java.lang.String)public ComponentInfo getDynamicComponent(int id, ComponentSpec componentSpec, boolean markAsDefault) throws AcsJCannotGetComponentEx, AcsJNoPermissionEx, AcsJIncompleteComponentSpecEx, AcsJInvalidComponentSpecEx, AcsJComponentSpecIncompatibleWithActiveComponentEx
ManagergetDynamicComponent in interface Managerid - Identification of the caller.componentSpec - Component to be obtained.markAsDefault - Mark component as default component of its type.ComponentInfo of requested component.
If componentSpec if found to be incomplete IncompleteComponentSpecException exception is thrown.
If requested component collides with already activated component with the same name ComponentSpecIncompatibleWithActiveComponentException exception is thrown.AcsJCannotGetComponentExAcsJNoPermissionExAcsJIncompleteComponentSpecExAcsJInvalidComponentSpecExAcsJComponentSpecIncompatibleWithActiveComponentExManager.getDynamicComponent(int, com.cosylab.acs.maci.ComponentSpec, boolean)public ComponentInfo[] getDynamicComponents(int id, ComponentSpec[] components) throws AcsJNoPermissionEx
AcsJNoPermissionExcom.cosylab.acs.maci.Manager#getDynamicComponents(int, com.cosylab.acs.maci.ComponentSpec[])public ComponentInfo getCollocatedComponent(int id, ComponentSpec componentSpec, boolean markAsDefault, java.net.URI targetComponentURI) throws AcsJCannotGetComponentEx, AcsJNoPermissionEx, AcsJIncompleteComponentSpecEx, AcsJInvalidComponentSpecEx, AcsJComponentSpecIncompatibleWithActiveComponentEx
ManagergetCollocatedComponent in interface Managerid - Identification of the caller.componentSpec - Component to be obtained.markAsDefault - Mark component as default component of its type.targetComponentURI - target co-deployed component.ComponentInfo of requested component.
If componentSpec if found to be incomplete IncompleteComponentSpecException exception is thrown.
If requested component collides with already activated component with the same name ComponentSpecIncompatibleWithActiveComponentException exception is thrown.AcsJCannotGetComponentExAcsJNoPermissionExAcsJIncompleteComponentSpecExAcsJInvalidComponentSpecExAcsJComponentSpecIncompatibleWithActiveComponentExManager.getCollocatedComponent(int, com.cosylab.acs.maci.ComponentSpec, boolean, URI)public boolean isServiceComponent(java.lang.String name)
name - name to be checked, non-nullpublic void initializeFederation(java.util.Hashtable federationDirectoryProperties)
throws CoreException
CoreExceptionpublic java.lang.String toString()
public void reportPrevaylerState(boolean raise,
java.lang.Throwable alarmEx)
faultMember - state - public void setStatePersistence(int id,
boolean enable)
throws AcsJNoPermissionEx
ManagersetStatePersistence in interface Managerid - Identification of the caller.enable - enable/disable switch.AcsJNoPermissionExpublic java.util.concurrent.atomic.AtomicBoolean getStatePersitenceFlag()
public HandleDataStore getContainers()
public HandleDataStore getAdministrators()
public HandleDataStore getClients()
public HandleDataStore getComponents()
public void logHandleRelease(int handle,
ManagerImpl.WhyUnloadedReason reason)
handle - reason - public void logHandleCleanup(long maxAgeMs)
maxAgeMs - public com.cosylab.acs.maci.manager.ManagerImpl.HandleMonitorEntry getHandleReleaseLog(int handle)
handle - null if it does not exist.public java.util.Map<java.lang.Integer,com.cosylab.acs.maci.manager.ManagerImpl.HandleMonitorEntry> getReleasedHandles()
public java.util.Map getUnavailableComponents()
public java.util.Map<java.lang.String,ComponentInfo> getDefaultComponents()
public javax.naming.Context getRemoteDirectory()
public void setTransport(Transport transport)
transport - public void setRemoteDirectory(javax.naming.Context remoteDirectory)
remoteDirectory - The remoteDirectory to setpublic java.lang.Object getManagerComponentReference()
public java.lang.Object getRemoteDirectoryComponentReference()
public void setManagerComponentReference(java.lang.Object managerComponentReference)
managerComponentReference - The managerComponentReference to setpublic void setRemoteDirectoryComponentReference(java.lang.Object remoteDirectoryComponentReference)
remoteDirectoryComponentReference - The remoteDirectoryComponentReference to setpublic boolean isShuttingDown()
public ManagerShutdown getShutdownImplementation()
public void setShutdownImplementation(ManagerShutdown shutdownImplementation)
shutdownImplementation - The shutdownImplementation to setpublic long getLockTimeout()
public void setLockTimeout(long l)
l - lock timeout (deadlock detection time) in mspublic void setCDBAccess(CDBAccess cdbAccess)
cdbAccess - cdbAccess to set.public java.util.HashSet getActiveAlarms()
public boolean hasActiveAlarm(java.lang.String faultMember)
public void alarmRaised(java.lang.String faultMember)
public void alarmCleared(java.lang.String faultMember)