public class SocketConnectorUtility extends Object
Connector
implementations of the socket transport. It is intended to be used via
composition.
Provided methods are generally thread-safe if not indicated otherwise. The
respective instance of this class is used for synchronizing in case clients
of this class need to extend synchronized blocks or interact with the
synchronization strategies of this class.Constructor and Description |
---|
SocketConnectorUtility(SocketOptions socketOptions,
ServerMode serverMode,
ConverterSelectionStrategy<ByteBuffer> converters)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
activate()
Acquires a new
Bus instance and activates it respecting the
requested ServerMode . |
void |
deactivate()
Deactivates the underlying bus instance.
|
Bus |
getBus()
Returns the underlying bus instance when called after
activate()
. |
ConverterSelectionStrategy<ByteBuffer> |
getConverters()
Returns the contained converters to use.
|
boolean |
isActive()
Indicates whether this class has been activated or not.
|
public SocketConnectorUtility(SocketOptions socketOptions, ServerMode serverMode, ConverterSelectionStrategy<ByteBuffer> converters)
socketOptions
- socket options to useserverMode
- the kind of server mode to useconverters
- the converters to use for serializationpublic Bus getBus()
activate()
.null
public ConverterSelectionStrategy<ByteBuffer> getConverters()
public void activate() throws RSBException
Bus
instance and activates it respecting the
requested ServerMode
.RSBException
- error initializing Bus
public void deactivate() throws RSBException, InterruptedException
RSBException
- error deactivating Bus
InterruptedException
- interrupted while waiting for the bus to terminatepublic boolean isActive()
true
if activatedCopyright © 2018 CoR-Lab. All rights reserved.