|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rioproject.resources.servicecore.ServiceProvider
org.rioproject.jsb.ServiceBeanAdapter
org.rioproject.monitor.ProvisionMonitorImpl
public class ProvisionMonitorImpl
The ProvisionMonitor service provides the capability to deploy and monitor OperationalStrings.
| Nested Class Summary | |
|---|---|
class |
ProvisionMonitorImpl.DeployMonitor
Use DeployHandlers to provide hot deployment capability |
class |
ProvisionMonitorImpl.OpStringManager
The OpStringManager provides the management for an OperationalString that has been deployed to the ProvisionMonitor |
| Nested classes/interfaces inherited from class org.rioproject.jsb.ServiceBeanAdapter |
|---|
ServiceBeanAdapter.SnapshotThread |
| Nested classes/interfaces inherited from interface org.rioproject.monitor.ProvisionMonitor |
|---|
ProvisionMonitor.PeerInfo |
| Field Summary |
|---|
| Fields inherited from class org.rioproject.jsb.ServiceBeanAdapter |
|---|
activationID, admin, computeResource, computeResourceObserver, context, contextMgr, joiner, jsbState, mbeanNoticationInfoList, mbeanServer, objectName, proxy, serviceBeanComponent, serviceID, slaThresholdEventAdapter, snapshotter, state, store, uuid |
| Fields inherited from class org.rioproject.resources.servicecore.ServiceProvider |
|---|
eventTable, watchRegistry |
| Constructor Summary | |
|---|---|
ProvisionMonitorImpl()
Create a ProvisionMonitor |
|
ProvisionMonitorImpl(ActivationID activationID,
MarshalledObject data)
Create a ProvisionMonitor using RMI Activation |
|
ProvisionMonitorImpl(String[] configArgs,
LifeCycle lifeCycle)
Create a ProvisionMonitor launched from the ServiceStarter framework |
|
| Method Summary | |
|---|---|
ProvisionMonitorImpl.OpStringManager |
addOperationalString(OperationalString opString,
Map<String,Throwable> map,
ProvisionMonitorImpl.OpStringManager parent,
DeployAdmin dAdmin,
ServiceProvisionListener listener)
Add an OpStringManager to this ProvisionMonitor. |
boolean |
assignBackupFor(ProvisionMonitor primary)
Assign the ProvisionMonitor as a backup for another ProvisionMonitor |
protected void |
bootstrap(String[] configArgs)
Get the ServiceBeanContext and bootstrap the ProvisionMonitor |
protected Object |
createProxy()
Override ServiceBeanAdapter createProxy to return a ProvisionMonitor Proxy |
Map<String,Throwable> |
deploy(OperationalString opString,
ServiceProvisionListener listener)
|
Map |
deploy(String opStringLocation)
Deploy an OperationalString URL to the ProvisionMonitor. |
Map<String,Throwable> |
deploy(String opStringLocation,
ServiceProvisionListener listener)
|
Map<String,Throwable> |
deploy(URL opStringUrl,
ServiceProvisionListener listener)
|
void |
destroy()
Override destroy to ensure that all OpStringManagers are shutdown as well |
Object |
getAdmin()
Override parent's getAdmin to return custom service admin |
ProvisionMonitor.PeerInfo[] |
getBackupInfo()
|
TabularData |
getDeployments()
Get the current deployments for the ProvisionMonitor |
protected ProvisionMonitor |
getEventProxy()
Get the ProvisionMonitor event proxy source |
OperationalStringManager |
getOperationalStringManager(String name)
|
OperationalStringManager[] |
getOperationalStringManagers()
|
protected OperationalString[] |
getOperationalStrings()
Get all OperationalString objects from the Collection of OpStringManagers |
protected OpStringLoader |
getOpStringLoader()
Get the OpStringloader, the utility to load OperationalStrings |
protected ProvisionMonitorImpl.OpStringManager |
getOpStringManager(String name)
Get the OpStringManager for an OperationalString |
ProvisionMonitor.PeerInfo |
getPeerInfo()
Get the PeerInfo object for the ProvisionMonitor |
protected DeployAdmin |
getPrimaryManager(String opStringName)
Get the primary OperationalStringManager for the opstring |
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 |
ServiceBeanInstantiator[] |
getServiceBeanInstantiators()
Get all registered ServiceBeanInstantiator instances. |
protected ServiceInfo |
getServiceInfo()
|
boolean |
hasDeployed(String opStringName)
|
void |
initialize(ServiceBeanContext context)
Override parent initialize() method to provide specific initialization for the ProvisionMonitor |
boolean |
opStringExists(String opStringName)
Determine if the OperationalString with the provided name is deployed |
protected void |
processEvent(ProvisionMonitorEvent event)
Helper method to obtain a PoolableThread and create a ProvisionMonitorTask to send a ProvisionMonitorEvent |
EventRegistration |
register(ServiceBeanInstantiator instantiator,
MarshalledObject handback,
ResourceCapability resourceCapability,
List<DeployedService> deployedServices,
int serviceLimit,
long duration)
Register for notifications of ServiceProvisionEvent objects. |
boolean |
removeBackupFor(ProvisionMonitor primary)
Remove the ProvisionMonitor as a backup for another ProvisionMonitor |
protected void |
stateChanged(ProvisionMonitorImpl.OpStringManager opMgr,
boolean remove)
Notification of an OperationalString state change. |
boolean |
undeploy(String opStringName)
Undeploy and Remove an OperationalString deployed by the ProvisionMonitor. |
boolean |
undeploy(String name,
boolean terminate)
|
void |
update(ProvisionMonitor.PeerInfo peerInfo)
Notification from ProvisionMonitor peers updates to the PeerInfo object. |
void |
update(ServiceBeanInstantiator instantiator,
ResourceCapability resourceCapability,
List<DeployedService> deployedServices,
int serviceLimit)
Provides a feedback mechanism for a ServiceBeanInstantiator
to update it's operational capabilities as described by the
ResourceCapability object, and any changes in the
maximum number of services the ServiceBeanInstantiator will accept for
service provisioning
The ServiceBeanInstantiator must have an active
Lease with the
ProvisionManager for this method to be successful |
| Methods inherited from class org.rioproject.resources.servicecore.ServiceProvider |
|---|
fetch, fetch, getConfiguration, getEventTable, getWatchRegistry, register, setConfiguration, setEventTable, setWatchRegistry |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.rioproject.jsb.MonitorableService |
|---|
monitor, ping, startHeartbeat |
| Methods inherited from interface org.rioproject.event.EventProducer |
|---|
register |
| Methods inherited from interface org.rioproject.watch.Watchable |
|---|
fetch, fetch |
| Methods inherited from interface org.rioproject.jsb.ServiceBeanAdapterMBean |
|---|
advertise, destroy, getLookupGroups, getStarted, setLookupGroups, unadvertise |
| Constructor Detail |
|---|
public ProvisionMonitorImpl()
throws Exception
Exception - If the ProvisionMonitorImpl cannot be created
public ProvisionMonitorImpl(String[] configArgs,
LifeCycle lifeCycle)
throws Exception
configArgs - Configuration argumentslifeCycle - Service lifecycle manager
Exception - If the ProvisionMonitorImpl cannot be created
public ProvisionMonitorImpl(ActivationID activationID,
MarshalledObject data)
throws Exception
activationID - The ActivationIDdata - Serialized data for initialization
Exception - If the ProvisionMonitorImpl cannot be created| Method Detail |
|---|
protected void bootstrap(String[] configArgs)
throws Exception
configArgs - configuration arguments
Exception - If bootstrapping failspublic void destroy()
destroy in interface ServiceBeanAdapterMBeandestroy in class ServiceBeanAdapterServiceBeanAdapterMBean.destroy()public Object getAdmin()
getAdmin in interface AdministrablegetAdmin in class ServiceBeanAdapterpublic TrustVerifier getProxyVerifier()
TrustVerifier which can
be used to verify that the given proxy to this service can be trusted
getProxyVerifier in interface ServerProxyTrustgetProxyVerifier in class ServiceBeanAdapterprotected Object createProxy()
createProxy in class ServiceBeanAdapterprotected ServiceInfo getServiceInfo()
getServiceInfo in class ServiceBeanAdapterpublic OperationalStringManager[] getOperationalStringManagers()
public OperationalStringManager getOperationalStringManager(String name)
throws OperationalStringException
OperationalStringException
public Map deploy(String opStringLocation)
throws MalformedURLException
ProvisionMonitorImplMBeanFile object, if the
File object exists, it will be used, otherwise the argument
will be used to create a URL object.
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
deploy in interface ProvisionMonitorImplMBeanopStringLocation - The parameter indicating the location of the
OperationalString to deploy, may also be an artifact {groupId:artifactId:version}
MalformedURLException - if the opStringUrl cannot be used to
create a java.net.URL
public Map<String,Throwable> deploy(String opStringLocation,
ServiceProvisionListener listener)
throws OperationalStringException
OperationalStringException
public Map<String,Throwable> deploy(URL opStringUrl,
ServiceProvisionListener listener)
throws OperationalStringException
OperationalStringException
public Map<String,Throwable> deploy(OperationalString opString,
ServiceProvisionListener listener)
throws OperationalStringException
OperationalStringExceptionpublic boolean undeploy(String opStringName)
ProvisionMonitorImplMBean
undeploy in interface ProvisionMonitorImplMBeanopStringName - The name of the OperationalString to remove
public boolean undeploy(String name,
boolean terminate)
throws OperationalStringException
OperationalStringExceptionpublic boolean hasDeployed(String opStringName)
public TabularData getDeployments()
ProvisionMonitorImplMBean
getDeployments in interface ProvisionMonitorImplMBeanpublic ProvisionMonitor.PeerInfo[] getBackupInfo()
public ProvisionMonitor.PeerInfo getPeerInfo()
throws RemoteException
ProvisionMonitor
getPeerInfo in interface ProvisionMonitorRemoteException - if communication errors occur
public boolean assignBackupFor(ProvisionMonitor primary)
throws RemoteException
ProvisionMonitor
assignBackupFor in interface ProvisionMonitorprimary - The ProvisionMonitor that will be backed up. If this
ProvisionMonitor is removed from the network, then all OperationalString
instances the removed ProvisionManager was managing will be managed by this
ProvisionMonitor
RemoteException - if communication errors occur
public boolean removeBackupFor(ProvisionMonitor primary)
throws RemoteException
ProvisionMonitor
removeBackupFor in interface ProvisionMonitorprimary - The primary ProvisionMonitor that no longer requires
the support of this ProvisionManager
RemoteException - if communication errors occur
public void update(ProvisionMonitor.PeerInfo peerInfo)
throws RemoteException
ProvisionMonitor
update in interface ProvisionMonitorpeerInfo - The PeerInfo object
RemoteException - if communication errors occur
public EventRegistration register(ServiceBeanInstantiator instantiator,
MarshalledObject handback,
ResourceCapability resourceCapability,
List<DeployedService> deployedServices,
int serviceLimit,
long duration)
throws LeaseDeniedException,
RemoteException
ProvisionManagerServiceProvisionEvent objects. The returned
EventRegistration is leased; the lease must be
managed by the caller. The event ID in the returned EventRegistration
corresponds to the event ID of the ServiceProvisionEvent.
While the EventRegistration is valid, ServiceProvisionEvent notifications are sent to the specified ServiceBeanInstantiator whenever the ProvisionManager determines that a ServiceBeanInstantiator meets requirements specified by the ServiceBean.
register in interface ProvisionManagerinstantiator - The ServiceBeanInstantiatorhandback - The handback Object to include with event notificationresourceCapability - The capabilities of the compute resourcedeployedServices - An immutable List of DeployedService
objects documenting existing deployed (and active) services. If there
are no active services, an empty List must be provided.serviceLimit - The maximum amount of services the compute resources
will accept for provisioningduration - The requested lease duration
LeaseDeniedException - If the Lease to the ProvisionManager is
denied
RemoteException - If communication errors happen
public void update(ServiceBeanInstantiator instantiator,
ResourceCapability resourceCapability,
List<DeployedService> deployedServices,
int serviceLimit)
throws UnknownLeaseException,
RemoteException
ProvisionManagerServiceBeanInstantiator
to update it's operational capabilities as described by the
ResourceCapability object, and any changes in the
maximum number of services the ServiceBeanInstantiator will accept for
service provisioning
The ServiceBeanInstantiator must have an active
Lease with the
ProvisionManager for this method to be successful
update in interface ProvisionManagerinstantiator - The Listener to send events toresourceCapability - The capabilities of the compute resourcedeployedServices - An immutable List of DeployedService
objects documenting existing deployed (and active) services. If there
are no active services, an empty List must be provided.serviceLimit - The maximum amount of services the compute resources
will accept for provisioning
UnknownLeaseException - If the Lease to the ProvisionManager is
unknown
RemoteException - If communication errors happenpublic ServiceBeanInstantiator[] getServiceBeanInstantiators()
ProvisionManagerServiceBeanInstantiator instances.
getServiceBeanInstantiators in interface ProvisionManagerServiceBeanInstantiator instances.
If there are no registered ServiceBeanInstantiators, return
a zero-length array. A new array is allocated each time
public ProvisionMonitorImpl.OpStringManager addOperationalString(OperationalString opString,
Map<String,Throwable> map,
ProvisionMonitorImpl.OpStringManager parent,
DeployAdmin dAdmin,
ServiceProvisionListener listener)
throws Exception
opString - The OperationalString to addmap - A Map to store any exceptions produced while loading the
opStringparent - The parent of the opString. The addOperationalString
method recursively processes OperationalString instances and uses this
parameter to indicate a nested OperationalStringdAdmin - The managing DeployAdmin, if the OperationalString is
being added in an inactive mode, as a backup. If this value is null,
this ProvisionMonitor is set to be activelistener - A ServiceProvisionListener that will be set to the
OperationalStringManager for notification of services as they are
deployed initially.
Exception - if an OpStringManger cannot be createdpublic boolean opStringExists(String opStringName)
opStringName - The name of the OperationalString
protected ProvisionMonitor getEventProxy()
protected DeployAdmin getPrimaryManager(String opStringName)
opStringName - The opstring name
protected ProvisionMonitorImpl.OpStringManager getOpStringManager(String name)
name - The name of an OperationalString
protected OperationalString[] getOperationalStrings()
public void initialize(ServiceBeanContext context)
throws Exception
initialize in interface ServiceBeaninitialize in class ServiceBeanAdaptercontext - The ServiceBeanContext
Exception - If something unexpected happens
protected OpStringLoader getOpStringLoader()
throws Exception
Exception - if the OpStringLoader cannot be created
protected void stateChanged(ProvisionMonitorImpl.OpStringManager opMgr,
boolean remove)
opMgr - The OpStringManager that has changedremove - Whether or not the OpStringManager has been removedprotected void processEvent(ProvisionMonitorEvent event)
event - The ProvisionMonitorEvent to send
|
Copyright © Rio Project. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||