Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Project Rio
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jini.rio.core.jsb
Interface ServiceBean

All Known Implementing Classes:
  BeanAdapter, JMXConnectorService, ServiceBeanAdapter

    public interface ServiceBean

The ServiceBean interface specifies the semantics that a Jini Service Bean must adhere to in order to be instantiated, initialized, started, advertised, unadvertised, stopped and destroyed.

Method Summary
`void` | `advertise()` The advertise method provides the capability for a ServiceBean to advertise itself on the network providing access to all clients.
`void` | `destroy(boolean force)` The destroy method is used to destroy an instance of a ServiceBean.
`void` | `initialize(ServiceBeanContext context)` The initialize method is invoked by the start method to initialize the ServiceBean. this method is called only once during the lifecycle of a ServiceBean
`Object` | `start(ServiceBeanContext context)` The start method provides the capability for a ServiceBean to initialize itself and make it 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.

Method Detail

### start

    Object start(ServiceBeanContext context)
                 throws Exception

  The start method provides the capability for a ServiceBean to initialize itself and make it ready to accept inbound communications, returning an Object which can be used to communicate with the ServiceBean. It is the responsibility of the ServiceBean to initiate appropriate startup logic. 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

  Parameters:
    `context` - The ServiceBeanContext containing ServiceBean initialization attributes
  Returns:
    An Object that can be used to communicate to the ServiceBean
  Throws:
    `Exception` - If any errors or unexpected conditions occur

### initialize

    void initialize(ServiceBeanContext context)
                    throws Exception

  The initialize method is invoked by the start method to initialize the ServiceBean. this method is called only once during the lifecycle of a ServiceBean

  Parameters:
    `context` - The ServiceBeanContext containing ServiceBean initialization attributes
  Throws:
    `Exception` - If any errors or unexpected conditions occur

### advertise

    void advertise()
                   throws IOException

  The advertise method provides the capability for 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

  Throws:
    `IOException` - If errors occur access underlying communication mechanisms

### unadvertise

    void unadvertise()
                     throws IOException

  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

  Throws:
    `IOException` - If errors occur access underlying communication mechanisms

### stop

    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

  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

### destroy

    void destroy(boolean force)

  The destroy method is used to destroy an instance of a ServiceBean. Once this method is invoked the ServiceBean should provide appropriate termination logic including unadvertise() and stop() method invocations. Note: The implementer of this method should not invoke System.exit() during the processing of this method

  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

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Project Rio
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © Project Rio.