public class Reactor
extends java.lang.Object
ReactorFactory.createReactor(ReactorOptions, ReactorErrorInfo),
create connections by calling connect(ReactorConnectOptions, ReactorRole, ReactorErrorInfo)/
accept(com.thomsonreuters.upa.transport.Server, ReactorAcceptOptions, ReactorRole, ReactorErrorInfo) and
process events by calling ReactorChannel.dispatch(ReactorDispatchOptions, ReactorErrorInfo)/
dispatchAll(Set, ReactorDispatchOptions, ReactorErrorInfo).ReactorChannel,
ReactorFactory.createReactor(com.thomsonreuters.upa.valueadd.reactor.ReactorOptions, com.thomsonreuters.upa.valueadd.reactor.ReactorErrorInfo),
shutdown(com.thomsonreuters.upa.valueadd.reactor.ReactorErrorInfo),
connect(com.thomsonreuters.upa.valueadd.reactor.ReactorConnectOptions, com.thomsonreuters.upa.valueadd.reactor.ReactorRole, com.thomsonreuters.upa.valueadd.reactor.ReactorErrorInfo),
accept(com.thomsonreuters.upa.transport.Server, com.thomsonreuters.upa.valueadd.reactor.ReactorAcceptOptions, com.thomsonreuters.upa.valueadd.reactor.ReactorRole, com.thomsonreuters.upa.valueadd.reactor.ReactorErrorInfo),
ReactorChannel.dispatch(com.thomsonreuters.upa.valueadd.reactor.ReactorDispatchOptions, com.thomsonreuters.upa.valueadd.reactor.ReactorErrorInfo),
dispatchAll(java.util.Set<java.nio.channels.SelectionKey>, com.thomsonreuters.upa.valueadd.reactor.ReactorDispatchOptions, com.thomsonreuters.upa.valueadd.reactor.ReactorErrorInfo),
ReactorChannel.submit(com.thomsonreuters.upa.transport.TransportBuffer, com.thomsonreuters.upa.valueadd.reactor.ReactorSubmitOptions, com.thomsonreuters.upa.valueadd.reactor.ReactorErrorInfo),
ReactorChannel.close(com.thomsonreuters.upa.valueadd.reactor.ReactorErrorInfo)| Modifier and Type | Method and Description |
|---|---|
int |
accept(com.thomsonreuters.upa.transport.Server server,
ReactorAcceptOptions reactorAcceptOptions,
ReactorRole role,
ReactorErrorInfo errorInfo)
Adds a server-side channel to the Reactor.
|
int |
connect(ReactorConnectOptions reactorConnectOptions,
ReactorRole role,
ReactorErrorInfo errorInfo)
Adds a client-side channel to the Reactor.
|
int |
dispatchAll(java.util.Set<java.nio.channels.SelectionKey> keySet,
ReactorDispatchOptions dispatchOptions,
ReactorErrorInfo errorInfo)
Process all channels' events and messages from the Reactor.
|
boolean |
isShutdown()
Returns whether or not the Reactor is shutdown.
|
int |
queryServiceDiscovery(ReactorServiceDiscoveryOptions options,
ReactorErrorInfo errorInfo)
Queries EDP-RT service discovery to get service endpoint information.
|
ReactorChannel |
reactorChannel()
The Reactor's internal channel that's used to communicate with the worker thread.
|
int |
shutdown(ReactorErrorInfo errorInfo)
Shuts down and cleans up a Reactor.
|
int |
submitChannel(ReactorChannel reactorChannel,
MsgBase rdmMsg,
ReactorSubmitOptions submitOptions,
ReactorErrorInfo errorInfo) |
java.lang.Object |
userSpecObj()
Returns the userSpecObj that was specified in the ReactorOptions when
this Reactor was created.
|
public java.lang.Object userSpecObj()
public boolean isShutdown()
public int shutdown(ReactorErrorInfo errorInfo)
errorInfo - Error structure to be populated in the event of an errorReactorReturnCodes indicating success or failurepublic ReactorChannel reactorChannel()
public int accept(com.thomsonreuters.upa.transport.Server server,
ReactorAcceptOptions reactorAcceptOptions,
ReactorRole role,
ReactorErrorInfo errorInfo)
server - server that is accepting this connection (a server can be created with Transport.bind(com.thomsonreuters.upa.transport.BindOptions, com.thomsonreuters.upa.transport.Error))reactorAcceptOptions - options for this connectionrole - role of this connectionerrorInfo - error structure to be populated in the event of failureReactorReturnCodes indicating success or failurepublic int connect(ReactorConnectOptions reactorConnectOptions, ReactorRole role, ReactorErrorInfo errorInfo)
reactorConnectOptions - options for this connectionrole - role of this connectionerrorInfo - error structure to be populated in the event of failureReactorReturnCodes indicating success or failurepublic int queryServiceDiscovery(ReactorServiceDiscoveryOptions options, ReactorErrorInfo errorInfo)
options - The ReactorServiceDiscoveryOptions to configure options and specify the
ReactorServiceEndpointEventCallback to receive service endpoint information.errorInfo - error structure to be populated in the event of failureReactorReturnCodes indicating success or failurepublic int submitChannel(ReactorChannel reactorChannel, MsgBase rdmMsg, ReactorSubmitOptions submitOptions, ReactorErrorInfo errorInfo)
public int dispatchAll(java.util.Set<java.nio.channels.SelectionKey> keySet,
ReactorDispatchOptions dispatchOptions,
ReactorErrorInfo errorInfo)
keySet - key set from the selector's registered channelsdispatchOptions - options for how to dispatcherrorInfo - error structure to be populated in the event of failureReactorReturnCodes.SUCCESS if dispatching succeeded and there are no more messages to process or
ReactorReturnCodes.FAILURE, if dispatching failed (refer to errorInfo for additional information)Copyright @ 2019 Thomson Reuters. All Rights Reserved.