| 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.gigaspaces.events.EventSessionFactory
public class EventSessionFactory
the EventSessionFactory is a static service class that
 creates EventSession objects. 
 there are two types of EventSession that can be created: 
 1. DataEventSession - for handling data events 
 2. AddminEventSession - for handling administrative events 
 
 the EventSessionFactory is associated with a space and is required
 in order to create a factory.
 once a factory has been created, it can be used to create sessions. 
 every session is configured according to an EventSessionConfig object
 and is bounded to a transaction. 
 
 the following code example shows how to create a session from a factory 
 and register a listener to it. 
 
 IJSpace space = SpaceFinder.find(spaceURL); 
 EventSessionFactory factory = EventSessionFactory.getFactory(space); 
 EventSessionConfig config = new EventSessionConfig(); 
 config.setFifo(true); 
 config.setBatch(100, 20000); // size = 100 , time = 20000ms 
 
 DataEventSession session = factory.newDataEventSession(config, tx); 
 session.addListener(new MyEntry(), new MyListener(), Lease.FOREVER, null, null, NotifyActionType.NOTIFY_ALL); 
 
EventSession, 
EventSessionConfig| Method Summary | |
|---|---|
static EventSessionFactory | 
getFactory(IJSpace space)
Retrieves the EventSessionFactory according to the space.  | 
 DataEventSession | 
newDataEventSession()
creates a new DataEventSession according to the configuration object.  | 
 DataEventSession | 
newDataEventSession(EventSessionConfig config,
                    Transaction tx)
creates a new DataEventSession bounded to the specified transaction, according to the configuration object.  | 
static DataEventSession | 
newDataSession(IJSpace space,
               Transaction tx,
               String schemaName)
creates a new DataEventSession bounded to the specified space, specified transaction and a predefined configuration schema name.  | 
| Methods inherited from class java.lang.Object | 
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Method Detail | 
|---|
public static EventSessionFactory getFactory(IJSpace space)
space - the associated space
public static DataEventSession newDataSession(IJSpace space,
                                              Transaction tx,
                                              String schemaName)
                                       throws IOException
space - the bounded spacetx - the bounded transaction. NULL if no transaction is needed.schemaName - the name of the predefined configuration schema
IOException - when schema name is invalid or when connection to the space fails.
public DataEventSession newDataEventSession(EventSessionConfig config,
                                            Transaction tx)
                                     throws RemoteException
config - the set of configuration params used to configure the session.tx - the bounded transaction. NULL if no transaction is needed.
RemoteException - when connection to the space fails.
public DataEventSession newDataEventSession()
                                     throws RemoteException
RemoteException - when connection to the space fails.
  | 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||