public class JAPCMailbox extends Object implements APCMailbox
Constructor and Description |
---|
JAPCMailbox(BufferedEventsQueue<JAMessage> bufferedEventQueue,
MailboxFactory mailboxFactory)
Create a JAPCMailbox.
|
JAPCMailbox(ThreadManager threadManager,
boolean autonomous,
MailboxFactory mailboxFactory)
Create a JAPCMailbox.
|
Modifier and Type | Method and Description |
---|---|
boolean |
dispatchEvents()
The dispatchMessages method processes any messages in the queue.
|
JARequest |
getCurrentRequest()
Returns the request message being processed.
|
EventQueue<ArrayList<JAMessage>> |
getEventQueue()
Returns the event queue.
|
ExceptionHandler |
getExceptionHandler()
Returns the exception handler.
|
boolean |
isEmpty()
The isEmpty method returns true when there are no pending messages,
though the results may not always be correct due to concurrency issues.
|
void |
putBufferedEvents(ArrayList<JAMessage> bufferedEvents)
The putBufferedEvents method adds events to be processed.
|
void |
response(JARequest jaRequest,
Object unwrappedResponse)
_ReturnF the response for processing.
|
void |
send(BufferedEventsDestination<JAMessage> destination,
JARequest request)
Buffer the request for subsequent sending.
|
void |
sendPendingMessages()
Send any pending Messages.
|
void |
setCurrentRequest(JARequest currentRequest)
Assigns the request message to be processed.
|
void |
setExceptionHandler(ExceptionHandler exceptionHandler)
Assign an exception handler.
|
void |
setInitialBufferCapacity(int initialBufferCapacity)
Set the initial capacity for buffered outgoing messages.
|
public JAPCMailbox(BufferedEventsQueue<JAMessage> bufferedEventQueue, MailboxFactory mailboxFactory)
bufferedEventQueue
- The lower-level mailbox which transports messages as 1-way events.public JAPCMailbox(ThreadManager threadManager, boolean autonomous, MailboxFactory mailboxFactory)
threadManager
- Provides a thread for processing dispatched events.autonomous
- Inhibits the acquireControl operation when true.public final ExceptionHandler getExceptionHandler()
getExceptionHandler
in interface APCMailbox
public final void setExceptionHandler(ExceptionHandler exceptionHandler)
setExceptionHandler
in interface APCMailbox
exceptionHandler
- The exception handler.public final JARequest getCurrentRequest()
getCurrentRequest
in interface APCMailbox
public final void setCurrentRequest(JARequest currentRequest)
setCurrentRequest
in interface APCMailbox
currentRequest
- The request message being processed.public final boolean isEmpty()
isEmpty
in interface APCMailbox
public boolean dispatchEvents()
dispatchEvents
in interface APCMailbox
public final void putBufferedEvents(ArrayList<JAMessage> bufferedEvents)
putBufferedEvents
in interface BufferedEventsDestination<JAMessage>
bufferedEvents
- The events to be processed.public final void sendPendingMessages()
sendPendingMessages
in interface APCMailbox
public final void setInitialBufferCapacity(int initialBufferCapacity)
setInitialBufferCapacity
in interface APCMailbox
initialBufferCapacity
- The initial capacity for buffered outgoing messages.public void send(BufferedEventsDestination<JAMessage> destination, JARequest request)
send
in interface APCMailbox
destination
- Buffered events receiver.request
- The request to be sent.public final void response(JARequest jaRequest, Object unwrappedResponse)
response
in interface APCMailbox
unwrappedResponse
- public EventQueue<ArrayList<JAMessage>> getEventQueue()
getEventQueue
in interface APCMailbox
Copyright © 2012. All Rights Reserved.