de.knipp.rritoolkit.test
Class DebugChannelFactory

java.lang.Object
  extended by de.knipp.rritoolkit.test.DebugChannelFactory
All Implemented Interfaces:
ChannelFactory

public class DebugChannelFactory
extends java.lang.Object
implements ChannelFactory

This is a helper class for debugging/logging purposes. It is a wrapper to a factory. The channels returned by this wrapper are also wrapped into a class which prints the communication with the registry to the console.

Version:
$Revision: 14936 $
Author:
Klaus Malorny

Nested Class Summary
private static class DebugChannelFactory.DebugChannel
          wrapper class for a connection.
 
Field Summary
private  int counter
          a counter to allow the identification of the created channels
private  ChannelFactory factory
          the actual factory
 
Constructor Summary
DebugChannelFactory(ChannelFactory theFactory)
          constructor
 
Method Summary
 RegistryChannel createChannel()
          create a new channel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

factory

private ChannelFactory factory
the actual factory


counter

private int counter
a counter to allow the identification of the created channels

Constructor Detail

DebugChannelFactory

public DebugChannelFactory(ChannelFactory theFactory)
constructor

Parameters:
theFactory - the actual factory
Method Detail

createChannel

public RegistryChannel createChannel()
                              throws java.io.IOException
create a new channel. If a implementation or configuration specific limit of number of channels exists and this limit has been reached, null is returned. If a channel could not be created for a different reason, an IOException is thrown. Channels that are no longer used by the caller should be closed

Specified by:
createChannel in interface ChannelFactory
Returns:
the channel or null if no more channels are available
Throws:
java.io.IOException - if the channel could not be created


Copyright © 2005-2011 Knipp Medien und Kommunikation GmbH