Public Member Functions | Properties | List of all members
GridGain.Events.IEvents Interface Reference

Provides functionality for local and remote event notifications on nodes defined by ClusterGroup. All members are thread-safe and may be used concurrently from multiple threads. More...

Inherits GridGain.Common.IAsyncSupport< IEvents >.

Public Member Functions

List< T > RemoteQuery< T > (IEventFilter< T > filter, TimeSpan?timeout=null, params int[] types)
 Queries nodes in this cluster group for events using passed in predicate filter for event selection. More...
 
Guid RemoteListen< T > (int bufSize=1, TimeSpan?interval=null, bool autoUnsubscribe=true, IEventFilter< T > localListener=null, IEventFilter< T > remoteFilter=null, params int[] types)
 Adds event listener for specified events to all nodes in the cluster group (possibly including local node if it belongs to the cluster group as well). This means that all events occurring on any node within this cluster group that pass remote filter will be sent to local node for local listener notifications. The listener can be unsubscribed automatically if local node stops, if localListener callback returns false or if StopRemoteListen is called. More...
 
void StopRemoteListen (Guid opId)
 Stops listening to remote events. This will unregister all listeners identified with provided operation ID on all nodes defined by ClusterGroup. More...
 
IEvent WaitForLocal (params int[] types)
 Waits for the specified events. More...
 
T WaitForLocal< T > (IEventFilter< T > filter, params int[] types)
 Waits for the specified events. More...
 
List< IEvent > LocalQuery (params int[] types)
 Queries local node for events using of specified types. More...
 
void RecordLocal (IEvent evt)
 Records customer user generated event. All registered local listeners will be notified. NOTE: all types in range from 1 to 1000 are reserved for internal Ignite events and should not be used by user-defined events. Attempt to record internal event with this method will cause ArgumentException to be thrown. More...
 
void LocalListen< T > (IEventFilter< T > listener, params int[] types)
 Adds an event listener for local events. Note that listener will be added regardless of whether local node is in this cluster group or not. More...
 
bool StopLocalListen< T > (IEventFilter< T > listener, params int[] types)
 Removes local event listener. More...
 
void EnableLocal (params int[] types)
 Enables provided events. Allows to start recording events that were disabled before. Note that provided events will be enabled regardless of whether local node is in this cluster group or not. More...
 
void DisableLocal (params int[] types)
 Disables provided events. Allows to stop recording events that were enabled before. Note that specified events will be disabled regardless of whether local node is in this cluster group or not. More...
 
int[] GetEnabledEvents ()
 Gets types of enabled events. More...
 
bool IsEnabled (int type)
 Determines whether the specified event is enabled. More...
 
- Public Member Functions inherited from GridGain.Common.IAsyncSupport< IEvents >
TWithAsync WithAsync ()
 Gets component with asynchronous mode enabled. More...
 
IFuture GetFuture ()
 Gets and resets future for previous asynchronous operation. More...
 
IFuture< TResult > GetFuture< TResult > ()
 Gets and resets future for previous asynchronous operation. More...
 

Properties

IClusterGroup ClusterGroup [get]
 Gets the cluster group to which this instance belongs. More...
 
- Properties inherited from GridGain.Common.IAsyncSupport< IEvents >
bool IsAsync [get]
 Gets a value indicating whether this instance is in asynchronous mode. More...
 

Detailed Description

Member Function Documentation

void GridGain.Events.IEvents.DisableLocal ( params int[]  types)
Parameters
typesEvents to disable.
void GridGain.Events.IEvents.EnableLocal ( params int[]  types)
Parameters
typesEvents to enable.
int [] GridGain.Events.IEvents.GetEnabledEvents ( )
Returns
Types of enabled events.
bool GridGain.Events.IEvents.IsEnabled ( int  type)
Parameters
typeEvent type.
Returns
Value indicating whether the specified event is enabled.
void GridGain.Events.IEvents.LocalListen< T > ( IEventFilter< T >  listener,
params int[]  types 
)
Template Parameters
TType of events.
Parameters
listenerPredicate that is called on each received event. If predicate returns false, it will be unregistered and will stop receiving events.
typesEvent types for which this listener will be notified, should not be empty.
Type Constraints
T :IEvent 
List<IEvent> GridGain.Events.IEvents.LocalQuery ( params int[]  types)
Parameters
typesEvent types to be queried. Optional.
Returns
Collection of grid events found on local node.
void GridGain.Events.IEvents.RecordLocal ( IEvent  evt)
Parameters
evtLocally generated event.
Exceptions
ArgumentExceptionIf event type is within Ignite reserved range (1 � 1000)
Guid GridGain.Events.IEvents.RemoteListen< T > ( int  bufSize = 1,
TimeSpan?  interval = null,
bool  autoUnsubscribe = true,
IEventFilter< T >  localListener = null,
IEventFilter< T >  remoteFilter = null,
params int[]  types 
)
Template Parameters
TType of events.
Parameters
bufSizeRemote events buffer size. Events from remote nodes won't be sent until buffer is full or time interval is exceeded.
intervalMaximum time interval after which events from remote node will be sent. Events from remote nodes won't be sent until buffer is full or time interval is exceeded.
autoUnsubscribeFlag indicating that event listeners on remote nodes should be automatically unregistered if master node (node that initiated event listening) leaves topology. If this flag is false, listeners will be unregistered only when StopRemoteListen method is called, or the localListener returns false.
localListenerListener callback that is called on local node. If null, these events will be handled on remote nodes by passed in remoteFilter.
remoteFilterFilter callback that is called on remote node. Only events that pass the remote filter will be sent to local node. If null, all events of specified types will be sent to local node. This remote filter can be used to pre-handle events remotely, before they are passed in to local callback. It will be auto-unsubscribed on the node where event occurred in case if it returns false.
typesTypes of events to listen for. If not provided, all events that pass the provided remote filter will be sent to local node.
Returns
Operation ID that can be passed to StopRemoteListen method to stop listening.
Type Constraints
T :IEvent 
List<T> GridGain.Events.IEvents.RemoteQuery< T > ( IEventFilter< T >  filter,
TimeSpan?  timeout = null,
params int[]  types 
)
Template Parameters
TType of events.
Parameters
filterPredicate filter used to query events on remote nodes.
timeoutMaximum time to wait for result, null or 0 to wait forever.
typesEvent types to be queried.
Returns
Collection of grid events returned from specified nodes.
Type Constraints
T :IEvent 
bool GridGain.Events.IEvents.StopLocalListen< T > ( IEventFilter< T >  listener,
params int[]  types 
)
Template Parameters
TType of events.
Parameters
listenerLocal event listener to remove.
typesTypes of events for which to remove listener. If not specified, then listener will be removed for all types it was registered for.
Returns
True if listener was removed, false otherwise.
Type Constraints
T :IEvent 
void GridGain.Events.IEvents.StopRemoteListen ( Guid  opId)
Parameters
opIdOperation ID that was returned from RemoteListen<T>.
IEvent GridGain.Events.IEvents.WaitForLocal ( params int[]  types)
Parameters
typesTypes of the events to wait for. If not provided, all events will be passed to the filter.
Returns
Grid event.
T GridGain.Events.IEvents.WaitForLocal< T > ( IEventFilter< T >  filter,
params int[]  types 
)
Template Parameters
TType of events.
Parameters
filterOptional filtering predicate. Event wait will end as soon as it returns false.
typesTypes of the events to wait for. If not provided, all events will be passed to the filter.
Returns
Grid event.
Type Constraints
T :IEvent 

Property Documentation

IClusterGroup GridGain.Events.IEvents.ClusterGroup
get