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.event
Class PooledEventConsumer

    java.lang.Object
      org.jini.rio.event.BasicEventConsumer
          org.jini.rio.event.DynamicEventConsumer
              org.jini.rio.event.PooledEventConsumer

All Implemented Interfaces:
  Remote, EventListener, RemoteEventListener, ServerProxyTrust, EventConsumer, RemoteServiceEventListener

    public class PooledEventConsumer

extends DynamicEventConsumer
implements RemoteServiceEventListener

Provides the capability to use a Thread Pool to simultaneously handle multiple events.

Field Summary
`protected Vector<RemoteServiceEventListener>` | `subscribers`

Fields inherited from class org.jini.rio.event.BasicEventConsumer
`DEFAULT_LEASE_DURATION, edTemplate, ektime, eventRegistrationTable, eventSubscribers, handback, leaseDuration, leaseTable, received, RESPONSE_WATCH, responseWatch, sktime, watchRegistry`

Constructor Summary
`PooledEventConsumer(EventDescriptor edTemplate)` Create a PooledEventConsumer with an EventDescriptor
`PooledEventConsumer(EventDescriptor edTemplate, Configuration config)` Create a PooledEventConsumer with an EventDescriptor
`PooledEventConsumer(EventDescriptor edTemplate, RemoteServiceEventListener listener)` Create a PooledEventConsumer with an EventDescriptor and a RemoteServiceEventListener
`PooledEventConsumer(EventDescriptor edTemplate, RemoteServiceEventListener listener, Configuration config)` Create a PooledEventConsumer with an EventDescriptor and a RemoteServiceEventListener
`PooledEventConsumer(EventDescriptor edTemplate, RemoteServiceEventListener listener, MarshalledObject handback)` Create a PooledEventConsumer with an EventDescriptor a RemoteServiceEventListener and a MarshalledObject handback
`PooledEventConsumer(EventDescriptor edTemplate, RemoteServiceEventListener listener, MarshalledObject handback, DiscoveryManagement dMgr)` Create a PooledEventConsumer with an EventDescriptor a RemoteServiceEventListener a MarshalledObject handback and a specified lease duration to be used for all event registrations along with a reference to a DiscoveryManagement
`PooledEventConsumer(EventDescriptor edTemplate, RemoteServiceEventListener listener, MarshalledObject handback, DiscoveryManagement dMgr, String identifier, Configuration config)` Create a PooledEventConsumer with an EventDescriptor a RemoteServiceEventListener a MarshalledObject handback and a specified lease duration to be used for all event registrations along with a reference to a DiscoveryManagement
`PooledEventConsumer(EventDescriptor edTemplate, RemoteServiceEventListener listener, String identifier, Configuration config)` Create a PooledEventConsumer with an EventDescriptor and a RemoteServiceEventListener
`PooledEventConsumer(EventDescriptor edTemplate, String identifier, Configuration config)` Create a PooledEventConsumer with an EventDescriptor

Method Summary
`boolean` | `deregister(RemoteServiceEventListener listener)` De-registers a registered RemoteServiceEventListener from this and destroys the response time watch if it was created
`String` | `getIdentifier()`
`int` | `getMaxThreads()` Getter for property maxThreads.
`int` | `getMinThreads()` Getter for property minThreads.
`ThreadPool` | `getPool()` Getter for property pool.
`void` | `notify(RemoteServiceEvent event)` The notify method is invoked on a `RemoteServiceEventListener` for `RemoteServiceEvent` s that the listener has registered interest on.
`boolean` | `register(RemoteServiceEventListener listener, MarshalledObject handback)` Override BasicEventHandler#register to provide the ability if we've discovered Eventproducer instances that match we should register with them
`void` | `setIdentifier(String identifier)`
`void` | `setMaxThreads(int maxThreads)` Setter for property maxThreads.
`void` | `setMinThreads(int minThreads)` Setter for property minThreads.
`void` | `setPool(ThreadPool pool)` Setter for property pool.

Methods inherited from class org.jini.rio.event.DynamicEventConsumer
`getEventProducers, terminate`

Methods inherited from class org.jini.rio.event.BasicEventConsumer
`createWatch, deregister, deregister, destroyWatch, finalize, getDescriptor, getEventRegistrationSource, getListeners, getProxyVerifier, getWatch, notify, printStats, register, register`

Methods inherited from class java.lang.Object
`clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### subscribers

    protected Vector<RemoteServiceEventListener> subscribers

Constructor Detail

### PooledEventConsumer

    public PooledEventConsumer(EventDescriptor edTemplate)
                        throws Exception

  Create a PooledEventConsumer with an EventDescriptor

  Throws:
    `Exception`

### PooledEventConsumer

    public PooledEventConsumer(EventDescriptor edTemplate,
                               Configuration config)
                        throws Exception

  Create a PooledEventConsumer with an EventDescriptor

  Throws:
    `Exception`

### PooledEventConsumer

    public PooledEventConsumer(EventDescriptor edTemplate,
                               String identifier,
                               Configuration config)
                        throws Exception

  Create a PooledEventConsumer with an EventDescriptor

  Throws:
    `Exception`

### PooledEventConsumer

    public PooledEventConsumer(EventDescriptor edTemplate,
                               RemoteServiceEventListener listener)
                        throws Exception

  Create a PooledEventConsumer with an EventDescriptor and a RemoteServiceEventListener

  Throws:
    `Exception`

### PooledEventConsumer

    public PooledEventConsumer(EventDescriptor edTemplate,
                               RemoteServiceEventListener listener,
                               Configuration config)
                        throws Exception

  Create a PooledEventConsumer with an EventDescriptor and a RemoteServiceEventListener

  Throws:
    `Exception`

### PooledEventConsumer

    public PooledEventConsumer(EventDescriptor edTemplate,
                               RemoteServiceEventListener listener,
                               String identifier,
                               Configuration config)
                        throws Exception

  Create a PooledEventConsumer with an EventDescriptor and a RemoteServiceEventListener

  Throws:
    `Exception`

### PooledEventConsumer

    public PooledEventConsumer(EventDescriptor edTemplate,
                               RemoteServiceEventListener listener,
                               MarshalledObject handback)
                        throws Exception

  Create a PooledEventConsumer with an EventDescriptor a RemoteServiceEventListener and a MarshalledObject handback

  Throws:
    `Exception`

### PooledEventConsumer

    public PooledEventConsumer(EventDescriptor edTemplate,
                               RemoteServiceEventListener listener,
                               MarshalledObject handback,
                               DiscoveryManagement dMgr)
                        throws Exception

  Create a PooledEventConsumer with an EventDescriptor a RemoteServiceEventListener a MarshalledObject handback and a specified lease duration to be used for all event registrations along with a reference to a DiscoveryManagement

  Throws:
    `Exception`

### PooledEventConsumer

    public PooledEventConsumer(EventDescriptor edTemplate,
                               RemoteServiceEventListener listener,
                               MarshalledObject handback,
                               DiscoveryManagement dMgr,
                               String identifier,
                               Configuration config)
                        throws Exception

  Create a PooledEventConsumer with an EventDescriptor a RemoteServiceEventListener a MarshalledObject handback and a specified lease duration to be used for all event registrations along with a reference to a DiscoveryManagement

  Throws:
    `Exception`

Method Detail

### notify

    public void notify(RemoteServiceEvent event)

  The notify method is invoked on a `RemoteServiceEventListener` for `RemoteServiceEvent` s that the listener has registered interest on.

  The notification of `RemoteServiceEvent` objects is done within a JVM, i.e. remote invocation semantics are not implied by the use of this interface.

  Specified by:
    `notify` in interface `RemoteServiceEventListener`
  Parameters:
    `event` - A `RemoteServiceEvent` object

### register

    public boolean register(RemoteServiceEventListener listener,
                            MarshalledObject handback)

  Override BasicEventHandler#register to provide the ability if we've discovered Eventproducer instances that match we should register with them

  Specified by:
    `register` in interface `EventConsumer`
  Overrides:
    `register` in class `DynamicEventConsumer`
  Parameters:
    `listener` - The RemoteServiceEventListener
    `handback` - The MarshalledObject to be used as a handback
  Returns:
    true if the RemoteServiceEventListener has been added

### deregister

    public boolean deregister(RemoteServiceEventListener listener)

  De-registers a registered RemoteServiceEventListener from this and destroys the response time watch if it was created

  Specified by:
    `deregister` in interface `EventConsumer`
  Overrides:
    `deregister` in class `BasicEventConsumer`
  Parameters:
    `listener` - The RemoteServiceEventListener
  Returns:
    true if the RemoteServiceEventListener was removed

### getPool

    public ThreadPool getPool()

  Getter for property pool.

  Returns:
    Value of property pool.

### setPool

    public void setPool(ThreadPool pool)

  Setter for property pool.

  Parameters:
    `pool` - New value of property pool.

### getMinThreads

    public int getMinThreads()

  Getter for property minThreads.

  Returns:
    Value of property minThreads.

### setMinThreads

    public void setMinThreads(int minThreads)
                       throws Exception

  Setter for property minThreads.

  Parameters:
    `minThreads` - New value of property minThreads.
  Throws:
    `Exception`

### getMaxThreads

    public int getMaxThreads()

  Getter for property maxThreads.

  Returns:
    Value of property maxThreads.

### setMaxThreads

    public void setMaxThreads(int maxThreads)

  Setter for property maxThreads.

  Parameters:
    `maxThreads` - New value of property maxThreads.

### getIdentifier

    public String getIdentifier()

### setIdentifier

    public void setIdentifier(String identifier)

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.