|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectat.spardat.xma.event.global.GlobalEventManager
This singleton class serves for creating, sending and polling GlobalEvents. To send an event means to store it for this server in an GlobalEventmanager internal Map, for the accesss of other servers the events are also stored in an JNDI tree. Polling means to ask the map and the JNDI tree for undelivered events and to return a collection with them. GlobalEventListener for the server side GlobalEvents have to be registerd at this class (addGlobalEventListener()). GlobalEventListener for the client side GlobalEvents have to be registerd at the XMASessionClient (addGlobalEventListener()).
| Method Summary | |
void |
addGlobalEventListener(GlobalEventListener listener)
The added GlobalEventListener will be notifyed by server events (recipient = RECIPIENT_ALL_SERVERS). |
GlobalEvent |
createGlobalEvent(java.lang.String name)
creates a GlobalEvent with the given name, the default recipient type (RECIPIENT_ALL_CLIENTS_ALL_SERVERS) and the default expiration date (now + 1 day). |
GlobalEvent |
createGlobalEvent(java.lang.String name,
int recipient)
creates a GlobalEvent with the given name, recipient type and the default expiration date (now + 1 day). |
GlobalEvent |
createGlobalEvent(java.lang.String name,
int recipient,
long expiresMilliSec)
creates a GlobalEvent with the given name, recipient type and the given expiration date. |
GlobalEvent |
createGlobalEvent(java.lang.String name,
int recipient,
long expiresMilliSec,
java.lang.String sessionId)
creates a GlobalEvent with the given name, recipient type, the given expiration date and the given session id. |
GlobalEvent |
createGlobalEventTTL(java.lang.String name,
int recipient,
long timeToLiveMilliSec)
creates a GlobalEvent with the given name, the given recipient type and the time from now how long this event is valid. |
GlobalEvent |
createGlobalEventTTL(java.lang.String name,
int recipient,
long timeToLiveMilliSec,
java.lang.String sessionId)
creates a GlobalEvent with the given name, the given recipient type and the time from now how long this event is valid. |
GlobalEvent |
createGlobalEventTTL(java.lang.String name,
long timeToLiveMilliSec)
creates a GlobalEvent with the given name, the default recipient type (RECIPIENT_ALL_CLIENTS_ALL_SERVERS) and the time from now how long this event is valid. |
static GlobalEventManager |
getInstance()
Returns a singleton GlobalEventManager object. |
static boolean |
isGlobalEventActivated()
Queries for the property: at.spardat.xma.activateGlobalEvents=true Is called after every RPC before GlobalEventManager.getInstance().pollEvents() to ommit unneccesary JNDI queries. |
java.util.Collection |
pollEvents()
Returns a Collection of GlobalEvents for the client. |
void |
pollServerSideEvents()
Polls for new GlobalEvents with myServerHighCounts and iterates over the registered sever side GlobalEventsListers. |
boolean |
removeGlobalEventListener(GlobalEventListener listener)
removes the GlobalEventListener. |
void |
send(GlobalEvent event)
Sends this given event to the global data structure. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static GlobalEventManager getInstance()
at.spardat.enterprise.exc.SysException - - if xma.runtime.activateGlobalEvents is set to "false"public void addGlobalEventListener(GlobalEventListener listener)
listener - public boolean removeGlobalEventListener(GlobalEventListener listener)
listener -
public GlobalEvent createGlobalEvent(java.lang.String name)
name - type of GlobalEvent
public GlobalEvent createGlobalEvent(java.lang.String name,
int recipient)
name - type of GlobalEventrecipient - type of recipient: RECIPIENT_ALL_SERVERS, RECIPIENT_ALL_CLIENTS, RECIPIENT_ALL_CLIENTS_ALL_SERVERS
public GlobalEvent createGlobalEvent(java.lang.String name,
int recipient,
long expiresMilliSec)
name - type of GlobalEventrecipient - type of recipient: RECIPIENT_ALL_SERVERS, RECIPIENT_ALL_CLIENTS, RECIPIENT_ALL_CLIENTS_ALL_SERVERSexpiresMilliSec - milli seconds after 1970
public GlobalEvent createGlobalEvent(java.lang.String name,
int recipient,
long expiresMilliSec,
java.lang.String sessionId)
name - type of GlobalEventrecipient - type of recipient: RECIPIENT_ALL_SERVERS, RECIPIENT_ALL_CLIENTS, RECIPIENT_ALL_CLIENTS_ALL_SERVERSexpiresMilliSec - milli seconds after 1970sessionId - - usually session id of creator.
public GlobalEvent createGlobalEventTTL(java.lang.String name,
long timeToLiveMilliSec)
name - type of GlobalEventtimeToLiveMilliSec - -
milli seconds (from now) in which this event expires.
public GlobalEvent createGlobalEventTTL(java.lang.String name,
int recipient,
long timeToLiveMilliSec)
name - type of GlobalEventrecipient - type of recipient: RECIPIENT_ALL_SERVERS, RECIPIENT_ALL_CLIENTS, RECIPIENT_ALL_CLIENTS_ALL_SERVERStimeToLiveMilliSec - milli seconds (from now) in which this event expires.
public GlobalEvent createGlobalEventTTL(java.lang.String name,
int recipient,
long timeToLiveMilliSec,
java.lang.String sessionId)
name - type of GlobalEventrecipient - type of recipient: RECIPIENT_ALL_SERVERS, RECIPIENT_ALL_CLIENTS, RECIPIENT_ALL_CLIENTS_ALL_SERVERStimeToLiveMilliSec - milli seconds (from now) in which this event expires.sessionId - - usually session id of creator.
public void send(GlobalEvent event)
event -
java.lang.RuntimeException - if XProperty 'at.spardat.xma.activateGlobalEvents=true' is not set.public java.util.Collection pollEvents()
public void pollServerSideEvents()
public static boolean isGlobalEventActivated()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||