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(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(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).
|
void |
send(Object topic,
Collection<?> msgs)
Sends given messages with the specified topic to the nodes in the underlying cluster group.
|
void |
send(Object topic,
Object msg)
Sends given message with specified topic to the nodes in the underlying cluster group.
|
void |
sendOrdered(Object topic,
Object msg,
long timeout)
Sends given message with specified topic to the nodes in the underlying cluster group.
|
void |
stopLocalListen(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.
|
void |
writeExternal(ObjectOutput out) |
createFuture, future, future, isAsync, saveOrGet, withAsync
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
withAsync
future, isAsync
public 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 IgniteMessaging
GridMessaging
instance belongs.public void send(@Nullable Object topic, Object msg)
send
in interface IgniteMessaging
topic
- Topic to send to, null
for default topic.msg
- Message to send.public void send(@Nullable Object topic, Collection<?> msgs)
send
in interface IgniteMessaging
topic
- 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 Object topic, Object msg, long timeout)
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 IgniteMessaging
topic
- 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 Object topic, IgniteBiPredicate<UUID,?> p)
localListen
in interface IgniteMessaging
topic
- 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 Object topic, IgniteBiPredicate<UUID,?> p)
stopLocalListen
in interface IgniteMessaging
topic
- Topic to unsubscribe from.p
- Listener predicate.public UUID remoteListen(@Nullable Object topic, IgniteBiPredicate<UUID,?> p)
remoteListen
in interface IgniteMessaging
topic
- 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 void stopRemoteListen(UUID opId)
Supports asynchronous execution (see IgniteAsyncSupport
).
stopRemoteListen
in interface IgniteMessaging
opId
- Listen ID that was returned from IgniteMessaging.remoteListen(Object, IgniteBiPredicate)
method.protected IgniteMessaging createAsyncInstance()
createAsyncInstance
in class AsyncSupportAdapter<IgniteMessaging>
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
protected Object readResolve() throws ObjectStreamException
ObjectStreamException
- Thrown in case of unmarshalling error.
Follow @ApacheIgnite
Ignite Fabric : ver. 1.5.0.final Release Date : December 29 2015