|
GigaSpaces XAP 7.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.gigaspaces.events.EventSessionConfig
public class EventSessionConfig
this class is used to configure an EventSession.
it contains a set of configuration parameters that influence
the way event listeners are registered with the space
and how event notifications are processed.
there are three different ways to create an EventSessionConfig object:
1. use the empty constructor and set the different parameters using API
2. pass a Properties object to the constructor that contains a list of parameters
according the a list specified below
3. use a preconfigured, named set of parameters. the name is used to load a properties file
that resides in the config/schema directory
the names of the parameters that can be used in the properties object or file are:
comType - specifies the communication protocol: UNICAST / MULTIPLEX / MULTICAST
batchSize - the size of the batch used when sending notifications to the client.
must be used with batchTime
batchTime - the maximum elapsed time between two batch notifications.
must be used with batchSize
reliable - whether the notification process is reliable.
renew - whether to not to automatically renew the lease of the registered listeners.
durable - whether the events are durable.
replicateNotifyTemplate - whether to replicate the registration to other spaces in the cluster
triggerNotifyTemplate - whether to send notifications from all spaces in the cluster.
guaranteedNotifications - whether to generate notifications that won't be lost during failover.
EventSession
,
Serialized FormNested Class Summary | |
---|---|
static class |
EventSessionConfig.ComType
|
Field Summary | |
---|---|
static long |
DEFAULT_RENEW_DURATION
|
static long |
DEFAULT_RENEW_EXPIRATION
|
static long |
DEFAULT_RENEW_RTT
|
Constructor Summary | |
---|---|
EventSessionConfig()
creates EventSessionConfig for farther configuration. |
|
EventSessionConfig(Properties props)
creates EventSessionConfig and start it's configuration from the Properties given. |
|
EventSessionConfig(String schemaName)
creates EventSessionConfig from a loaded file in the given name. |
Method Summary | |
---|---|
int |
getBatchSize()
|
long |
getBatchTime()
|
EventSessionConfig.ComType |
getComType()
Gets the Communication type that is in use with this config. |
net.jini.lease.LeaseListener |
getLeaseListener()
|
long |
getRenewDuration()
|
long |
getRenewExpiration()
|
long |
getRenewRTT()
|
boolean |
isAutoRenew()
|
boolean |
isBatching()
Checks if using batch notifications. |
boolean |
isFifo()
Checks if the order that is in use with this config is fifo. |
boolean |
isGuaranteedNotifications()
|
Boolean |
isReplicateNotifyTemplate()
Should this template be replicated. |
Boolean |
isTriggerNotifyTemplate()
Should notify template be triggered on replication event. |
void |
setAutoRenew(boolean renew,
net.jini.lease.LeaseListener listener)
enable the auto renew of the notify. |
void |
setAutoRenew(boolean renew,
net.jini.lease.LeaseListener listener,
long renewExpiration,
long renewDuration,
long renewRTT)
with this method the user can configure the renew time duration for the auto renew. |
void |
setBatch(int size,
long time)
set the notifications to come in batches of size. |
void |
setComType(EventSessionConfig.ComType comType)
Set the Communication type to be used with this config. |
void |
setFifo(boolean fifo)
Set fifo order for the notifications. |
void |
setGuaranteedNotifications(boolean guaranteedNotifications)
Sets whether to generate notifications that won't be lost during failover |
void |
setReplicateNotifyTemplate(boolean replicateNotifyTemplate)
|
void |
setTriggerNotifyTemplate(boolean triggerNotifyTemplate)
|
void |
validate()
Checks configuration validity |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final long DEFAULT_RENEW_EXPIRATION
public static final long DEFAULT_RENEW_DURATION
public static final long DEFAULT_RENEW_RTT
Constructor Detail |
---|
public EventSessionConfig()
public EventSessionConfig(Properties props)
props
- - holds the keys and values.public EventSessionConfig(String schemaName) throws IOException
schemaName
- - the file name.
IOException
- - thrown when fail to read from file.Method Detail |
---|
public EventSessionConfig.ComType getComType()
public void setComType(EventSessionConfig.ComType comType)
comType
- - ComType values: UNICAST, MULTIPLEX, MULTICAST.public boolean isFifo()
public void setFifo(boolean fifo)
fifo
- - true when using fifo order.public boolean isBatching()
true
if notification comes in batches both size>0 and time>0 were set.setBatch(int, long)
public void setBatch(int size, long time)
size
- - amount of notification in batch.time
- - maximum time to delay notification in not full batch.public int getBatchSize()
public long getBatchTime()
public boolean isAutoRenew()
public void setAutoRenew(boolean renew, net.jini.lease.LeaseListener listener)
setAutoRenew(renew, listener, Lease.FOREVER, 20000, 10000)
renew
- - true when autoRenew needed.listener
- for events when renew fails.public void setAutoRenew(boolean renew, net.jini.lease.LeaseListener listener, long renewExpiration, long renewDuration, long renewRTT)
renew
- - true when autoRenew needed.listener
- for events when renew fails.renewExpiration
- the period of time your notifications stop being renewed.renewDuration
- the period of time that passes between client failure,
and the time your notifications stop being sent. use more than renewRTT.renewRTT
- - RoundTripTime - the time that takes to reach the server and return. default 10000.public net.jini.lease.LeaseListener getLeaseListener()
public Boolean isTriggerNotifyTemplate()
true
if trigger is needed on replication event.
null
is returned when this value was never set.public void setTriggerNotifyTemplate(boolean triggerNotifyTemplate)
triggerNotifyTemplate
- public Boolean isReplicateNotifyTemplate()
true
if this template should be replicated.
null
is returned when this value was not set.public void setReplicateNotifyTemplate(boolean replicateNotifyTemplate)
replicateNotifyTemplate
- public long getRenewDuration()
public long getRenewExpiration()
public long getRenewRTT()
public boolean isGuaranteedNotifications()
public void setGuaranteedNotifications(boolean guaranteedNotifications)
guaranteedNotifications
- public void validate()
|
GigaSpaces XAP 7.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |