Rio Project 4.2 API Documentation



org.rioproject.monitor
Class ProvisionMonitorAdminImpl

java.lang.Object
  extended by org.rioproject.resources.servicecore.ServiceAdminImpl
      extended by org.rioproject.monitor.ProvisionMonitorAdminImpl
All Implemented Interfaces:
DestroyAdmin, Remote, JoinAdmin, ServerProxyTrust, ServiceBeanAdmin, ServiceBeanControl, DeployAdmin, ProvisionMonitorAdmin, ServiceAdmin

public class ProvisionMonitorAdminImpl
extends ServiceAdminImpl
implements ProvisionMonitorAdmin, ServerProxyTrust

The ProvisionMonitorAdminImpl class implements the ServiceAdmin interface providing administrative support.

Author:
Dennis Reedy

Field Summary
 
Fields inherited from class org.rioproject.resources.servicecore.ServiceAdminImpl
adminProxy, exporter
 
Constructor Summary
ProvisionMonitorAdminImpl(ProvisionMonitorImpl service, Exporter exporter)
          Create a ProvisionMonitorAdminImpl
ProvisionMonitorAdminImpl(ProvisionMonitorImpl service, Exporter exporter, SnapshotHandler snapshotHandler)
          Create a ProvisionMonitorAdminImpl
 
Method Summary
 Map<String,Throwable> deploy(OperationalString opString)
          Deploy an OperationalString to the ProvisionMonitor.
 Map<String,Throwable> deploy(OperationalString opString, ServiceProvisionListener listener)
          Deploy an OperationalString to the ProvisionMonitor.
 Map<String,Throwable> deploy(String location)
          Deploy an OperationalString to the ProvisionMonitor.
 Map<String,Throwable> deploy(String location, ServiceProvisionListener listener)
          Deploy an OperationalString to the ProvisionMonitor.
 Map<String,Throwable> deploy(URL opStringURL)
          Deploy an OperationalString URL to the ProvisionMonitor.
 Map<String,Throwable> deploy(URL opStringURL, ServiceProvisionListener listener)
          Deploy an OperationalString URL to the ProvisionMonitor.
 ProvisionMonitor.PeerInfo[] getBackupInfo()
          Get the ProvisionMonitor instances that are being backed up
 OperationalStringManager getOperationalStringManager(String name)
          Retrieve the managing OperationalStringManager for an OperationalString
 OperationalStringManager[] getOperationalStringManagers()
          This will retrieve an array of OperationalStringManager instances that are managing deployed OperationalString instances.
 TrustVerifier getProxyVerifier()
          Override parent's method to return TrustVerifier which can be used to verify that the given proxy to this service can be trusted
 ServiceAdmin getServiceAdmin()
          Override parents getServiceAdmin method
 boolean hasDeployed(String opStringName)
          Determine if this ProvisionMonitor has deployed the OperationalString as determined by the name
 boolean undeploy(String opStringName)
          Undeploy an OperationalString deployed by the ProvisionMonitor.
 
Methods inherited from class org.rioproject.resources.servicecore.ServiceAdminImpl
addLookupAttributes, addLookupGroups, addLookupLocators, advertise, destroy, getJoinSet, getLookupAttributes, getLookupGroups, getLookupLocators, getServiceBeanInstantiatorUuid, getServiceElement, getUpTime, modifyLookupAttributes, removeLookupGroups, removeLookupLocators, setLookupGroups, setLookupLocators, setServiceBeanContext, setServiceElement, start, stop, unadvertise, unexport
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.rioproject.resources.servicecore.ServiceAdmin
getJoinSet
 
Methods inherited from interface org.rioproject.core.jsb.ServiceBeanAdmin
getServiceBeanInstantiatorUuid, getServiceElement, getUpTime, setServiceElement
 
Methods inherited from interface org.rioproject.jsb.ServiceBeanControl
advertise, start, stop, unadvertise
 
Methods inherited from interface net.jini.admin.JoinAdmin
addLookupAttributes, addLookupGroups, addLookupLocators, getLookupAttributes, getLookupGroups, getLookupLocators, modifyLookupAttributes, removeLookupGroups, removeLookupLocators, setLookupGroups, setLookupLocators
 
Methods inherited from interface com.sun.jini.admin.DestroyAdmin
destroy
 

Constructor Detail

ProvisionMonitorAdminImpl

public ProvisionMonitorAdminImpl(ProvisionMonitorImpl service,
                                 Exporter exporter)
Create a ProvisionMonitorAdminImpl

Parameters:
service - Concrete implementation of a ServiceBeanAdapter
exporter - The Exporter to export this object

ProvisionMonitorAdminImpl

public ProvisionMonitorAdminImpl(ProvisionMonitorImpl service,
                                 Exporter exporter,
                                 SnapshotHandler snapshotHandler)
Create a ProvisionMonitorAdminImpl

Parameters:
service - Concrete implementation of a ServiceBeanAdapter
exporter - The Exporter to export this object
snapshotHandler - The service's snapshot handler used for persistence
Method Detail

getProxyVerifier

public TrustVerifier getProxyVerifier()
Override parent's method to return TrustVerifier which can be used to verify that the given proxy to this service can be trusted

Specified by:
getProxyVerifier in interface ServerProxyTrust
Returns:
TrustVerifier The TrustVerifier used to verify the proxy

getServiceAdmin

public ServiceAdmin getServiceAdmin()
                             throws RemoteException
Override parents getServiceAdmin method

Overrides:
getServiceAdmin in class ServiceAdminImpl
Returns:
The ServiceAdmin
Throws:
RemoteException - if an communication errors occur

deploy

public Map<String,Throwable> deploy(URL opStringURL)
                             throws OperationalStringException
Description copied from interface: DeployAdmin
Deploy an OperationalString URL to the ProvisionMonitor. The ProvisionMonitor will load the location and deploy the OperationalString If the OperationalString includes nested OperationalStrings, the nested OperationalStrings will be deployed as well. If nested OperationalString items are already deployed, they will not be re-deployed. If the OperationalString specified by the input URL has already been deployed, or is scheduled for deployment, then no part of that OperationalString (or nested OperationalString instances) will be deployed

Specified by:
deploy in interface DeployAdmin
Parameters:
opStringURL - The URL indicating the location of the OperationalString to deploy
Returns:
If there are errors loading part of the OperationalString the Map will be returned with name value pairs associating the service and corresponding exceptions
Throws:
OperationalStringException - If the OperationalString parsing errors occur

deploy

public Map<String,Throwable> deploy(URL opStringURL,
                                    ServiceProvisionListener listener)
                             throws OperationalStringException
Description copied from interface: DeployAdmin
Deploy an OperationalString URL to the ProvisionMonitor. The ProvisionMonitor will load the location and deploy the OperationalString If the OperationalString includes nested OperationalStrings, the nested OperationalStrings will be deployed as well. If nested OperationalString items are already deployed, they will not be re-deployed. If the OperationalString specified by the input URL has already been deployed, or is scheduled for deployment, then no part of that OperationalString (or nested OperationalString instances) will be deployed

Specified by:
deploy in interface DeployAdmin
Parameters:
opStringURL - The URL indicating the location of the OperationalString to deploy
listener - If not null, the ServiceProvisionListener will be notified as each service is deployed
Returns:
If there are errors loading part of the OperationalString the Map will be returned with name value pairs associating the service and corresponding exceptions
Throws:
OperationalStringException - If OperationalString parsing errors occur

deploy

public Map<String,Throwable> deploy(String location)
                             throws OperationalStringException
Description copied from interface: DeployAdmin
Deploy an OperationalString to the ProvisionMonitor. The ProvisionMonitor will load the location and deploy the OperationalString If the OperationalString includes nested OperationalStrings, the nested OperationalStrings will be deployed as well. If nested OperationalString items are already deployed, they will not be re-deployed. If the OperationalString specified by the input URL has already been deployed, or is scheduled for deployment, then no part of that OperationalString (or nested OperationalString instances) will be deployed

Specified by:
deploy in interface DeployAdmin
Parameters:
location - The location of the OperationalString to deploy (may also be an OAR, or artifact that resolves to an OAR)
Returns:
If there are errors loading part of the OperationalString the Map will be returned with name value pairs associating the service and corresponding exceptions
Throws:
OperationalStringException - If the OperationalString parsing errors occur

deploy

public Map<String,Throwable> deploy(String location,
                                    ServiceProvisionListener listener)
                             throws OperationalStringException
Description copied from interface: DeployAdmin
Deploy an OperationalString to the ProvisionMonitor. The ProvisionMonitor will load the location and deploy the OperationalString If the OperationalString includes nested OperationalStrings, the nested OperationalStrings will be deployed as well. If nested OperationalString items are already deployed, they will not be re-deployed. If the OperationalString specified by the input URL has already been deployed, or is scheduled for deployment, then no part of that OperationalString (or nested OperationalString instances) will be deployed

Specified by:
deploy in interface DeployAdmin
Parameters:
location - The location of the OperationalString to deploy (may also be an OAR, or artifact that resolves to an OAR)
listener - If not null, the ServiceProvisionListener will be notified as each service is deployed
Returns:
If there are errors loading part of the OperationalString the Map will be returned with name value pairs associating the service and corresponding exceptions
Throws:
OperationalStringException - If OperationalString parsing errors occur

deploy

public Map<String,Throwable> deploy(OperationalString opString)
                             throws OperationalStringException
Description copied from interface: DeployAdmin
Deploy an OperationalString to the ProvisionMonitor. The ProvisionMonitor will deploy the contents specified by the OperationalString object f the OperationalString includes nested OperationalStrings, the nested OperationalStrings will be deployed as well. If nested OperationalString items are already deployed, they will not be re-deployed. If the OperationalString specified by the input URL has already been deployed, or is scheduled for deployment, then no part of that OperationalString (or nested OperationalString instances) will be deployed

Specified by:
deploy in interface DeployAdmin
Parameters:
opString - The OperationalString to deploy
Returns:
If there are errors loading part of the OperationalString the Map will be returned with name value pairs associating the service and corresponding exceptions
Throws:
OperationalStringException - If the OperationalString parsing errors occur

deploy

public Map<String,Throwable> deploy(OperationalString opString,
                                    ServiceProvisionListener listener)
                             throws OperationalStringException
Description copied from interface: DeployAdmin
Deploy an OperationalString to the ProvisionMonitor. The ProvisionMonitor will deploy the contents specified by the OperationalString object f the OperationalString includes nested OperationalStrings, the nested OperationalStrings will be deployed as well. If nested OperationalString items are already deployed, they will not be re-deployed. If the OperationalString specified by the input URL has already been deployed, or is scheduled for deployment, then no part of that OperationalString (or nested OperationalString instances) will be deployed

Specified by:
deploy in interface DeployAdmin
Parameters:
opString - The OperationalString to deploy
listener - If not null, the ServiceProvisionListener will be notified as each service is deployed
Returns:
If there are errors loading part of the OperationalString the Map will be returned with name value pairs associating the service and corresponding exceptions
Throws:
OperationalStringException - if the the entire deployment fails

undeploy

public boolean undeploy(String opStringName)
                 throws OperationalStringException
Description copied from interface: DeployAdmin
Undeploy an OperationalString deployed by the ProvisionMonitor. The ProvisionMonitor will search as follows:
  1. First for the OperationalString by it's name, and if found, remove the OperationalString and any nested OperationalStrings that are included by the OperatinalString.
  2. If the name is not found, the ProvisionMonitor will search for the matching OAR, by looking at directory names under the configured installDir property. If a matching directory name is found, the corresponding OAR file will be loaded, loading the configured OperationalString, and undeploying as indicated in step 1.
As a result of undeploying the OperationalString(s), all services that have a provision type of ServiceElement.ProvisionType.DYNAMIC or ServiceElement.ProvisionType.FIXED will be terminated. If any deployment request or redeployment requests are pending for the OperationalString(s) being undeployed, these requests will be cancelled

Specified by:
undeploy in interface DeployAdmin
Parameters:
opStringName - The name of the OperationalString or directory to undeploy
Returns:
Returns true if the OperationalString has been undeployed
Throws:
OperationalStringException - If the OperationalString does not exist

hasDeployed

public boolean hasDeployed(String opStringName)
Description copied from interface: DeployAdmin
Determine if this ProvisionMonitor has deployed the OperationalString as determined by the name

Specified by:
hasDeployed in interface DeployAdmin
Parameters:
opStringName - The name of the OperationalString
Returns:
If found return true, otherwise false

getOperationalStringManagers

public OperationalStringManager[] getOperationalStringManagers()
Description copied from interface: DeployAdmin
This will retrieve an array of OperationalStringManager instances that are managing deployed OperationalString instances. If an OperationalString includes nested OperationalStrings, those OperationalStringManager instances that are nested will be returned as part of this array.

Specified by:
getOperationalStringManagers in interface DeployAdmin
Returns:
Array of OperationalStringManager instances that are managing deployed OperationalString instances. Only OperationalStringManager instances created on the local ProvisionMonitor will be returned

getOperationalStringManager

public OperationalStringManager getOperationalStringManager(String name)
                                                     throws OperationalStringException
Description copied from interface: DeployAdmin
Retrieve the managing OperationalStringManager for an OperationalString

Specified by:
getOperationalStringManager in interface DeployAdmin
Parameters:
name - The name of the OperationalString
Returns:
The OperationalStringManager instance that is managing a deployed OperationalString. The OperationalStringManager returned may be running in a remote ProvisionMonitor
Throws:
OperationalStringException - If an OperationalStringManager can not be found to the OperationalString

getBackupInfo

public ProvisionMonitor.PeerInfo[] getBackupInfo()
Description copied from interface: ProvisionMonitorAdmin
Get the ProvisionMonitor instances that are being backed up

Specified by:
getBackupInfo in interface ProvisionMonitorAdmin
Returns:
Array of PeerInfo objects

Copyright © Rio Project.

Copyright © 2006-2011 Rio Project. All Rights Reserved.