public static class RPCServer.Builder
extends org.hobbit.core.rabbit.DataReceiverImpl.Builder
| Modifier and Type | Field and Description |
|---|---|
private org.hobbit.core.rabbit.RabbitQueueFactory |
responseFactory |
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
org.hobbit.core.rabbit.DataReceiverImpl |
build()
Builds the
DataReceiverImpl instance with the previously given
information. |
RPCServer.Builder |
dataHandler(org.hobbit.core.rabbit.DataHandler dataHandler)
Sets the handler that is called if data is incoming.
|
RPCServer.Builder |
maxParallelProcessedMsgs(int maxParallelProcessedMsgs)
Sets the maximum number of incoming messages that are processed in parallel.
|
RPCServer.Builder |
responseQueueFactory(org.hobbit.core.rabbit.RabbitQueueFactory factory)
Method for providing the necessary information to connect to the queue to
which responses should be sent.
|
public RPCServer.Builder dataHandler(org.hobbit.core.rabbit.DataHandler dataHandler)
RespondingDataHandler is expected.dataHandler in class org.hobbit.core.rabbit.DataReceiverImpl.BuilderdataHandler - the RespondingDataHandler instance that is called if data is
incomingpublic RPCServer.Builder responseQueueFactory(org.hobbit.core.rabbit.RabbitQueueFactory factory)
RPCServer instance is still working but might have
performance problems or might get stuck.factory - the queue factory used to connect topublic RPCServer.Builder maxParallelProcessedMsgs(int maxParallelProcessedMsgs)
maxParallelProcessedMsgs in class org.hobbit.core.rabbit.DataReceiverImpl.BuildermaxParallelProcessedMsgs - the maximum number of incoming messages that are processed in
parallelpublic org.hobbit.core.rabbit.DataReceiverImpl build()
throws IllegalStateException,
IOException
DataReceiverImpl instance with the previously given
information.build in class org.hobbit.core.rabbit.DataReceiverImpl.BuilderIllegalStateException - if the dataHandler is missing or if neither a queue nor the
information needed to create a queue have been provided.IOException - if an exception is thrown while creating a new queue or if the
given queue can not be configured by the newly created
DataReceiver. Note that in the latter case the queue will
be closed.Copyright © 2017–2019. All rights reserved.