|
||||||||||
| 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.cybernode.CybernodeImpl
public class CybernodeImpl
Implementation of a Cybernode
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.rioproject.jsb.ServiceBeanAdapter |
|---|
ServiceBeanAdapter.SnapshotThread |
| 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 | |
|---|---|
CybernodeImpl()
Create a Cybernode |
|
CybernodeImpl(ActivationID activationID,
MarshalledObject data)
Create a Cybernode that uses RMI Activation |
|
CybernodeImpl(String[] configArgs,
LifeCycle lifeCycle)
Create a Cybernode launched from the ServiceStarter framework |
|
| Method Summary | |
|---|---|
protected void |
addRegistrationTask(TimerTask task)
Add a TimerTask to the Collection of TimerTasks |
protected void |
bootstrap(String[] configArgs)
|
protected Object |
createProxy()
Override ServiceBeanAdapter createProxy to return a Cybernode Proxy |
void |
destroy()
Left for concrete implementations of this class to implement |
void |
destroy(boolean force)
Override destroy to ensure that any JSBs are shutdown as well |
protected void |
doEnlist(Schedule schedule)
Have the Cybernode add itself as a resource which can be used to instantiate dynamic application services. |
void |
enlist(Schedule schedule)
Have the Cybernode add itself as a resource which can be used to instantiate dynamic application services. |
Object |
getAdmin()
Override parent's getAdmin to return custom service admin |
protected Schedule |
getAvailabilitySchedule()
Get the availability schedule |
ComputeResource |
getComputeResource()
Get the ComputeResource associated with this Cybernode |
static String |
getConfigComponent()
Get the component name to use for accessing the services configuration properties |
InetAddress |
getInetAddress()
Get the IP address of the ServiceBeanInstantiator |
Uuid |
getInstantiatorUuid()
Implemented to support interface contract. |
String |
getName()
Get a name for the ServiceBeanInstantiator |
boolean |
getPersistentProvisioning()
Get whether the Cybernode supports persistent provisioning of qualitative capabilities |
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 |
protected TimerTask[] |
getRegistrationTasks()
Get all in process TimerTask instances that are specific to availability scheduling for registration to monitor instances |
Schedule |
getSchedule()
Get the availability schedule for the Cybernode. |
protected ServiceBeanContainer |
getServiceBeanContainer()
|
ServiceBeanInstance[] |
getServiceBeanInstances(ServiceElement element)
Get all ServiceBeanInstance objects for a
ServiceElement |
Integer |
getServiceCount()
Get the number of services that this Cybernode has instantiated |
protected ServiceInfo |
getServiceInfo()
Get the ServiceInfo for the Cybernode |
Integer |
getServiceLimit()
Get the upper limit of services that this Cybernode can instantiate |
ServiceRecord[] |
getServiceRecords(int filter)
This method returns an array of ServiceRecord objects which contain
information about the service instances this ServiceBeanInstantiator
has instantiated. |
ServiceStatement |
getServiceStatement(ServiceElement elem)
This method returns a ServiceStatement for the
ServiceElement |
ServiceStatement[] |
getServiceStatements()
This method returns an array of ServiceStatement objects which contain
information about the ServiceBean instances this ServiceBeanInstantiator
has instantiated. |
protected Entry[] |
getServiceUIs()
Get the service UIs to add |
protected Timer |
getTaskTimer()
Get the Timer created for the Cybernode |
double |
getUtilization()
Get the resource's utilization. |
protected Entry |
getWatchUI()
Override parents getWatchUI, using cybernode-ui.jar as the JAR containing org.rioproject.watch.AccumulatorViewer |
void |
initialize(ServiceBeanContext context)
The initialize method is invoked to initialize the ServiceBean. |
DeployedService |
instantiate(ServiceProvisionEvent event)
This method is invoked as a result of event registration to ProvisionManager instances. |
boolean |
isEnlisted()
Get the enlisted state |
protected void |
loadInitialServices(Configuration config)
Load any initial services |
void |
release(boolean terminateServices)
Have the Cybernode remove itself as a resource which that can be used to instantiate dynamic application services. |
protected void |
removeRegistrationTask(TimerTask task)
Remove a TimerTask from Collection of scheduled TimerTask instances |
void |
serviceDiscarded(ServiceRecord serviceRecord)
Notification that a ServiceBean has been discarded |
void |
serviceInstantiated(ServiceRecord serviceRecord)
Notification that a ServiceBean has been instantiated |
protected void |
setAvailabilitySchedule(Schedule sched)
Set the availability schedule |
protected void |
setConfigComponent(String comp)
Set the component name to use for accessing the services configuration properties |
protected void |
setEnlisted(boolean value)
Set the enlisted flag |
void |
setPersistentProvisioning(boolean provisionEnabled)
Set whether the Cybernode supports persistent provisioning of qualitative capabilities |
void |
setServiceLimit(Integer limit)
Set the upper limit of services that this Cybernode can instantiate |
void |
update(ServiceElement[] sElements,
OperationalStringManager opStringMgr)
Invoked to update instantiated ServiceBean instances of changes in their ServiceElement objects and
OperationalStringManager references. |
| 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, getLookupGroups, getStarted, setLookupGroups, unadvertise |
| Constructor Detail |
|---|
public CybernodeImpl()
public CybernodeImpl(String[] configArgs,
LifeCycle lifeCycle)
throws Exception
configArgs - Configuration argumentslifeCycle - The LifeCycle object that started the Cybernode
Exception - if bootstrapping fails
public CybernodeImpl(ActivationID activationID,
MarshalledObject data)
throws Exception
activationID - The ActivationIDdata - Startup data as a MarshalledObject
Exception - if bootstrapping fails| Method Detail |
|---|
public void destroy()
ServiceProvider
destroy in interface ServiceBeanAdapterMBeandestroy in class ServiceBeanAdapterServiceBeanAdapterMBean.destroy()public void destroy(boolean force)
destroy in interface ServiceBeandestroy in interface ServiceBeanAdapterMBeandestroy in class ServiceBeanAdapterforce - If true, unexports the ServiceBean even if there are
pending or in-progress calls; if false, only unexports the ServiceBean if
there are no pending or in-progress callsServiceBeanAdapterMBean.destroy(boolean)public 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 ServiceBeanAdapterpublic ServiceStatement[] getServiceStatements()
ServiceBeanInstantiatorServiceStatement objects which contain
information about the ServiceBean instances this ServiceBeanInstantiator
has instantiated.
getServiceStatements in interface ServiceBeanInstantiatorServiceBeanInstantiator.getServiceStatements()public ServiceRecord[] getServiceRecords(int filter)
ServiceBeanInstantiatorServiceRecord objects which contain
information about the service instances this ServiceBeanInstantiator
has instantiated.
getServiceRecords in interface ServiceBeanInstantiatorfilter - A filter for ServiceRecord retrieval. ServiceRecord
instances will be returned if the ServiceRecord type matches the filter
type. The filter can be either ServiceRecord.ACTIVE_SERVICE_RECORD or
ServiceRecord.INACTIVE_SERVICE_RECORD.
ServiceBeanInstantiator.getServiceRecords(int)public ServiceStatement getServiceStatement(ServiceElement elem)
ServiceBeanInstantiatorServiceStatement for the
ServiceElement
getServiceStatement in interface ServiceBeanInstantiatorelem - The ServiceElement to get the ServiceStatement for.
If this argument should is null, an IllegalArgumentException is thrown.
ServiceBeanInstantiator.getServiceStatement(org.rioproject.core.ServiceElement)public ServiceBeanInstance[] getServiceBeanInstances(ServiceElement element)
ServiceBeanInstantiatorServiceBeanInstance objects for a
ServiceElement
getServiceBeanInstances in interface ServiceBeanInstantiatorelement - The ServiceElement to obtain ServiceBeanInstance objects
for.
element parameter is null return all
ServiceBeanInstance objects. A new array is allocated each time.
If there are no matching ServiceBeanInstance objects a zero-length array
is returnedServiceBeanInstantiator.getServiceBeanInstances(org.rioproject.core.ServiceElement)
public void update(ServiceElement[] sElements,
OperationalStringManager opStringMgr)
throws RemoteException
ServiceBeanInstantiatorServiceElement objects and
OperationalStringManager references. This
method invocation is typically triggered when the
OperationalString has been
updated, or the OperationalStringManager has been changed, and provides
somewhat of a batch update mechanism.
The ServiceBeanInstantiator will match the array of
ServiceElement objects to instantiated service
instances. For each match, the instance
will have it's ServiceElement updated with the provided ServiceElement object.
ServiceElement updates can trigger changes in running services. ServiceElement attributes (and contained class attributes) which may trigger behavior changes as follows:
SLA instances
Association instances
update in interface ServiceBeanInstantiatorsElements - Array of ServiceElement instances to updateopStringMgr - The OperationalStringManager which is performing
the update
RemoteException - If communication errors happenServiceBeanInstantiator.update(org.rioproject.core.ServiceElement[], org.rioproject.core.OperationalStringManager)public String getName()
ServiceBeanInstantiator
getName in interface ServiceBeanInstantiatorServiceBeanInstantiator.getName()public Uuid getInstantiatorUuid()
getInstantiatorUuid in interface ServiceBeanInstantiatorServiceBeanInstantiator.getInstantiatorUuid()public InetAddress getInetAddress()
ServiceBeanInstantiator
getInetAddress in interface ServiceBeanInstantiatorInetAddresspublic void serviceInstantiated(ServiceRecord serviceRecord)
serviceInstantiated in interface ServiceBeanContainerListenerserviceRecord - The ServiceRecordpublic void serviceDiscarded(ServiceRecord serviceRecord)
serviceDiscarded in interface ServiceBeanContainerListenerserviceRecord - The ServiceRecord
protected void bootstrap(String[] configArgs)
throws Exception
Exceptionpublic static String getConfigComponent()
protected void setConfigComponent(String comp)
comp - The component nameprotected Object createProxy()
createProxy in class ServiceBeanAdapterpublic Object getAdmin()
getAdmin in interface AdministrablegetAdmin in class ServiceBeanAdapter
public void initialize(ServiceBeanContext context)
throws Exception
ServiceBeanAdapter
initialize in interface ServiceBeaninitialize in class ServiceBeanAdaptercontext - The ServiceBeanContext to initialize the ServiceBean with
Exception - If something unexpected happensServiceBean.initialize(org.rioproject.core.jsb.ServiceBeanContext)protected void loadInitialServices(Configuration config)
config - The Jini configuration to usepublic boolean isEnlisted()
isEnlisted in interface CybernodeisEnlisted in interface CybernodeImplMBeanprotected void setEnlisted(boolean value)
value - True if enlisted, false if notprotected Schedule getAvailabilitySchedule()
protected void setAvailabilitySchedule(Schedule sched)
sched - The Schedule for availabilityprotected TimerTask[] getRegistrationTasks()
protected void addRegistrationTask(TimerTask task)
task - The TimerTaskprotected void removeRegistrationTask(TimerTask task)
task - The TimerTask to removeprotected void doEnlist(Schedule schedule)
schedule - The Schedule to use for enlistmentprotected Timer getTaskTimer()
protected ServiceInfo getServiceInfo()
ServiceInfo for the Cybernode
getServiceInfo in class ServiceBeanAdapter
protected Entry getWatchUI()
throws IOException
getWatchUI in class ServiceBeanAdapterMalformedURLException
IOException
protected Entry[] getServiceUIs()
throws IOException
IOException - If the UIDescriptos cannot be createdprotected ServiceBeanContainer getServiceBeanContainer()
public DeployedService instantiate(ServiceProvisionEvent event)
throws JSBInstantiationException,
UnknownEventException
ServiceBeanInstantiatorProvisionManager instances. The
ServiceBeanInstantiator will register for
ServiceProvisionEvent notifications.
instantiate in interface ServiceBeanInstantiatorevent - - The ServiceProvisionEvent
JSBInstantiationException - if there are problems loading or
instantiating the ServiceBean
UnknownEventException - if it does not recognize the Event IDServiceBeanInstantiator.instantiate(org.rioproject.core.provision.ServiceProvisionEvent)public ComputeResource getComputeResource()
public Schedule getSchedule()
Cybernode
getSchedule in interface Cybernodenullpublic void enlist(Schedule schedule)
Cybernode
enlist in interface Cybernodeschedule - The availability schedule for the Cybernode. The
Cybernode registers and unregisters to discovered Provision Manager
instances based on the declared schedule. The schedule must not be
nullpublic void release(boolean terminateServices)
Cybernode
release in interface CybernodeterminateServices - If this parameter is true, all
services which are being hosted by the Cybernode will be terminated as
a result of this method invocationpublic Integer getServiceLimit()
CybernodeImplMBean
getServiceLimit in interface CybernodeImplMBeanpublic void setServiceLimit(Integer limit)
CybernodeImplMBean
setServiceLimit in interface CybernodeImplMBeanlimit - The upper limit of servicespublic Integer getServiceCount()
CybernodeImplMBean
getServiceCount in interface CybernodeImplMBeanpublic boolean getPersistentProvisioning()
CybernodeImplMBean
getPersistentProvisioning in interface CybernodeImplMBean
public void setPersistentProvisioning(boolean provisionEnabled)
throws IOException
CybernodeImplMBean
setPersistentProvisioning in interface CybernodeImplMBeanprovisionEnabled - If the Cybernode supports persistent
provisioning of qualitative capabilities
IOExceptionpublic double getUtilization()
CybernodeImplMBean
getUtilization in interface CybernodeImplMBean
|
Copyright © Rio Project. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||