public class Pivot extends Object
The Pivot runs several types:
The interaction between connections, threads, requests and replies is as follows:
Each channel is associated with a SelectorThread. A SelectorThread manages all channels. SelectorThread is a thread that listens for incoming Request Packet. When a Request Packet arrives at a channel, SelectorThread builds a small bus packet that contains the channel info and dispatches it to the worker threads' queue. An available worker thread receives the bus packet from the queue, reads the Request Packet from the associated channel, performs the invocation (an up-call to the LRMI Runtime), builds a Reply Packet from the result and sends it through the channel.
A channel is closed implicitly if an IO Exception is thrown when reading or writing to the channel (for example, because the client socket is closed).
A future enhancement is to support automatic closing of channels that are inactive for a period of time. This also implies a keep-alive mechanism.
Modifier and Type | Class and Description |
---|---|
static class |
Pivot.ServerRemoteClassProviderProvider |
Constructor and Description |
---|
Pivot(NIOConfiguration config,
ProtocolAdapter protocol) |
public Pivot(NIOConfiguration config, ProtocolAdapter protocol) throws IOException
IOException
public int getPort()
public String getHostName()
public static boolean isMonitorActivity()
public boolean handleExceptionFromServer(Writer writer, Reader reader, Throwable ex)
public ChannelEntry newConnection(ReadSelectorThread readHandler, SelectionKey key)
public void closeConnection(ChannelEntry channelEntry)
public void handleProtocolValidation(ChannelEntry channelEntry, Reader.ProtocolValidationContext context, ReadSelectorThread handler)
public void handleReadRequest(ChannelEntry channelEntry, Reader.Context ctx, ReadSelectorThread handler)
channelEntry
- the channel representing the client connection.public void requestPending(ChannelEntry channel, ReplyPacket<?> respPacket, IResponseContext responseContext)
public ChannelEntry getChannelEntryFromChannel(SocketChannel channel)
public InetSocketAddress getServerBindInetSocketAddress()
public void handleRequest(RequestPacket requestPacket, ChannelEntry channelEntry)
requestPacket
- the requestchannelEntry
- a channel(socket) wrapperpublic static String extractMonitoringId(RequestPacket requestPacket)
public void sendResponse(ChannelEntry channelEntry, ReplyPacket replyPacket, IResponseContext respContext)
protected List<ChannelEntry> getChannels(long remoteObjID)
public void unexport(long remoteObjID)
public List<ITransportConnection> getRemoteObjectConnectionsList(long remoteObjID)
public int countRemoteObjectConnections(long remoteObjID)
public boolean isProtocolValidationEnabled()
public LRMIInboundMonitoringDetailsImpl getMonitoringDetails()
public SystemRequestHandler getSystemRequestHandler()
public ChannelEntry.State getChannelEntryState(SocketAddress monitoredClient)
Copyright © GigaSpaces.