public class IgniteMessagingImpl extends AsyncSupportAdapter<IgniteMessaging> implements IgniteMessaging, Externalizable
IgniteMessaging implementation.curFut| Constructor and Description |
|---|
IgniteMessagingImpl()
Required by
Externalizable. |
IgniteMessagingImpl(GridKernalContext ctx,
ClusterGroupAdapter prj,
boolean async) |
| Modifier and Type | Method and Description |
|---|---|
ClusterGroup |
clusterGroup()
Gets the cluster group to which this
GridMessaging instance belongs. |
protected IgniteMessaging |
createAsyncInstance()
Creates component with asynchronous mode enabled.
|
void |
localListen(@Nullable Object topic,
IgniteBiPredicate<UUID,?> p)
Adds local listener for given topic on local node only.
|
void |
readExternal(ObjectInput in) |
protected Object |
readResolve()
Reconstructs object on unmarshalling.
|
UUID |
remoteListen(@Nullable Object topic,
IgniteBiPredicate<UUID,?> p)
Adds a message listener for a given topic to all nodes in the cluster group (possibly including
this node if it belongs to the cluster group as well).
|
IgniteFuture<UUID> |
remoteListenAsync(@Nullable Object topic,
IgniteBiPredicate<UUID,?> p)
Asynchronously adds a message listener for a given topic to all nodes in the cluster group (possibly including
this node if it belongs to the cluster group as well).
|
void |
send(@Nullable Object topic,
Collection<?> msgs)
Sends given messages with the specified topic to the nodes in the underlying cluster group.
|
void |
send(@Nullable Object topic,
Object msg)
Sends given message with specified topic to the nodes in the underlying cluster group.
|
void |
sendOrdered(@Nullable Object topic,
Object msg,
long timeout)
Sends given message with specified topic to the nodes in the underlying cluster group.
|
void |
stopLocalListen(@Nullable Object topic,
IgniteBiPredicate<UUID,?> p)
Unregisters local listener for given topic on local node only.
|
void |
stopRemoteListen(UUID opId)
Unregisters all listeners identified with provided operation ID on all nodes in the cluster group.
|
IgniteFuture<Void> |
stopRemoteListenAsync(UUID opId)
Asynchronously unregisters all listeners identified with provided operation ID on all nodes in the cluster group.
|
void |
writeExternal(ObjectOutput out) |
createFuture, future, future, isAsync, saveOrGet, withAsyncclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitwithAsyncfuture, isAsyncpublic IgniteMessagingImpl()
Externalizable.public IgniteMessagingImpl(GridKernalContext ctx, ClusterGroupAdapter prj, boolean async)
ctx - Kernal context.prj - Projection.async - Async support flag.public ClusterGroup clusterGroup()
GridMessaging instance belongs.clusterGroup in interface IgniteMessagingGridMessaging instance belongs.public void send(@Nullable
@Nullable Object topic,
Object msg)
By default all local listeners will be executed in the calling thread, or if you use
IgniteMessaging.withAsync(), listeners will execute in public thread pool (in this case it is user's
responsibility to implement back-pressure and limit number of concurrently executed async messages).
send in interface IgniteMessagingtopic - Topic to send to, null for default topic.msg - Message to send.public void send(@Nullable
@Nullable Object topic,
Collection<?> msgs)
By default all local listeners will be executed in the calling thread, or if you use
IgniteMessaging.withAsync(), listeners will execute in public thread pool (in this case it is user's
responsibility to implement back-pressure and limit number of concurrently executed async messages).
send in interface IgniteMessagingtopic - Topic to send to, null for default topic.msgs - Messages to send. Order of the sending is undefined. If the method produces
the exception none or some messages could have been sent already.public void sendOrdered(@Nullable
@Nullable Object topic,
Object msg,
long timeout)
IgniteMessaging.withAsync() mode is used.
The timeout parameter specifies how long an out-of-order message will stay in a queue,
waiting for messages that are ordered ahead of it to arrive. If timeout expires, then all ordered
messages that have not arrived before this message will be skipped. When (and if) expired messages
actually do arrive, they will be ignored.
sendOrdered in interface IgniteMessagingtopic - Topic to send to, null for default topic.msg - Message to send.timeout - Message timeout in milliseconds, 0 for default
which is IgniteConfiguration.getNetworkTimeout().public void localListen(@Nullable
@Nullable Object topic,
IgniteBiPredicate<UUID,?> p)
localListen in interface IgniteMessagingtopic - Topic to subscribe to.p - Predicate that is called on each received message. If predicate returns false,
then it will be unsubscribed from any further notifications.public void stopLocalListen(@Nullable
@Nullable Object topic,
IgniteBiPredicate<UUID,?> p)
stopLocalListen in interface IgniteMessagingtopic - Topic to unsubscribe from.p - Listener predicate.public UUID remoteListen(@Nullable @Nullable Object topic, IgniteBiPredicate<UUID,?> p)
remoteListen in interface IgniteMessagingtopic - Topic to subscribe to, null means default topic.p - Predicate that is called on each node for each received message. If predicate returns false,
then it will be unsubscribed from any further notifications.Operation ID that can be passed to IgniteMessaging.stopRemoteListen(UUID) method to stop listening.public IgniteFuture<UUID> remoteListenAsync(@Nullable @Nullable Object topic, IgniteBiPredicate<UUID,?> p) throws IgniteException
remoteListenAsync in interface IgniteMessagingtopic - Topic to subscribe to, null means default topic.p - Predicate that is called on each node for each received message. If predicate returns false,
then it will be unsubscribed from any further notifications.Operation ID that can be passed to IgniteMessaging.stopRemoteListen(UUID) method to stop listening.IgniteException - If failed to add listener.public void stopRemoteListen(UUID opId)
Supports asynchronous execution (see IgniteAsyncSupport).
stopRemoteListen in interface IgniteMessagingopId - Listen ID that was returned from IgniteMessaging.remoteListen(Object, IgniteBiPredicate) method.public IgniteFuture<Void> stopRemoteListenAsync(UUID opId) throws IgniteException
stopRemoteListenAsync in interface IgniteMessagingopId - Listen ID that was returned from IgniteMessaging.remoteListen(Object, IgniteBiPredicate) method.IgniteException - If failed to unregister listeners.protected IgniteMessaging createAsyncInstance()
createAsyncInstance in class AsyncSupportAdapter<IgniteMessaging>public void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionprotected Object readResolve() throws ObjectStreamException
ObjectStreamException - Thrown in case of unmarshalling error.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.9.0 Release Date : October 15 2020