de.knipp.rritoolkit
Class SinglePort

java.lang.Object
  extended by de.knipp.rritoolkit.SinglePort
All Implemented Interfaces:
Port

public class SinglePort
extends java.lang.Object
implements Port

implementation of the Port interface that operates on a single channel. The port may be used by multiple threads in parallel.

Version:
$Revision: 14936 $
Author:
Klaus Malorny

Field Summary
private  RegistryChannel channel
          the channel
private  Codec codec
          the codec
 
Constructor Summary
SinglePort(ChannelFactory factory)
          constructor
SinglePort(ChannelFactory factory, Codec theCodec)
          constructor
SinglePort(RegistryChannel theChannel, Codec theCodec)
          constructor
 
Method Summary
 Response execute(Request request)
          "execute" a request, i.e. send it to the registry and wait for the response
 RegistryChannel getChannel()
          return the channel that is used.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

channel

private RegistryChannel channel
the channel


codec

private Codec codec
the codec

Constructor Detail

SinglePort

public SinglePort(ChannelFactory factory,
                  Codec theCodec)
           throws java.io.IOException
constructor

Parameters:
factory - the factory for the channel
theCodec - the codec to use. If null, a default codec is used
Throws:
java.io.IOException - if no channel could be created

SinglePort

public SinglePort(RegistryChannel theChannel,
                  Codec theCodec)
constructor

Parameters:
theChannel - an already allocated channel
theCodec - the codec to use. If null, a default codec is used

SinglePort

public SinglePort(ChannelFactory factory)
           throws java.io.IOException
constructor

Parameters:
factory - the factory for the channel
Throws:
java.io.IOException - if no channel could be created
Method Detail

execute

public Response execute(Request request)
                 throws java.io.IOException
"execute" a request, i.e. send it to the registry and wait for the response

Specified by:
execute in interface Port
Parameters:
request - the request
Returns:
the response received
Throws:
java.io.IOException - if either the transmission or the reception failed

getChannel

public RegistryChannel getChannel()
return the channel that is used.

Returns:
the channel


Copyright © 2005-2011 Knipp Medien und Kommunikation GmbH