WIP var-args
This commit is contained in:
parent
0202c937ce
commit
c0d19fcde4
|
@ -80,12 +80,6 @@ public class MBassador extends AbstractPubSubSupport implements IMessageBus {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Synchronously publish a message to all registered listeners (this includes listeners defined for super types)
|
||||
* The call blocks until every messageHandler has processed the message.
|
||||
*
|
||||
* @param message
|
||||
*/
|
||||
@Override
|
||||
public void publish(Object message) {
|
||||
try {
|
||||
|
@ -98,15 +92,6 @@ public class MBassador extends AbstractPubSubSupport implements IMessageBus {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the message publication asynchronously. The behavior of this method depends on the
|
||||
* configured queuing strategy:
|
||||
* <p/>
|
||||
* If an unbound queuing strategy is used the call returns immediately.
|
||||
* If a bounded queue is used the call might block until the message can be placed in the queue.
|
||||
*
|
||||
* @return A message publication that can be used to access information about it's state
|
||||
*/
|
||||
@Override
|
||||
public void publishAsync(Object message) {
|
||||
try {
|
||||
|
@ -116,18 +101,8 @@ public class MBassador extends AbstractPubSubSupport implements IMessageBus {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the message publication asynchronously. The behaviour of this method depends on the
|
||||
* configured queuing strategy:
|
||||
* <p/>
|
||||
* If an unbound queuing strategy is used the call returns immediately.
|
||||
* If a bounded queue is used the call will block until the message can be placed in the queue
|
||||
* or the timeout is reached.
|
||||
*
|
||||
* @return A message publication that wraps up the publication request
|
||||
*/
|
||||
@Override
|
||||
public void publishAsync(Object message, long timeout, TimeUnit unit) {
|
||||
public void publishAsync(long timeout, TimeUnit unit, Object message) {
|
||||
try {
|
||||
this.pendingMessages.offer(message, timeout, unit);
|
||||
} catch (InterruptedException e) {
|
||||
|
|
|
@ -12,7 +12,7 @@ public interface PubSubSupport {
|
|||
|
||||
/**
|
||||
* Subscribe all handlers of the given listener. Any listener is only subscribed once
|
||||
* -> subsequent subscriptions of an already subscribed listener will be silently ignored
|
||||
* subsequent subscriptions of an already subscribed listener will be silently ignored
|
||||
*
|
||||
* @param listener
|
||||
*/
|
||||
|
@ -22,7 +22,7 @@ public interface PubSubSupport {
|
|||
* Immediately remove all registered message handlers (if any) of the given listener. When this call returns all handlers
|
||||
* have effectively been removed and will not receive any messages (provided that running publications (iterators) in other threads
|
||||
* have not yet obtained a reference to the listener)
|
||||
* <p/>
|
||||
* <p>
|
||||
* A call to this method passing any object that is not subscribed will not have any effect and is silently ignored.
|
||||
*
|
||||
* @param listener
|
||||
|
@ -34,30 +34,129 @@ public interface PubSubSupport {
|
|||
|
||||
/**
|
||||
* Synchronously publish a message to all registered listeners. This includes listeners defined for super types of the
|
||||
* given message type, provided they are not configured to reject valid subtype. The call returns when all matching handlers
|
||||
* given message type, provided they are not configured to reject valid subtypes. The call returns when all matching handlers
|
||||
* of all registered listeners have been notified (invoked) of the message.
|
||||
*
|
||||
* @param message
|
||||
*/
|
||||
void publish(Object message);
|
||||
|
||||
// /**
|
||||
// * Synchronously publish <b>TWO</b> messages to all registered listeners (that match the signature). This includes listeners
|
||||
// * defined for super types of the given message type, provided they are not configured to reject valid subtypes. The call
|
||||
// * returns when all matching handlers of all registered listeners have been notified (invoked) of the message.
|
||||
// */
|
||||
// void publish(Object message1, Object message2);
|
||||
//
|
||||
// /**
|
||||
// * Synchronously publish <b>THREE</b> messages to all registered listeners (that match the signature). This includes listeners
|
||||
// * defined for super types of the given message type, provided they are not configured to reject valid subtypes. The call
|
||||
// * returns when all matching handlers of all registered listeners have been notified (invoked) of the message.
|
||||
// */
|
||||
// void publish(Object message1, Object message2, Object message3);
|
||||
//
|
||||
// /**
|
||||
// * Synchronously publish <b>ARBITRARY</b> messages to all registered listeners (that match the signature). This includes listeners
|
||||
// * defined for super types of the given message type, provided they are not configured to reject valid subtypes. The call
|
||||
// * returns when all matching handlers of all registered listeners have been notified (invoked) of the message.
|
||||
// */
|
||||
// void publish(Object... messages);
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Execute the message publication asynchronously. The behavior of this method depends on the
|
||||
* configured queuing strategy:
|
||||
* <p/>
|
||||
* Publish the message asynchronously to all registered listeners (that match the signature). This includes listeners
|
||||
* defined for super types of the given message type, provided they are not configured to reject valid subtypes. The call
|
||||
* returns when all matching handlers of all registered listeners have been notified (invoked) of the message.
|
||||
* <p>
|
||||
* The behavior of this method depends on the configured queuing strategy:
|
||||
* <p>
|
||||
* If an unbound queuing strategy is used the call returns immediately.
|
||||
* If a bounded queue is used the call might block until the message can be placed in the queue.
|
||||
*/
|
||||
void publishAsync(Object message);
|
||||
|
||||
// /**
|
||||
// * Publish <b>TWO</b> messages asynchronously to all registered listeners (that match the signature). This includes listeners
|
||||
// * defined for super types of the given message type, provided they are not configured to reject valid subtypes. The call
|
||||
// * returns when all matching handlers of all registered listeners have been notified (invoked) of the message.
|
||||
// * <p>
|
||||
// * The behavior of this method depends on the configured queuing strategy:
|
||||
// * <p>
|
||||
// * If an unbound queuing strategy is used the call returns immediately.
|
||||
// * If a bounded queue is used the call might block until the message can be placed in the queue.
|
||||
// */
|
||||
// void publishAsync(Object message1, Object message2);
|
||||
//
|
||||
// /**
|
||||
// * Publish <b>THREE</b> messages asynchronously to all registered listeners (that match the signature). This includes listeners
|
||||
// * defined for super types of the given message type, provided they are not configured to reject valid subtypes. The call
|
||||
// * returns when all matching handlers of all registered listeners have been notified (invoked) of the message.
|
||||
// * <p>
|
||||
// * The behavior of this method depends on the configured queuing strategy:
|
||||
// * <p>
|
||||
// * If an unbound queuing strategy is used the call returns immediately.
|
||||
// * If a bounded queue is used the call might block until the message can be placed in the queue.
|
||||
// */
|
||||
// void publishAsync(Object message1, Object message2, Object message3);
|
||||
//
|
||||
// /**
|
||||
// * Publish <b>ARBITRARY</b> messages asynchronously to all registered listeners (that match the signature). This includes listeners
|
||||
// * defined for super types of the given message type, provided they are not configured to reject valid subtypes. The call
|
||||
// * returns when all matching handlers of all registered listeners have been notified (invoked) of the message.
|
||||
// * <p>
|
||||
// * The behavior of this method depends on the configured queuing strategy:
|
||||
// * <p>
|
||||
// * If an unbound queuing strategy is used the call returns immediately.
|
||||
// * If a bounded queue is used the call might block until the message can be placed in the queue.
|
||||
// */
|
||||
// void publishAsync(Object... messages);
|
||||
|
||||
|
||||
/**
|
||||
* Execute the message publication asynchronously. The behavior of this method depends on the
|
||||
* configured queuing strategy:
|
||||
* <p/>
|
||||
* Publish the message asynchronously to all registered listeners (that match the signature). This includes listeners
|
||||
* defined for super types of the given message type, provided they are not configured to reject valid subtypes. The call
|
||||
* returns when all matching handlers of all registered listeners have been notified (invoked) of the message.
|
||||
* <p>
|
||||
* The behavior of this method depends on the configured queuing strategy:
|
||||
* <p>
|
||||
* If an unbound queuing strategy is used the call returns immediately.
|
||||
* If a bounded queue is used the call will block until the message can be placed in the queue
|
||||
* or the timeout is reached.
|
||||
* If a bounded queue is used the call might block until the message can be placed in the queue or the timeout is reached.
|
||||
*/
|
||||
void publishAsync(Object message, long timeout, TimeUnit unit);
|
||||
void publishAsync(long timeout, TimeUnit unit, Object message);
|
||||
|
||||
// /**
|
||||
// * Publish <b>TWO</b> messages asynchronously to all registered listeners (that match the signature). This includes listeners
|
||||
// * defined for super types of the given message type, provided they are not configured to reject valid subtypes. The call
|
||||
// * returns when all matching handlers of all registered listeners have been notified (invoked) of the message.
|
||||
// * <p>
|
||||
// * The behavior of this method depends on the configured queuing strategy:
|
||||
// * <p>
|
||||
// * If an unbound queuing strategy is used the call returns immediately.
|
||||
// * If a bounded queue is used the call might block until the message can be placed in the queue or the timeout is reached.
|
||||
// */
|
||||
// void publishAsync(long timeout, TimeUnit unit, Object message1, Object message2);
|
||||
//
|
||||
// /**
|
||||
// * Publish <b>THREE</b> messages asynchronously to all registered listeners (that match the signature). This includes listeners
|
||||
// * defined for super types of the given message type, provided they are not configured to reject valid subtypes. The call
|
||||
// * returns when all matching handlers of all registered listeners have been notified (invoked) of the message.
|
||||
// * <p>
|
||||
// * The behavior of this method depends on the configured queuing strategy:
|
||||
// * <p>
|
||||
// * If an unbound queuing strategy is used the call returns immediately.
|
||||
// * If a bounded queue is used the call might block until the message can be placed in the queue or the timeout is reached.
|
||||
// */
|
||||
// void publishAsync(long timeout, TimeUnit unit, Object message1, Object message2, Object message3);
|
||||
//
|
||||
// /**
|
||||
// * Publish <b>ARBITRARY</b> messages asynchronously to all registered listeners (that match the signature). This includes listeners
|
||||
// * defined for super types of the given message type, provided they are not configured to reject valid subtypes. The call
|
||||
// * returns when all matching handlers of all registered listeners have been notified (invoked) of the message.
|
||||
// * <p>
|
||||
// * The behavior of this method depends on the configured queuing strategy:
|
||||
// * <p>
|
||||
// * If an unbound queuing strategy is used the call returns immediately.
|
||||
// * If a bounded queue is used the call might block until the message can be placed in the queue or the timeout is reached.
|
||||
// */
|
||||
// void publishAsync(long timeout, TimeUnit unit, Object... messages);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user