2010-01-22 1.2.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.

Since:
1.2
Version:
1.2.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
protected MultiplexConnection()
          Constructs an instance of this class.
protected MultiplexConnection(ConfigurationService configuration)
          Constructs an instance of this class from the specified configuration parameter.
 
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)
          Get error severity with the specified error number and error parameters and return the int result.
 int read(byte[] bytes, int offset, int length)
          Read with the specified bytes, offset and length parameters and return the int result.
 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)
          Write with the specified bytes, offset and count parameters.
 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

protected MultiplexConnection()
Constructs an instance of this class.

See Also:
MultiplexConnection(ConfigurationService), #MultiplexConnection(Dictionary)

MultiplexConnection

protected MultiplexConnection(ConfigurationService configuration)
Constructs an instance of this class from the specified configuration parameter.

Parameters:
configuration - The configuration (ConfigurationService) parameter.
See Also:
MultiplexConnection(), #MultiplexConnection(Dictionary)
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)
Get error severity with the specified error number and error parameters and return the int result.

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(byte[] bytes,
                int offset,
                int length)
         throws java.io.IOException
Read with the specified bytes, offset and length parameters and return the int result.

Parameters:
bytes - The bytes (byte[]) parameter.
offset - The offset (int) parameter.
length - The length (int) parameter.
Returns:
Results of the read (int) value.
Throws:
java.io.IOException - IOException.
See Also:
read(ChannelService,byte[])

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.
See Also:
read(byte[],int,int)

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(byte[] bytes,
                  int offset,
                  int count)
           throws java.io.IOException
Write with the specified bytes, offset and count parameters.

Parameters:
bytes - The bytes (byte[]) parameter.
offset - The offset (int) parameter.
count - The count (int) parameter.
Throws:
java.io.IOException - IOException.
See Also:
write(ChannelService,byte[])

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.
See Also:
write(byte[],int,int)

2010-01-22 1.2.0

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