2008-07-29 1.1.0

org.eclipse.soda.dk.multiplex.connection
Class MultiplexConnection

java.lang.Object
  extended by Connection
      extended by org.eclipse.soda.dk.multiplex.connection.MultiplexConnection

public abstract class MultiplexConnection
extends Connection

The MultiplexConnection class implements the MultiplexConnectionService interface.

Version:
1.1.0
See Also:
org.eclipse.soda.dk.multiplex.connection.service.MultiplexConnectionService

Field Summary
protected static int[] CHANNEL_STATE_RESOURCE_TABLE
          Define the channel state resource table (int[]) constant.
 
Constructor Summary
MultiplexConnection()
           
 
Method Summary
 void channelChanged(ChannelService channel, int newState, int oldState)
          Channel changed with the specified channel, new state and old state parameters.
protected  java.lang.String createChannelId()
          Create channel id and return the String result.
 ChannelService getChannel(java.lang.String channelId)
          Get channel with the specified channel id parameter and return the ChannelService result.
 java.util.Map getChannels()
          Gets the channels (Map) value.
 MultiplexConnectionListener getConnectionListener()
          Gets the connection listener (MultiplexConnectionListener) value.
protected  int getErrorSeverity(int errorNumber, java.lang.Throwable error)
           
 int read(byte[] bytes, int offset, int length)
           
 int read(ChannelService channel, byte[] bytes)
          Read bytes.
 void setConnectionListener(MultiplexConnectionListener connectionListener)
          Sets the connection listener value.
 void write(byte[] bytes, int offset, int count)
           
 void write(ChannelService channel, byte[] bytes)
          Writes count bytes from the byte array buffer starting at offset.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CHANNEL_STATE_RESOURCE_TABLE

protected static final int[] CHANNEL_STATE_RESOURCE_TABLE
Define the channel state resource table (int[]) constant.

Constructor Detail

MultiplexConnection

public MultiplexConnection()
Method Detail

channelChanged

public void channelChanged(ChannelService channel,
                           int newState,
                           int oldState)
Channel changed with the specified channel, new state and old state parameters.

Parameters:
channel - The channel (ChannelService) parameter.
newState - The new state (int) parameter.
oldState - The old state (int) parameter.

createChannelId

protected java.lang.String createChannelId()
Create channel id and return the String result.

Returns:
Results of the create channel id (String) value.

getChannel

public ChannelService getChannel(java.lang.String channelId)
Get channel with the specified channel id parameter and return the ChannelService result.

Parameters:
channelId - The channel id (String) parameter.
Returns:
Results of the get channel (ChannelService) value.

getChannels

public java.util.Map getChannels()
Gets the channels (Map) value.

Returns:
The channels (Map) value.

getConnectionListener

public MultiplexConnectionListener getConnectionListener()
Gets the connection listener (MultiplexConnectionListener) value.

Returns:
The connection listener (MultiplexConnectionListener) value.
See Also:
setConnectionListener(MultiplexConnectionListener)

getErrorSeverity

protected int getErrorSeverity(int errorNumber,
                               java.lang.Throwable error)
Parameters:
errorNumber - The error number (int) parameter.
error - The error (Throwable) parameter.
Returns:
Results of the get error severity (int) value.

read

public int read(ChannelService channel,
                byte[] bytes)
         throws java.io.IOException
Read bytes.

Parameters:
channel - The channel (ChannelService) parameter.
bytes - The bytes (byte[]) parameter.
Returns:
the number of bytes actually read or -1 if end of stream. If the stream is already closed or another IOException occurs.
Throws:
java.io.IOException - IOException.

setConnectionListener

public void setConnectionListener(MultiplexConnectionListener connectionListener)
Sets the connection listener value.

Parameters:
connectionListener - The connection listener (MultiplexConnectionListener) parameter.
See Also:
getConnectionListener()

write

public void write(ChannelService channel,
                  byte[] bytes)
           throws java.io.IOException
Writes count bytes from the byte array buffer starting at offset.

Parameters:
channel - The channel (ChannelService) parameter.
bytes - The bytes (byte[]) parameter.
Throws:
java.io.IOException - IOException.

write

public void write(byte[] bytes,
                  int offset,
                  int count)
           throws java.io.IOException
Throws:
java.io.IOException

read

public int read(byte[] bytes,
                int offset,
                int length)
         throws java.io.IOException
Throws:
java.io.IOException

2008-07-29 1.1.0

Copyright (c) 2008 IBM. See license in Legal section.