Package cl.netswitch.lib.channel


package cl.netswitch.lib.channel
Classes and interfaces to build external components that operate inside the NetSwitch server. These external components are specified in the configuration file of the switch. They are dynamically loaded, and then invoked when specific server events occur.

The NetSwitch server has two types of devices: Connectors and Listeners. A Connector (or client) connects to a remote listener, and can have only one bidirectional communication channel (or socket). A Listener (or server) waits for connections from remote clients, and can have several bidirectional communication channels, one for each client.

A ChannelFilter is an external component. Each time a Connector or Listener channel is created, a new instance of a ChannelFilter is initialized and bound to the channel. From that point on, every inbound or outbound Message is passed to the ChannelFilter for inspection and possible modification. Finally, when the channel is closed, the ChannelFilter instance is terminated and released.

A ChannelCodec is another type of external component. Each time a Connector or Listener channel receives input bytes, it calls the ChannelCodec to decode the bytes and produce an inbound Message. Also, each time a channel writes a Message, it calls the ChannelCodec to encode the message into an outbound sequence of bytes.

See Also: