com.openexchange.mail.event
Class EventPool

java.lang.Object
  extended by com.openexchange.mail.event.EventPool
All Implemented Interfaces:
java.lang.Runnable

public final class EventPool
extends java.lang.Object
implements java.lang.Runnable

EventPool - The mail event pool.

Author:
Thorben Betten

Method Summary
 void clear()
          Clears the event pool.
static EventPool getInstance()
          Gets the event pool instance.
static void initInstance()
          Initializes this event pool.
 void put(PooledEvent pooledEvent)
          Puts given pooled event into this pool.
static void releaseInstance()
          Releases this event pool.
 void removeByUser(int userId, int contextId)
          Removes all pooled events from this pool associated with given user.
 void run()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

initInstance

public static void initInstance()
Initializes this event pool.


releaseInstance

public static void releaseInstance()
Releases this event pool.


getInstance

public static EventPool getInstance()
Gets the event pool instance.

Returns:
The event pool instance

removeByUser

public void removeByUser(int userId,
                         int contextId)
Removes all pooled events from this pool associated with given user.

Parameters:
userId - The user ID
contextId - The context ID

put

public void put(PooledEvent pooledEvent)
Puts given pooled event into this pool. If an equal pooled event is already present its time stamp is updated.

Parameters:
pooledEvent - The pooled event to put.

clear

public void clear()
Clears the event pool.


run

public void run()
Specified by:
run in interface java.lang.Runnable