org.jini.rio.core.provision
Interface ServiceBeanInstantiator

All Known Subinterfaces:
Cybernode
All Known Implementing Classes:
CybernodeImpl

public interface ServiceBeanInstantiator

The ServiceBeanInstantiator specifies the semantics for a service that provides instantiation and update support for services described by a ServiceElement object. The ServiceBeanInstantiator additionally provides semantics allowing clients to obtain infomration about services that have been started and are currently running using the ServiceStatement and ServiceRecord


Method Summary
 Uuid getInstantiatorUuid()
          Get the Uuid which uniquely identifies the ServiceBeanInstantiator
 String getName()
          Get a name for the ServiceBeanInstantiator
 ServiceBeanInstance[] getServiceBeanInstances(ServiceElement element)
          Get all ServiceBeanInstance objects for a ServiceElement
 ServiceRecord[] getServiceRecords(int filter)
          This method returns an array of ServiceRecord objects which contain information about the service instances this ServiceBeanInstantiator has instantiated.
 ServiceStatement[] getServiceStatements()
          This method returns an array of ServiceStatement objects which contain information about the ServiceBean instances this ServiceBeanInstantiator has instantiated.
 ServiceBeanInstance instantiate(ServiceProvisionEvent event)
          This method is invoked as a result of event registration to ProvisionManager instances.
 void update(ServiceElement[] sElements, OperationalStringManager opStringMgr)
          Invoked to update instantiated ServiceBean instances of changes in their ServiceElement objects and OperationalStringManager references.
 

Method Detail

instantiate

ServiceBeanInstance instantiate(ServiceProvisionEvent event)
                                throws JSBInstantiationException,
                                       UnknownEventException,
                                       RemoteException
This method is invoked as a result of event registration to ProvisionManager instances. The ServiceBeanInstantiator will register for ServiceProvisionEvent notifications.

Parameters:
event - - The ServiceProvisionEvent
Returns:
ServiceBeanInstance- A ServiceBeanInstance object
Throws:
JSBInstantiationException - if there are problems loading or instantiating the ServiceBean
UnknownEventException - if it does not recognize the Event ID
RemoteException - if communication errors occur

update

void update(ServiceElement[] sElements,
            OperationalStringManager opStringMgr)
            throws RemoteException
Invoked to update instantiated ServiceBean instances of changes in their ServiceElement 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 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:

  1. Additions/removals or changes to declared SLA instances
  2. Additions/removals or changes to declared Association instances
  3. Additions/removals to declared parameters

Parameters:
sElements - Array of ServiceElement instances to update
opStringMgr - The OperationalStringManager which is performing the update
Throws:
RemoteException

getServiceStatements

ServiceStatement[] getServiceStatements()
                                        throws RemoteException
This method returns an array of ServiceStatement objects which contain information about the ServiceBean instances this ServiceBeanInstantiator has instantiated.

Returns:
An array of ServiceStatement objects. The array will be empty if no ServiceStatement instances are found
Throws:
RemoteException

getServiceRecords

ServiceRecord[] getServiceRecords(int filter)
                                  throws RemoteException
This method returns an array of ServiceRecord objects which contain information about the service instances this ServiceBeanInstantiator has instantiated.

Parameters:
filter - 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.
Returns:
An array of ServiceRecord objects. The array will be empty if no ServiceRecord instances are found which match the filter
Throws:
RemoteException

getServiceBeanInstances

ServiceBeanInstance[] getServiceBeanInstances(ServiceElement element)
                                              throws RemoteException
Get all ServiceBeanInstance objects for a ServiceElement

Parameters:
element - The ServiceElement to obtain ServiceBeanInstance objects for.
Returns:
An array of ServiceBeanInstance objects. If the 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 returned
Throws:
RemoteException

getName

String getName()
               throws RemoteException
Get a name for the ServiceBeanInstantiator

Returns:
A human readable name for the ServiceBeanInstantiator
Throws:
RemoteException

getInstantiatorUuid

Uuid getInstantiatorUuid()
                         throws RemoteException
Get the Uuid which uniquely identifies the ServiceBeanInstantiator

Throws:
RemoteException


Copyright (c) 2005 Sun Microsystems, Inc.
Copyright (c) 2006 GigaSpaces Technologies, Inc.
All Rights Reserved.