public class AcsManagerProxy
extends java.lang.Object
This class is stateful, so there must be one AcsManagerProxy used per client
if a process has more than one client to the manager.
Warning: This class is not supposed to be instantiated by components and other non-framework classes.
Components should only access this class through ContainerServices.
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.Object |
connectorLock
The lock should only be held for short periods, the threads executing
our API need to be able to retrieve it quickly.
|
protected java.lang.Thread |
connectorThread
This thread keeps retrying to log in to the manager.
|
| Constructor and Description |
|---|
AcsManagerProxy(java.lang.String managerLoc,
org.omg.CORBA.ORB orb,
java.util.logging.Logger logger)
Constructor stores parameters, but takes no further action.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
activateReloginToManagerIfDisconnected() |
AcsManagerProxy |
createInstance()
Creates a new instance, using the same manager, orb and logger.
|
int |
force_release_component(int clientHandle,
java.lang.String curl)
Calls
ManagerOperations#force_release_component(int, String). |
ComponentInfo |
get_collocated_component(int clientHandle,
ComponentSpec c,
boolean mark_as_default,
java.lang.String target_component_url)
Encapsulates
si.ijs.maci.ManagerOperations#get_collocated_component(int, si.ijs.maci.ComponentSpec, boolean, java.lang.String). |
ComponentInfo[] |
get_component_info(int[] componentHandles,
java.lang.String name_wc,
java.lang.String type_wc,
boolean active_only)
From maci IDL comments:
"Gets all the information that the Manager has about components.
|
org.omg.CORBA.Object |
get_component_non_sticky(int clientHandle,
java.lang.String component_url) |
org.omg.CORBA.Object |
get_component(int clientHandle,
java.lang.String component_url,
boolean activate)
The more restricted version of
get_service,
only good for getting components. |
ComponentInfo |
get_default_component(int clientHandle,
java.lang.String componentIDLType) |
ComponentInfo |
get_dynamic_component(int clientHandle,
ComponentSpec c,
boolean mark_as_default) |
org.omg.CORBA.Object |
get_service(java.lang.String service_url,
boolean includeComponents)
Note that in ACS 10.2 the meaning of the second parameter has slightly changed, but should be transparent.
|
org.omg.CORBA.Object |
getComponentNonSticky(int clientHandle,
java.lang.String component_url)
Gets a component as a "weak client" who does not prevent component unloading in case
the other real clients release their references.
|
static java.lang.String |
getLocalManagerCorbaloc() |
Manager |
getManager()
Gets the ACS Manager, either cached or freshly retrieved.
|
int |
getManagerHandle()
Returns the handle that the ACS Manager has assigned to the container/client during login.
|
protected void |
handleRuntimeException(java.lang.RuntimeException exc)
Invoked by the manager methods on failure.
|
void |
loginToManager(Client managerClient,
int attempts)
Logs in to the manager, using the provided manager client CORBA object.
|
void |
logoutFromManager()
Logs out from the manager.
|
boolean |
pingManager(long timeoutMillis)
Pings the manager.
|
int |
register_component(java.lang.String component_url,
java.lang.String type,
org.omg.CORBA.Object component)
From maci IDL comments: "Registers a CORBA object as a component,
assigning it a CURL and making it accessible through the Manager.
|
void |
release_component(int clientHandle,
java.lang.String component_url,
CBlong callback)
From maci IDL comments:
"Asynchronously release a component.
|
void |
shutdownNotify()
Notification that the container is in the process of shutting down.
|
protected final java.lang.Object connectorLock
protected final java.lang.Thread connectorThread
public AcsManagerProxy(java.lang.String managerLoc,
org.omg.CORBA.ORB orb,
java.util.logging.Logger logger)
managerLoc - corbaloc string for the Managerorb - active ORB; provided explicitly rather than using AcsCorba,
so we can easily reuse this class for clients outside of the container.logger - public Manager getManager()
throws AcsJContainerEx
#loginToManager(Client, boolean) after this.AcsJContainerServicesExAcsJContainerExprotected void activateReloginToManagerIfDisconnected()
protected void handleRuntimeException(java.lang.RuntimeException exc)
public void loginToManager(Client managerClient,
int attempts)
throws AcsJContainerEx
managerClient - the IDL-defined client of the manager (see maci.idl),
of which the container is a subclass.attempts - The number of attempts to find and login (0 means forever)
If 0, a background thread is started to re-login if the connection breaks.AcsJContainerServicesExAcsJContainerExpublic boolean pingManager(long timeoutMillis)
Currently calls get_client_info to see if the manager responds.
Todo: should be replaced by a call to Manager.ping when this is available.
timeoutMillis - timout in milliseconds that can restrict the general ORB timeout.isLoggedIn(boolean)public void logoutFromManager()
public ComponentInfo[] get_component_info(int[] componentHandles,
java.lang.String name_wc,
java.lang.String type_wc,
boolean active_only)
throws AcsJNoPermissionEx
componentHandles - 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.active_only - AcsJNoPermissionExpublic org.omg.CORBA.Object get_service(java.lang.String service_url,
boolean includeComponents)
throws AcsJComponentNotAlreadyActivatedEx,
AcsJCannotGetComponentEx,
AcsJComponentConfigurationNotFoundEx,
AcsJNoPermissionEx
AcsJComponentNotAlreadyActivatedExAcsJCannotGetComponentExAcsJComponentConfigurationNotFoundExAcsJNoPermissionExpublic org.omg.CORBA.Object get_component(int clientHandle,
java.lang.String component_url,
boolean activate)
throws AcsJCannotGetComponentEx,
AcsJComponentNotAlreadyActivatedEx,
AcsJComponentConfigurationNotFoundEx,
AcsJNoPermissionEx
get_service,
only good for getting components.clientHandle - handle of requesting component or other kind of client
(for non-container clients this will always be the login-handle)component_url - to specify the requested componentactivate - status - status out-parameterAcsJCannotGetComponentExAcsJComponentNotAlreadyActivatedExAcsJComponentConfigurationNotFoundExAcsJNoPermissionExContainerServices.getComponent(String)public org.omg.CORBA.Object get_component_non_sticky(int clientHandle,
java.lang.String component_url)
throws AcsJCannotGetComponentEx,
AcsJComponentNotAlreadyActivatedEx,
AcsJNoPermissionEx
AcsJCannotGetComponentExAcsJComponentNotAlreadyActivatedExAcsJNoPermissionExpublic org.omg.CORBA.Object getComponentNonSticky(int clientHandle,
java.lang.String component_url)
throws AcsJComponentNotAlreadyActivatedEx,
AcsJCannotGetComponentEx,
AcsJNoPermissionEx
get_component with activate==false.clientHandle - component_url - AcsJComponentNotAlreadyActivatedEx - if the requested component has not already been activated by some other clientAcsJCannotGetComponentExAcsJUnexpectedExceptionEx - if the remote call failed with a (CORBA) runtime exceptionAcsJNoPermissionExpublic ComponentInfo get_default_component(int clientHandle,
java.lang.String componentIDLType)
throws AcsJNoDefaultComponentEx,
AcsJCannotGetComponentEx,
AcsJNoPermissionEx
clientHandle - handle of requesting component or other kind of client
(for non-container clients this will always be the login-handle)componentIDLType - the IDL typeAcsJNoDefaultComponentExAcsJCannotGetComponentExAcsJNoPermissionExContainerServices.getDefaultComponent(String)public ComponentInfo get_dynamic_component(int clientHandle,
ComponentSpec c,
boolean mark_as_default)
throws AcsJIncompleteComponentSpecEx,
AcsJInvalidComponentSpecEx,
AcsJComponentSpecIncompatibleWithActiveComponentEx,
AcsJCannotGetComponentEx,
AcsJNoPermissionEx
clientHandle - handle of requesting component or other kind of client
(for non-container clients this will always be the login-handle)c - dynamic version of deployment info, may be incomplete, see ACS documentationmark_as_default - if true, make the new component instance the default for its typesi.ijs.maci.IncompleteComponentSpecsi.ijs.maci.InvalidComponentSpec - Thrown if there is no valid dynamic component found for given resulting structure.si.ijs.maci.ComponentSpecIncompatibleWithActiveComponent - Thrown if the resulting structure is incompatible with a component of the same name
already active.AcsJIncompleteComponentSpecExAcsJInvalidComponentSpecExAcsJComponentSpecIncompatibleWithActiveComponentExAcsJCannotGetComponentExAcsJNoPermissionExpublic ComponentInfo get_collocated_component(int clientHandle,
ComponentSpec c,
boolean mark_as_default,
java.lang.String target_component_url)
throws AcsJIncompleteComponentSpecEx,
AcsJInvalidComponentSpecEx,
AcsJComponentSpecIncompatibleWithActiveComponentEx,
AcsJCannotGetComponentEx,
AcsJNoPermissionEx
si.ijs.maci.ManagerOperations#get_collocated_component(int, si.ijs.maci.ComponentSpec, boolean, java.lang.String).clientHandle - handle of requesting component or other kind of client
(for non-container clients this will always be the login-handle)c - dynamic version of deployment info, may be incomplete, see ACS documentationmark_as_default - if true, make the new component instance the default for its typetarget_component_url - IncompleteComponentSpecInvalidComponentSpecComponentSpecIncompatibleWithActiveComponentAcsJIncompleteComponentSpecExAcsJInvalidComponentSpecExAcsJComponentSpecIncompatibleWithActiveComponentExAcsJCannotGetComponentExAcsJNoPermissionExpublic int register_component(java.lang.String component_url,
java.lang.String type,
org.omg.CORBA.Object component)
throws AcsJCannotRegisterComponentEx,
AcsJNoPermissionEx
component_url - type - component - AcsJCannotRegisterComponentExAcsJNoPermissionExpublic void release_component(int clientHandle,
java.lang.String component_url,
CBlong callback)
throws AcsJNoPermissionEx
clientHandle - handle of requesting component or other kind of client
(for non-container clients this will always be the login-handle)component_url - callback - to synch on actual component release, receive possible exceptions,
and returned number of remaining clients (which could be a useful debugging tool).AcsJNoPermissionEx - If this client does not hold a valid reference to the target component.java.lang.RuntimeException - such as BAD_PARAM, NO_PERMISSION, NO_RESOURCES, OBJECT_NOT_EXIST, TIMEOUT, TRANSIENT UNKNOWNpublic int force_release_component(int clientHandle,
java.lang.String curl)
throws AcsJNoPermissionEx
ManagerOperations#force_release_component(int, String). This call must not be used by regular
component code. It is only provided for setting up tests, writing specialized operator tools, and similar purposes.AcsJNoPermissionExpublic int getManagerHandle()
public void shutdownNotify()
With ACS 7.0.2 this method is no longer synchronized because it deadlocked the shutdown hook thread when the manager proxy was in a login loop. See COMP-2602.
public static java.lang.String getLocalManagerCorbaloc()
public AcsManagerProxy createInstance()
There is no communication between this instance and the new instance.
For example, a call to shutdownNotify() will not be forwarded.