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
-
-
-
Method Detail
-
defaultObjectIdBaseHost
public static long defaultObjectIdBaseHost()
-
defaultObjectIdBaseClient
public static long defaultObjectIdBaseClient()
-
DefaultIdStrategy
public static ComDefaultIdStrategy DefaultIdStrategy(long startingObjectId)
-
DefaultIdStrategyHost
public static ComDefaultIdStrategy DefaultIdStrategyHost()
-
DefaultIdStrategyClient
public static ComDefaultIdStrategy DefaultIdStrategyClient()
-
DefaultIdStrategyHostInitialization
public static PersistenceIdStrategy DefaultIdStrategyHostInitialization()
-
byteOrder
public static ByteOrder 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
public static InetSocketAddress localHostSocketAddress() throws ComException
- Throws:
ComException
-
localHostSocketAddress
public static InetSocketAddress localHostSocketAddress(int port) throws ComException
- Throws:
ComException
-
Foundation
public static ComFoundation.Default<?> 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
public static void bounce(ComHostChannel<SocketChannel> channel) throws ComException
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)
-
-