|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectinputOutputHandler.InputOutputHandlerController
public final class InputOutputHandlerController
Controller class of component InputOutputHandler
. Implements
the architecture interface InputOutputHandlerInterface
.
Handles communication with clients, other mixes and receivers.
Waits for new connections from clients or other mixes and accepts messages
using the classes ClientConnectionHandler
,
PreviousMixConnectionHandler
,
NextMixConnectionHandler
and
ProxyConnectionHandler
and stores them in a
ConcurrentLinkedQueue
.
The process of accepting connections and receiving messages works in parallel to the mix operations. Therefore, the mix is capable of taking messages at any time (unless it is overloaded).
Sends (already mixed) messages to their destination using the same classes
mentioned above. The mixed messages are stored in a
ConcurrentLinkedQueue
. The process of sending messages works in
parallel to the mix operations. Therefore, the mix is capable of mixing new
messages while sending the old ones.
This class is thread-safe.
Constructor Summary | |
---|---|
InputOutputHandlerController()
Creates a new InputOutputHandler component that handles
communication with clients, other mixes and proxies. |
Method Summary | |
---|---|
void |
acceptConnections()
Makes component listen for connections/messages on communication channels. |
void |
addReplies(Reply[] replies)
Adds all the bypassed (already mixed) Reply ies to the
replyOutputQueue (from where they will be sent to their
destination). |
void |
addReply(Reply reply)
Adds the bypassed (already mixed) Reply to the
replyOutputQueue (from where it will be sent to its
destination). |
void |
addRequest(Request request)
Adds the bypassed (already mixed) Request to the
requestOutputQueue (from where it will be sent to its
destination). |
void |
addRequests(Request[] requests)
Adds all the bypassed (already mixed) Request s to the
requestOutputQueue (from where they will be sent to their
destination). |
Reply |
getReply()
Returns a Reply (previously received, unprocessed) from a
communication partner (e. g. proxy or other mix). |
Request |
getRequest()
Returns a Request (previously received, unprocessed) from a
communication partner (e. g. client or other mix). |
void |
initialize(UserDatabaseController userDatabase,
OutputStrategyController outputStrategy,
ExternalInformationPortController eip)
Initialization method for this component. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public InputOutputHandlerController()
InputOutputHandler
component that handles
communication with clients, other mixes and proxies.
Component can't be used before calling initialize()
.
initialize( UserDatabaseController,
OutputStrategyController,
ExternalInformationPortController)
Method Detail |
---|
public void initialize(UserDatabaseController userDatabase, OutputStrategyController outputStrategy, ExternalInformationPortController eip)
userDatabase
- Reference on component
UserDatabase
.outputStrategy
- Reference on component
OutputStrategy
.eip
- Reference on component
ExternalInformationPort
.public void acceptConnections()
acceptConnections
in interface InputOutputHandlerInterface
public void addRequest(Request request)
Request
to the
requestOutputQueue
(from where it will be sent to its
destination).
Returns immediately (asynchronous behavior), the process of sending itself may be deferred (e. g. if communication channel is busy).
Assures order (queuing strategy) and is thread-safe.
Used by component OutputStrategy
.
addRequest
in interface InputOutputHandlerInterface
request
- Already processed message, that shall be sent to the
next communication partner.getProcessedRequest()
,
addRequests(Request[])
public void addRequests(Request[] requests)
Request
s to the
requestOutputQueue
(from where they will be sent to their
destination).
Returns immediately (asynchronous behavior), the process of sending itself may be deferred (e. g. if communication channel is busy).
Assures order (queuing strategy) and is thread-safe.
Used by component OutputStrategy
.
addRequests
in interface InputOutputHandlerInterface
requests
- Already processed messages, that shall be sent to the
next communication partner.getProcessedRequest()
,
addRequest(Request)
public Request getRequest()
Request
(previously received, unprocessed) from a
communication partner (e. g. client or other mix). If no
Request
s are available, this method blocks until a new
Request
arrives.
Assures order (queuing strategy) and is thread-safe.
getRequest
in interface InputOutputHandlerInterface
Request
.public void addReply(Reply reply)
Reply
to the
replyOutputQueue
(from where it will be sent to its
destination).
Returns immediately (asynchronous behavior), the process of sending itself may be deferred (e. g. if communication channel is busy).
Assures order (queuing strategy) and is thread-safe.
Used by component OutputStrategy
.
addReply
in interface InputOutputHandlerInterface
reply
- Already processed message, that shall be sent to the
next communication partner.getProcessedReply()
,
addReplies(Reply[])
public void addReplies(Reply[] replies)
Reply
ies to the
replyOutputQueue
(from where they will be sent to their
destination).
Returns immediately (asynchronous behavior), the process of sending itself may be deferred (e. g. if communication channel is busy).
Assures order (queuing strategy) and is thread-safe.
Used by component OutputStrategy
.
addReplies
in interface InputOutputHandlerInterface
replies
- Already processed messages, that shall be sent to the
next communication partner.getProcessedReply()
,
addReply(Reply)
public Reply getReply()
Reply
(previously received, unprocessed) from a
communication partner (e. g. proxy or other mix). If no
Reply
ies are available, this method blocks until a new
Reply
arrives.
Assures order (queuing strategy) and is thread-safe.
getReply
in interface InputOutputHandlerInterface
Reply
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |