Class Com
java.lang.Object
one.microstream.communication.types.Com
public class Com extends Object
-
Method Summary
-
Method Details
-
defaultObjectIdBaseHost
public static long defaultObjectIdBaseHost() -
defaultObjectIdBaseClient
public static long defaultObjectIdBaseClient() -
DefaultIdStrategy
-
DefaultIdStrategyHost
-
DefaultIdStrategyClient
-
DefaultIdStrategyHostInitialization
-
byteOrder
-
defaultPort
public static int defaultPort()An arbitrary default port, mostly only viable for uber-simplicity demonstration purposes.- Returns:
- the framework's default port.
-
localHostSocketAddress
- Throws:
ComException
-
localHostSocketAddress
- Throws:
ComException
-
Foundation
-
defaultProtocolLengthDigitCount
public static int defaultProtocolLengthDigitCount() -
bufferProtocol
public static ByteBuffer bufferProtocol(ComProtocol protocol, ComProtocolStringConverter protocolStringConverter) -
bufferProtocol
public static ByteBuffer bufferProtocol(ComProtocol protocol, ComProtocolStringConverter protocolStringConverter, int protocolLengthDigitCount) -
assembleSendableProtocolBytes
public static byte[] assembleSendableProtocolBytes(ComProtocol protocol, ComProtocolStringConverter protocolStringConverter) -
assembleSendableProtocolBytes
public static byte[] assembleSendableProtocolBytes(ComProtocol protocol, ComProtocolStringConverter protocolStringConverter, int lengthCharCount) -
assembleSendableProtocolString
public static VarString assembleSendableProtocolString(ComProtocol protocol, ComProtocolStringConverter protocolStringConverter, int lengthCharCount) -
assembleSendableProtocolString
public static VarString assembleSendableProtocolString(VarString vs, ComProtocol protocol, ComProtocolStringConverter protocolStringConverter, int lengthCharCount) -
bounce
This method is catastrophically naive. And by design. Its only purpose and viability is to serve as an uber-simplicity default implementation forComHostChannelAcceptor
for framework demonstration purposes.Used logic:
- uses
SocketChannel
. - calls
ComChannel.receive()
on the passed channel. - calls
Object.toString()
on the received instance to assemble itsString
representation. - sends a new
String
echoing the string representation back to the sender. - calls
ComChannel.close()
on the passed channel.
Object.toString()
implementation is and works only with strings and closes the channel after one sent message. It is absolutely not recommended to use this method for anything except basic demonstration purposes and as an API usage/learning example./!\ DO NOT USE THIS METHOD FOR PRODUCTION Purposes!
You have been warned.
- Parameters:
channel
- A one-shotComHostChannel
to receive and send exactely one message.- Throws:
ComException
- uses
-
Host
public static final ComHost<ComConnection> Host(ComPersistenceAdaptorCreator<ComConnection> persistenceAdaptorCreator) -
Host
public static final ComHost<ComConnection> Host(int localHostPort, ComPersistenceAdaptorCreator<ComConnection> persistenceAdaptorCreator) -
Host
public static final ComHost<ComConnection> Host(InetSocketAddress targetAddress, ComPersistenceAdaptorCreator<ComConnection> persistenceAdaptorCreator) -
Host
public static final ComHost<ComConnection> Host(ComPersistenceAdaptorCreator<ComConnection> persistenceAdaptorCreator, ComHostChannelAcceptor<ComConnection> channelAcceptor) -
Host
public static final ComHost<ComConnection> Host(int localHostPort, ComPersistenceAdaptorCreator<ComConnection> persistenceAdaptorCreator, ComHostChannelAcceptor<ComConnection> channelAcceptor) -
Host
public static final ComHost<ComConnection> Host(InetSocketAddress targetAddress, ComPersistenceAdaptorCreator<ComConnection> persistenceAdaptorCreator, ComHostChannelAcceptor<ComConnection> channelAcceptor) -
runHost
public static final void runHost(ComPersistenceAdaptorCreator<ComConnection> persistenceAdaptorCreator) -
runHost
public static final void runHost(int localHostPort, ComPersistenceAdaptorCreator<ComConnection> persistenceAdaptorCreator) -
runHost
public static final void runHost(InetSocketAddress targetAddress, ComPersistenceAdaptorCreator<ComConnection> persistenceAdaptorCreator) -
runHost
public static final void runHost(ComPersistenceAdaptorCreator<ComConnection> persistenceAdaptorCreator, ComHostChannelAcceptor<ComConnection> channelAcceptor) -
runHost
public static final void runHost(int localHostPort, ComPersistenceAdaptorCreator<ComConnection> persistenceAdaptorCreator, ComHostChannelAcceptor<ComConnection> channelAcceptor) -
runHost
public static final void runHost(InetSocketAddress targetAddress, ComPersistenceAdaptorCreator<ComConnection> persistenceAdaptorCreator, ComHostChannelAcceptor<ComConnection> channelAcceptor) -
Client
public static final ComClient<ComConnection> Client(ComPersistenceAdaptorCreator<ComConnection> persistenceAdaptorCreator) -
Client
public static final ComClient<ComConnection> Client(int localHostPort, ComPersistenceAdaptorCreator<ComConnection> persistenceAdaptorCreator) -
Client
public static final ComClient<ComConnection> Client(InetSocketAddress targetAddress, ComPersistenceAdaptorCreator<ComConnection> persistenceAdaptorCreator) -
connect
public static final ComClientChannel<ComConnection> connect(ComPersistenceAdaptorCreator<ComConnection> persistenceAdaptorCreator) -
connect
public static final ComClientChannel<ComConnection> connect(int localHostPort, ComPersistenceAdaptorCreator<ComConnection> persistenceAdaptorCreator) -
connect
public static final ComClientChannel<ComConnection> connect(InetSocketAddress targetAddress, ComPersistenceAdaptorCreator<ComConnection> persistenceAdaptorCreator)
-