Class JeroMQRemoteInvoker
java.lang.Object
dev.getelements.elements.rt.remote.jeromq.JeroMQRemoteInvoker
- All Implemented Interfaces:
RemoteInvoker
-
Field Summary
Fields inherited from interface dev.getelements.elements.rt.remote.RemoteInvoker
DEFAULT_TIMEOUT, DEFAULT_TIMEOUT_UNITS, REMOTE_INVOKER_MAX_CONNECTIONS, REMOTE_INVOKER_MIN_CONNECTIONS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAsyncConnectionService<org.zeromq.ZContext, org.zeromq.ZMQ.Socket> Gets the connection address for thisRemoteInvoker.intintinvokeAsync(Invocation invocation, List<Consumer<InvocationResult>> asyncInvocationResultConsumerList, InvocationErrorConsumer asyncInvocationErrorConsumer) Sends theInvocationto the remote service and waits for theInvocationResult.invokeCompletionStage(Invocation invocation, List<Consumer<InvocationResult>> asyncInvocationResultConsumerList, InvocationErrorConsumer asyncInvocationErrorConsumer) Sends theInvocationto the remote service and waits for theInvocationResult.voidsetAsyncConnectionService(AsyncConnectionService<org.zeromq.ZContext, org.zeromq.ZMQ.Socket> asyncConnectionService) voidsetMaxConnections(int maxConnections) voidsetMinConnections(int minConnections) voidsetPayloadReader(PayloadReader payloadReader) voidsetPayloadWriter(PayloadWriter payloadWriter) voidStarts up thin is complete.voidstop()Stops thisRemoteInvoker.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface dev.getelements.elements.rt.remote.RemoteInvoker
invoke, invokeAsyncV, invokeFuture, invokeSync, start
-
Constructor Details
-
JeroMQRemoteInvoker
public JeroMQRemoteInvoker()
-
-
Method Details
-
getConnectAddress
Description copied from interface:RemoteInvokerGets the connection address for thisRemoteInvoker. This should be the last value passed toRemoteInvoker.start(String)orRemoteInvoker.start(String, long, TimeUnit).- Specified by:
getConnectAddressin interfaceRemoteInvoker- Returns:
- the connect address
-
start
Description copied from interface:RemoteInvokerStarts up thin is complete. The default implementation of this method does nothing in case no setup is necessary.- Specified by:
startin interfaceRemoteInvoker
-
stop
public void stop()Description copied from interface:RemoteInvokerStops thisRemoteInvoker. This method must gracefully shut down all connections and stop any worker threads. THe default implementation of this method does nothing in case no shutdown is necessary.- Specified by:
stopin interfaceRemoteInvoker
-
invokeAsync
public AsyncOperation invokeAsync(Invocation invocation, List<Consumer<InvocationResult>> asyncInvocationResultConsumerList, InvocationErrorConsumer asyncInvocationErrorConsumer) Description copied from interface:RemoteInvokerSends theInvocationto the remote service and waits for theInvocationResult. The suppliedConsumer<InvocationError>will relay all encountered errors. Typically this is used with theDispatch.Type.ASYNCHRONOUS. This returns the generic Void type to clarify the intention of the method that the underlyingFutureis discarded, but since is is intended to be used with reflections code, this allows for the method to be easily adapted as such.- Specified by:
invokeAsyncin interfaceRemoteInvoker- Parameters:
invocation- the outgoingInvocationasyncInvocationResultConsumerList- aList<Consumer<InvocationResult>>to capture all async resultsasyncInvocationErrorConsumer- aConsumer<InvocationError>to receive async errors- Returns:
- an instance of
AsyncOperation
-
invokeCompletionStage
public CompletionStage<Object> invokeCompletionStage(Invocation invocation, List<Consumer<InvocationResult>> asyncInvocationResultConsumerList, InvocationErrorConsumer asyncInvocationErrorConsumer) Description copied from interface:RemoteInvokerSends theInvocationto the remote service and waits for theInvocationResult. The suppliedConsumer<InvocationError>will relay all encountered errors. Typically this is used with theDispatch.Type.FUTURE- Specified by:
invokeCompletionStagein interfaceRemoteInvoker- Parameters:
invocation- the outgoingInvocationasyncInvocationResultConsumerList- aList<Consumer<InvocationResult>>to capture all async resultsasyncInvocationErrorConsumer- aConsumer<InvocationError>to receive async errors- Returns:
- a
Future<Object>which returns the result of the remote invocation
-
getPayloadReader
-
setPayloadReader
-
getPayloadWriter
-
setPayloadWriter
-
getAsyncConnectionService
public AsyncConnectionService<org.zeromq.ZContext,org.zeromq.ZMQ.Socket> getAsyncConnectionService() -
setAsyncConnectionService
@Inject public void setAsyncConnectionService(AsyncConnectionService<org.zeromq.ZContext, org.zeromq.ZMQ.Socket> asyncConnectionService) -
getMinConnections
public int getMinConnections() -
setMinConnections
@Inject public void setMinConnections(@Named("dev.getelements.elements.rt.remote.RemoteInvoker.minConnections") int minConnections) -
getMaxConnections
public int getMaxConnections() -
setMaxConnections
@Inject public void setMaxConnections(@Named("dev.getelements.elements.rt.remote.RemoteInvoker.maxConnections") int maxConnections) -
toString
-