ZeventManager (Hyperic HQ Plugin API)
Keywords: org.hyperic.hq.zevents.ZeventManager class

Overview | Package | Class | Tree | Deprecated | Index | Help
| Hyperic HQ Plugin API v. 4.4.0.2
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.hyperic.hq.zevents
Class ZeventManager

    java.lang.Object
      org.hyperic.hq.zevents.ZeventManager

All Implemented Interfaces:
  ZeventEnqueuer

    public class ZeventManager

extends java.lang.Object
implements ZeventEnqueuer

The Zevent subsystem is an event system for fast, non-reliable transmission of events. Important data should not be transmitted on this bus, since it is not persisted, and there is never any guarantee of receipt. This manager provides no transactional guarantees, so the caller must rollback additions of listeners if the transaction fails.

Method Summary
`boolean` | `addBufferedGlobalListener(ZeventListener listener)`
`ZeventListener` | `addBufferedListener(java.lang.Class eventClass, ZeventListener listener)`
`ZeventListener` | `addBufferedListener(java.util.Set eventClasses, ZeventListener listener)` Add a buffered listener for event types.
`boolean` | `addGlobalListener(ZeventListener listener)` Add an event listener which is called for every event type which comes through the queue.
`boolean` | `addListener(java.lang.Class eventClass, ZeventListener listener)` Add a listener for a specific type of event.
`void` | `enqueueEvent(Zevent event)` Enqueues an `Zevent` for processing
`void` | `enqueueEventAfterCommit(Zevent event)`
`void` | `enqueueEvents(java.util.List events)` Enqueue events onto the event queue.
`void` | `enqueueEventsAfterCommit(java.util.List inEvents)` Enqueue events if the current running transaction successfully commits.
`static ZeventManager` | `getInstance()`
`long` | `getMaxTimeInQueue()`
`long` | `getQueueSize()`
`long` | `getZeventsProcessed()`
`boolean` | `registerEventClass(java.lang.Class eventClass)` Register an event class.
`boolean` | `removeGlobalListener(ZeventListener listener)` Remove a global event listener
`boolean` | `removeListener(java.lang.Class eventClass, ZeventListener listener)` Remove a specific event type listener.
`void` | `shutdown()`
`boolean` | `unregisterEventClass(java.lang.Class eventClass)` Unregister an event class
`void` | `waitUntilNoEvents()` Wait until the queue is empty.

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

Method Detail

### getQueueSize

    public long getQueueSize()

### shutdown

    public void shutdown()
                  throws java.lang.InterruptedException

  Throws:
    `java.lang.InterruptedException`

### getMaxTimeInQueue

    public long getMaxTimeInQueue()

### getZeventsProcessed

    public long getZeventsProcessed()

### registerEventClass

    public boolean registerEventClass(java.lang.Class eventClass)

  Register an event class. These classes must be registered prior to attempting to listen to individual event types.

  Parameters:
    `eventClass` - a subclass of `Zevent`
  Returns:
    false if the eventClass was already registered

### unregisterEventClass

    public boolean unregisterEventClass(java.lang.Class eventClass)

  Unregister an event class

  Parameters:
    `eventClass` - subclass of `Zevent`
  Returns:
    false if the eventClass was not registered

### addGlobalListener

    public boolean addGlobalListener(ZeventListener listener)

  Add an event listener which is called for every event type which comes through the queue.

  Returns:
    false if the listener was already listening

### addBufferedGlobalListener

    public boolean addBufferedGlobalListener(ZeventListener listener)

### removeGlobalListener

    public boolean removeGlobalListener(ZeventListener listener)

  Remove a global event listener

  Returns:
    false if the listener was not listening

### addBufferedListener

    public ZeventListener addBufferedListener(java.util.Set eventClasses,
                                              ZeventListener listener)

  Add a buffered listener for event types. A buffered listener is one which implements its own private queue and thread for processing entries. If the actions performed by your listener take a while to complete, then a buffered listener is a good candidate for use, since it means that it will not be holding up the regular Zevent queue processor.

  Parameters:
    `eventClasses` - `Class`es which subclass `Zevent` to listen for
    `listener` - Listener to invoke with events
  Returns:
    the buffered listener. This return value must be used when trying to remove the listener later on.

### addBufferedListener

    public ZeventListener addBufferedListener(java.lang.Class eventClass,
                                              ZeventListener listener)

### addListener

    public boolean addListener(java.lang.Class eventClass,
                               ZeventListener listener)

  Add a listener for a specific type of event.

  Parameters:
    `eventClass` - A subclass of `Zevent`
  Returns:
    false if the listener was already registered

### removeListener

    public boolean removeListener(java.lang.Class eventClass,
                                  ZeventListener listener)

  Remove a specific event type listener.

  See Also:
    `addListener(Class, ZeventListener)`

### enqueueEvents

    public void enqueueEvents(java.util.List events)
                       throws java.lang.InterruptedException

  Enqueue events onto the event queue. This method will block if the thread is full.

  Specified by:
    `enqueueEvents` in interface `ZeventEnqueuer`
  Parameters:
    `events` - List of `Zevent`s
  Throws:
    `java.lang.InterruptedException` - if the queue was full and the thread was interrupted

### enqueueEventAfterCommit

    public void enqueueEventAfterCommit(Zevent event)

### enqueueEventsAfterCommit

    public void enqueueEventsAfterCommit(java.util.List inEvents)

  Enqueue events if the current running transaction successfully commits.

  See Also:
    `enqueueEvents(List)`

### enqueueEvent

    public void enqueueEvent(Zevent event)
                      throws java.lang.InterruptedException

  Description copied from interface: `ZeventEnqueuer`
  Enqueues an `Zevent` for processing

  Specified by:
    `enqueueEvent` in interface `ZeventEnqueuer`
  Parameters:
    `event` - The `Zevent` to enqueue
  Throws:
    `java.lang.InterruptedException` - If interrupted while enqueueing event

### waitUntilNoEvents

    public void waitUntilNoEvents()
                           throws java.lang.InterruptedException

  Wait until the queue is empty. This is a non-performant function, so please only use it in test suites.

  Throws:
    `java.lang.InterruptedException`

### getInstance

    public static ZeventManager getInstance()

Overview | Package | Class | Tree | Deprecated | Index | Help
| Hyperic HQ Plugin API v. 4.4.0.2
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004-2006 Hyperic, Inc. support@hyperic.net, All Rights Reserved.