com.sun.grid.jgdi.jni

## Class EventClientImpl

- java.lang.Object
- - com.sun.grid.jgdi.jni.EventClientImpl

- All Implemented Interfaces:
    EventClient

      public class EventClientImpl
      extends java.lang.Object
      implements EventClient

  event client implementation

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `EventClientImpl(java.lang.String url, int regId)` Creates a new instance of EventClientImpl

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addEventListener(EventListener lis)` Add an event listener to this event client
    `void` | `close()` Close this event client
    `static void` | `closeAll()` Close all instances of the EventClientImpl
    `void` | `commit()` Commit the changed subscription
    `protected void` | `fireEventOccured(Event evt)`
    `int` | `getFlush(EventTypeEnum type)` Get the flush time of a event
    `int` | `getId()` Get the id of this event client
    `java.util.Set<EventTypeEnum>` | `getSubscription()` Get the current subscriptions
    `boolean` | `isClosed()` Determine if the event client has been closed
    `boolean` | `isRunning()` Determine if the event client is running
    `void` | `removeEventListener(EventListener lis)` Remove an event listener from this event client
    `static void` | `resetShutdown()`
    `void` | `setFlush(EventTypeEnum type, int time)` Set the flush time for subscribed event
    `void` | `setFlush(java.util.Map<EventTypeEnum,java.lang.Integer> map)` Set the flush time for subscribed events
    `void` | `setSubscription(java.util.Set<EventTypeEnum> types)` Set the subscription of this event client
    `void` | `subscribe(EventTypeEnum type)` Subscribe an additional event.
    `void` | `subscribe(java.util.Set<EventTypeEnum> types)` Add a set of events to the subscription
    `void` | `subscribeAll()` Subscribe all events for this event client
    `void` | `unsubscribe(EventTypeEnum type)` Remove a event from the subscription
    `void` | `unsubscribe(java.util.Set<EventTypeEnum> types)` Remove a set of events from the subscription
    `void` | `unsubscribeAll()` Unsubscribe all events for this event client

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### EventClientImpl

          public EventClientImpl(java.lang.String url,
                                 int regId)

      Creates a new instance of EventClientImpl
      Parameters:
        `url` - JGDI connection url in the form `bootstrap://<SGE_ROOT>@<SGE_CELL>:<SGE_QMASTER_PORT>`
        `regId` - Registration id for the event client (0 => qmaster assignes a event client id dynamically)

  - ### Method Detail

    - #### getId

          public int getId()

      Get the id of this event client
      Specified by:
        `getId` in interface `EventClient`
      Returns:
        the event client id

    - #### resetShutdown

          public static void resetShutdown()

    - #### closeAll

          public static void closeAll()

      Close all instances of the EventClientImpl

    - #### close

          public void close()

      Close this event client
      Specified by:
        `close` in interface `EventClient`

    - #### isClosed

          public boolean isClosed()

      Determine if the event client has been closed
      Specified by:
        `isClosed` in interface `EventClient`
      Returns:
        `true` if the event client has been closed

    - #### isRunning

          public boolean isRunning()

      Determine if the event client is running
      Specified by:
        `isRunning` in interface `EventClient`
      Returns:
        `true` if the event client is running

    - #### fireEventOccured

          protected void fireEventOccured(Event evt)

    - #### addEventListener

          public void addEventListener(EventListener lis)

      Add an event listener to this event client
      Specified by:
        `addEventListener` in interface `EventClient`
      Parameters:
        `lis` - the event listener

    - #### removeEventListener

          public void removeEventListener(EventListener lis)

      Remove an event listener from this event client
      Specified by:
        `removeEventListener` in interface `EventClient`
      Parameters:
        `lis` - the event listener

    - #### commit

          public void commit()
                      throws JGDIException

      Commit the changed subscription
      Specified by:
        `commit` in interface `EventClient`
      Throws:
        `JGDIException`

    - #### subscribe

          public void subscribe(EventTypeEnum type)

      Subscribe an additional event.
      Specified by:
        `subscribe` in interface `EventClient`
      Parameters:
        `type` - the event type

    - #### subscribe

          public void subscribe(java.util.Set<EventTypeEnum> types)

      Add a set of events to the subscription
      Specified by:
        `subscribe` in interface `EventClient`
      Parameters:
        `types` - set of event types

    - #### unsubscribe

          public void unsubscribe(EventTypeEnum type)

      Remove a event from the subscription
      Specified by:
        `unsubscribe` in interface `EventClient`
      Parameters:
        `type` - the event type

    - #### unsubscribe

          public void unsubscribe(java.util.Set<EventTypeEnum> types)

      Remove a set of events from the subscription
      Specified by:
        `unsubscribe` in interface `EventClient`
      Parameters:
        `types` - the set of events

    - #### subscribeAll

          public void subscribeAll()

      Subscribe all events for this event client
      Specified by:
        `subscribeAll` in interface `EventClient`

    - #### unsubscribeAll

          public void unsubscribeAll()

      Unsubscribe all events for this event client
      Specified by:
        `unsubscribeAll` in interface `EventClient`

    - #### setSubscription

          public void setSubscription(java.util.Set<EventTypeEnum> types)

      Set the subscription of this event client
      Specified by:
        `setSubscription` in interface `EventClient`
      Parameters:
        `types` - set of event types

    - #### getSubscription

          public java.util.Set<EventTypeEnum> getSubscription()

      Get the current subscriptions
      Specified by:
        `getSubscription` in interface `EventClient`
      Returns:
        the current subscription

    - #### setFlush

          public void setFlush(java.util.Map<EventTypeEnum,java.lang.Integer> map)

      Set the flush time for subscribed events
      Specified by:
        `setFlush` in interface `EventClient`
      Parameters:
        `map` - map with event type as key and flush time as value

    - #### setFlush

          public void setFlush(EventTypeEnum type,
                               int time)

      Set the flush time for subscribed event
      Specified by:
        `setFlush` in interface `EventClient`
      Parameters:
        `type` - the event type
        `time` - the flush time

    - #### getFlush

          public int getFlush(EventTypeEnum type)

      Get the flush time of a event
      Specified by:
        `getFlush` in interface `EventClient`
      Parameters:
        `type` - the event type
      Returns:
        the flush time

Copyright © 2007 Sun Microsystems, Inc. All rights reserved.