gr.uoa.di.madgik.commons.channel.proxy.tcp
Class ChannelTCPConnManagerEntry
java.lang.Object
gr.uoa.di.madgik.commons.channel.proxy.tcp.ChannelTCPConnManagerEntry
- All Implemented Interfaces:
- ITCPConnectionManagerEntry
public class ChannelTCPConnManagerEntry
- extends java.lang.Object
- implements ITCPConnectionManagerEntry
This class follows the singleton pattern to initialize a single TCP server
capable of servicing outlet requests outside the boundaries of a VM. the first
time it is needed, the server is initialize to listen to a port chosen
from within a configurable selection of ranges or a random one. Everytime an
outlet is connected to the port, the server waits to read the channel UUID
the outlet is interested in, as well as the nozzle's identifier, updates
the ChannelRegistry
through ChannelRegistryEntry.RegisterNozzle(RegisteredNozzle)
and waits for the next outlet to connect. Inlets initialized to
use the server will query the server to retrieve the socket they are interested
in based on the channel UUID they serve. From the above description it is obvious
that if an outlet opens a connection and then does not provide the channel UUID, no
other outlet can connect.
TODO fix denial of service?
TODO refactor comments to reflect current
- Author:
- gpapanikos
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ChannelTCPConnManagerEntry
public ChannelTCPConnManagerEntry()
GetName
public ITCPConnectionManagerEntry.NamedEntry GetName()
- Specified by:
GetName
in interface ITCPConnectionManagerEntry
HandleConnection
public void HandleConnection(java.net.Socket socket)
- Specified by:
HandleConnection
in interface ITCPConnectionManagerEntry