Package one.microstream.com
Class Com
java.lang.Object
one.microstream.com.Com
public class Com extends Object
-
Constructor Summary
Constructors Constructor Description Com()
-
Method Summary
-
Constructor Details
-
Com
public Com()
-
-
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<SocketChannel> Host(ComPersistenceAdaptorCreator<SocketChannel> persistenceAdaptorCreator) -
Host
public static final ComHost<SocketChannel> Host(int localHostPort, ComPersistenceAdaptorCreator<SocketChannel> persistenceAdaptorCreator) -
Host
public static final ComHost<SocketChannel> Host(InetSocketAddress targetAddress, ComPersistenceAdaptorCreator<SocketChannel> persistenceAdaptorCreator) -
Host
public static final ComHost<SocketChannel> Host(ComPersistenceAdaptorCreator<SocketChannel> persistenceAdaptorCreator, ComHostChannelAcceptor<SocketChannel> channelAcceptor) -
Host
public static final ComHost<SocketChannel> Host(int localHostPort, ComPersistenceAdaptorCreator<SocketChannel> persistenceAdaptorCreator, ComHostChannelAcceptor<SocketChannel> channelAcceptor) -
Host
public static final ComHost<SocketChannel> Host(InetSocketAddress targetAddress, ComPersistenceAdaptorCreator<SocketChannel> persistenceAdaptorCreator, ComHostChannelAcceptor<SocketChannel> channelAcceptor) -
runHost
public static final void runHost(ComPersistenceAdaptorCreator<SocketChannel> persistenceAdaptorCreator) -
runHost
public static final void runHost(int localHostPort, ComPersistenceAdaptorCreator<SocketChannel> persistenceAdaptorCreator) -
runHost
public static final void runHost(InetSocketAddress targetAddress, ComPersistenceAdaptorCreator<SocketChannel> persistenceAdaptorCreator) -
runHost
public static final void runHost(ComPersistenceAdaptorCreator<SocketChannel> persistenceAdaptorCreator, ComHostChannelAcceptor<SocketChannel> channelAcceptor) -
runHost
public static final void runHost(int localHostPort, ComPersistenceAdaptorCreator<SocketChannel> persistenceAdaptorCreator, ComHostChannelAcceptor<SocketChannel> channelAcceptor) -
runHost
public static final void runHost(InetSocketAddress targetAddress, ComPersistenceAdaptorCreator<SocketChannel> persistenceAdaptorCreator, ComHostChannelAcceptor<SocketChannel> channelAcceptor) -
Client
public static final ComClient<SocketChannel> Client(ComPersistenceAdaptorCreator<SocketChannel> persistenceAdaptorCreator) -
Client
public static final ComClient<SocketChannel> Client(int localHostPort, ComPersistenceAdaptorCreator<SocketChannel> persistenceAdaptorCreator) -
Client
public static final ComClient<SocketChannel> Client(InetSocketAddress targetAddress, ComPersistenceAdaptorCreator<SocketChannel> persistenceAdaptorCreator) -
connect
public static final ComClientChannel<SocketChannel> connect(ComPersistenceAdaptorCreator<SocketChannel> persistenceAdaptorCreator) -
connect
public static final ComClientChannel<SocketChannel> connect(int localHostPort, ComPersistenceAdaptorCreator<SocketChannel> persistenceAdaptorCreator) -
connect
public static final ComClientChannel<SocketChannel> connect(InetSocketAddress targetAddress, ComPersistenceAdaptorCreator<SocketChannel> persistenceAdaptorCreator)
-