Rio Project 4.2 API Documentation



org.rioproject.resources.servicecore
Class ServiceAdminImpl

java.lang.Object
  extended by org.rioproject.resources.servicecore.ServiceAdminImpl
All Implemented Interfaces:
DestroyAdmin, Remote, JoinAdmin, ServiceBeanAdmin, ServiceBeanControl, ServiceAdmin
Direct Known Subclasses:
CybernodeAdminImpl, ProvisionMonitorAdminImpl

public class ServiceAdminImpl
extends Object
implements ServiceAdmin

The ServiceAdminImpl class implements the ServiceAdmin interface providing administrative support for ServiceProducer implementations.

Author:
Dennis Reedy

Field Summary
protected  ServiceAdminProxy adminProxy
          The ServiceAdminProxy
protected  Exporter exporter
          The Exporter for the ServiceAdmin
 
Constructor Summary
ServiceAdminImpl(ServiceBeanAdapter service, Exporter exporter)
          Create a ServiceAdmin Impl
ServiceAdminImpl(ServiceBeanAdapter service, Exporter exporter, SnapshotHandler snapshotHandler)
          Create a ServiceAdmin Impl
 
Method Summary
 void addLookupAttributes(Entry[] attrs)
           
 void addLookupGroups(String[] groups)
           
 void addLookupLocators(LookupLocator[] locators)
           
 void advertise()
          The advertise method informs a ServiceBean to advertise itself on the network providing access to all clients.
 void destroy()
          This method terminates the service
 ServiceRegistrar[] getJoinSet()
          Returns an array of instances of ServiceRegistrar, each corresponding to a lookup service with which the service is currently registered (joined)
 Entry[] getLookupAttributes()
           
 String[] getLookupGroups()
           
 LookupLocator[] getLookupLocators()
           
 ServiceAdmin getServiceAdmin()
          Get the object to communicate with the ServiceAdminImpl
 Uuid getServiceBeanInstantiatorUuid()
          Get the Uuid of the ServiceBeanInstantiator the ServiceBean is being hosted by
 ServiceElement getServiceElement()
          Get the ServiceElement for the ServiceBean
 long getUpTime()
          How long the service has been running
 void modifyLookupAttributes(Entry[] attrSetTemplates, Entry[] attrSets)
           
 void removeLookupGroups(String[] groups)
           
 void removeLookupLocators(LookupLocator[] locators)
           
 void setLookupGroups(String[] groups)
           
 void setLookupLocators(LookupLocator[] locators)
           
 void setServiceBeanContext(ServiceBeanContext context)
          Set the ServiceBeanContext
 void setServiceElement(ServiceElement sElem)
          Set the ServiceElement for the ServiceBean
 Object start()
          The start method provides informs a ServiceBean to make itself ready to accept inbound communications, returning an Object which can be used to communicate with the ServiceBean.
 void stop(boolean force)
          The stop method informs the ServiceBean to unexport itself from any underlying distributed Object communication mechanisms making it incapable of accepting inbound communications.
 void unadvertise()
          The unadvertise method informs the ServiceBean to cancel all advertisements (registrations, etc...) it has made on the network.
 void unexport(boolean force)
          Unexport the ServiceAdmin
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

exporter

protected Exporter exporter
The Exporter for the ServiceAdmin


adminProxy

protected ServiceAdminProxy adminProxy
The ServiceAdminProxy

Constructor Detail

ServiceAdminImpl

public ServiceAdminImpl(ServiceBeanAdapter service,
                        Exporter exporter)
Create a ServiceAdmin Impl

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

ServiceAdminImpl

public ServiceAdminImpl(ServiceBeanAdapter service,
                        Exporter exporter,
                        SnapshotHandler snapshotHandler)
Create a ServiceAdmin Impl

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

getJoinSet

public ServiceRegistrar[] getJoinSet()
Description copied from interface: ServiceAdmin
Returns an array of instances of ServiceRegistrar, each corresponding to a lookup service with which the service is currently registered (joined)

Specified by:
getJoinSet in interface ServiceAdmin
Returns:
An array of ServiceRegistrar instances
See Also:
ServiceAdmin.getJoinSet()

getServiceAdmin

public ServiceAdmin getServiceAdmin()
                             throws RemoteException
Get the object to communicate with the ServiceAdminImpl

Returns:
The ServiceAdmin
Throws:
RemoteException - if an communication errors occur

unexport

public void unexport(boolean force)
Unexport the ServiceAdmin

Parameters:
force - - If true forcibly unexport

destroy

public void destroy()
This method terminates the service

Specified by:
destroy in interface DestroyAdmin

getServiceElement

public ServiceElement getServiceElement()
Description copied from interface: ServiceBeanAdmin
Get the ServiceElement for the ServiceBean

Specified by:
getServiceElement in interface ServiceBeanAdmin
Returns:
The ServiceElement
See Also:
ServiceBeanAdmin.getServiceElement()

setServiceElement

public void setServiceElement(ServiceElement sElem)
Description copied from interface: ServiceBeanAdmin
Set the ServiceElement for the ServiceBean

Specified by:
setServiceElement in interface ServiceBeanAdmin
Parameters:
sElem - The ServiceElement
See Also:
ServiceBeanAdmin.setServiceElement(org.rioproject.core.ServiceElement)

getUpTime

public long getUpTime()
               throws RemoteException
Description copied from interface: ServiceBeanAdmin
How long the service has been running

Specified by:
getUpTime in interface ServiceBeanAdmin
Returns:
The amount of time (in milliseconds) the servie has been "up" (running)
Throws:
RemoteException - If communication errors occur
See Also:
ServiceBeanAdmin.getUpTime()

getServiceBeanInstantiatorUuid

public Uuid getServiceBeanInstantiatorUuid()
                                    throws RemoteException
Description copied from interface: ServiceBeanAdmin
Get the Uuid of the ServiceBeanInstantiator the ServiceBean is being hosted by

Specified by:
getServiceBeanInstantiatorUuid in interface ServiceBeanAdmin
Returns:
The Uuid of the ServiceBeanInstantiator the ServiceBean is being hosted by
Throws:
RemoteException - If communication errors occur
See Also:
ServiceBeanAdmin.getServiceBeanInstantiatorUuid()

start

public Object start()
             throws JSBControlException
Description copied from interface: ServiceBeanControl
The start method provides informs a ServiceBean to make itself ready to accept inbound communications, returning an Object which can be used to communicate with the ServiceBean. If the ServiceBean has started itself, subsequent invocations of this method will not re-start the ServiceBean, but return the Object created during the initial start

Specified by:
start in interface ServiceBeanControl
Returns:
An Object that can be used to communicate to the ServiceBean
Throws:
JSBControlException - If any errors occur
See Also:
ServiceBeanControl.start()

stop

public void stop(boolean force)
          throws JSBControlException
Description copied from interface: ServiceBeanControl
The stop method informs the ServiceBean to unexport itself from any underlying distributed Object communication mechanisms making it incapable of accepting inbound communications. This call should be used with great care as the ServiceBean will not be able to respond to any remote invocations.

Specified by:
stop in interface ServiceBeanControl
Parameters:
force - 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 calls
Throws:
JSBControlException - If any errors occur
See Also:
ServiceBeanControl.stop(boolean)

advertise

public void advertise()
               throws JSBControlException
Description copied from interface: ServiceBeanControl
The advertise method informs a ServiceBean to advertise itself on the network providing access to all clients. The ServiceBean must be ready to accept incoming communications (has been started). If the ServiceBean has advertised itself, subsequent invocations of this method will not re-advertise the ServiceBean

Specified by:
advertise in interface ServiceBeanControl
Throws:
JSBControlException - If any errors occur
See Also:
ServiceBeanControl.advertise()

unadvertise

public void unadvertise()
                 throws JSBControlException
Description copied from interface: ServiceBeanControl
The unadvertise method informs the ServiceBean to cancel all advertisements (registrations, etc...) it has made on the network. The ServiceBean must still be available to accept incoming communications. If the ServiceBean has not advertised itself, this method has no defined behavior

Specified by:
unadvertise in interface ServiceBeanControl
Throws:
JSBControlException - If any errors occur
See Also:
ServiceBeanControl.unadvertise()

setServiceBeanContext

public void setServiceBeanContext(ServiceBeanContext context)
Set the ServiceBeanContext

Parameters:
context - The ServiceBeanContext

getLookupAttributes

public Entry[] getLookupAttributes()
Specified by:
getLookupAttributes in interface JoinAdmin

addLookupAttributes

public void addLookupAttributes(Entry[] attrs)
Specified by:
addLookupAttributes in interface JoinAdmin

modifyLookupAttributes

public void modifyLookupAttributes(Entry[] attrSetTemplates,
                                   Entry[] attrSets)
Specified by:
modifyLookupAttributes in interface JoinAdmin

getLookupGroups

public String[] getLookupGroups()
Specified by:
getLookupGroups in interface JoinAdmin

addLookupGroups

public void addLookupGroups(String[] groups)
Specified by:
addLookupGroups in interface JoinAdmin

removeLookupGroups

public void removeLookupGroups(String[] groups)
Specified by:
removeLookupGroups in interface JoinAdmin

setLookupGroups

public void setLookupGroups(String[] groups)
Specified by:
setLookupGroups in interface JoinAdmin

getLookupLocators

public LookupLocator[] getLookupLocators()
Specified by:
getLookupLocators in interface JoinAdmin

addLookupLocators

public void addLookupLocators(LookupLocator[] locators)
Specified by:
addLookupLocators in interface JoinAdmin

removeLookupLocators

public void removeLookupLocators(LookupLocator[] locators)
Specified by:
removeLookupLocators in interface JoinAdmin

setLookupLocators

public void setLookupLocators(LookupLocator[] locators)
Specified by:
setLookupLocators in interface JoinAdmin

Copyright © Rio Project.

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