com.neeve.toa
Interface MessageInjector

All Known Implementing Classes:
AbstractHK2TopicOrientedApplication, TopicOrientedApplication

public interface MessageInjector

Defines the interface for injecting messages into a Topic Oriented Applications.

Injection of a message into a TopicOrientedApplication directly enqueues the message for processing by the underlying AepEngine's event multiplexer similar to how a message received from a message bus would be injected into the engine.

Threading

See Also:
AepEngine.injectMessage(IRogMessage, boolean, int), AepEngine, TopicOrientedApplication
Threading:
This method is safe for concurrent access by multiple threads.

Method Summary
 void injectMessage(IRogMessage message)
          Enqueue a message into an application's AepEngine's event multiplexer.
 void injectMessage(IRogMessage message, boolean nonBlocking)
          Enqueue a message into an application's AepEngine's event multiplexer.
 void injectMessage(IRogMessage message, boolean nonBlocking, int delay)
          Enqueue a message into an application's AepEngine's event multiplexer.
 

Method Detail

injectMessage

void injectMessage(IRogMessage message)
Enqueue a message into an application's AepEngine's event multiplexer.

This method is the same as injectMessage(message, false, defaultInjectionDelay). (where default injection delay is set by TopicOrientedApplication.PROP_DEFAULT_INJECTION_DELAY).

Parameters:
message - The message to enqueue.
See Also:
AepEngine.injectMessage(IRogMessage, boolean)

injectMessage

void injectMessage(IRogMessage message,
                   boolean nonBlocking)
Enqueue a message into an application's AepEngine's event multiplexer.

This method is the same as injectMessage(message, nonBlocking, defaultInjectionDelay) (where default injection delay is set by TopicOrientedApplication.PROP_DEFAULT_INJECTION_DELAY).

Parameters:
message - The message to enqueue.
nonBlocking - Indicates whether the multiplexing should be a non-blocking action or not. If blocking, then the calling thread will block if the engine's input multiplexer queue is full and wait until space is available. If non-blocking, then the method will not wait but rather enque the message in a feeder queue fronting the engine's input multiplexer queue.
See Also:
AepEngine.injectMessage(IRogMessage, boolean), TopicOrientedApplication.PROP_DEFAULT_INJECTION_DELAY

injectMessage

void injectMessage(IRogMessage message,
                   boolean nonBlocking,
                   int delay)
Enqueue a message into an application's AepEngine's event multiplexer.

This method is the same as the corresponding AepEngine.injectMessage(IRogMessage, boolean, int) method except that this method disallows injection of message from the AepEngine's dispatch thread (i.e. from a message handler).

Parameters:
message - The IRogMessage to enqueue.
nonBlocking - Indicates whether the multiplexing should be a non-blocking action or not. If blocking, then the calling thread will block if the engine's input multiplexer queue is full and wait until space is available. If non-blocking, then the method will not wait but rather enque the message in a feeder queue fronting the engine's input multiplexer queue.
delay - The delay in milliseconds at which the message should be injected.
Throws:
IllegalStateException - If the underlying AepEngine has not been started.
UnsupportedOperationException - if this is called from the AepEngine's dispatch therad (i.e. a message/event handler).
Threading:
This method is safe for concurrent access by multiple threads.


Copyright © 2016 Neeve Research, LLC. All Rights Reserved.