openr66.protocol.networkhandler
Class NetworkChannel

java.lang.Object
  extended by openr66.protocol.networkhandler.NetworkChannel

public class NetworkChannel
extends Object

NetworkChannel object to keep Network channel open while some local channels are attached to it.

Author:
Frederic Bregier

Field Summary
 org.jboss.netty.channel.Channel channel
          Network Channel
 AtomicInteger count
          Number of active Local Channel referencing this Network Channel
 boolean isShuttingDown
          Does this Network Channel is in shutdown
 long lastTimeUsed
          Last Time in ms this channel was used by a LocalChannel
 ConcurrentLinkedQueue<org.jboss.netty.channel.Channel> localChannels
          Associated LocalChannel
 
Constructor Summary
NetworkChannel(org.jboss.netty.channel.Channel networkChannel)
           
 
Method Summary
 void add(org.jboss.netty.channel.Channel localChannel)
           
 boolean equals(Object obj)
           
 int hashCode()
           
 void remove(org.jboss.netty.channel.Channel localChannel)
           
 void shutdownAllLocalChannels()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

count

public volatile AtomicInteger count
Number of active Local Channel referencing this Network Channel


isShuttingDown

public volatile boolean isShuttingDown
Does this Network Channel is in shutdown


localChannels

public ConcurrentLinkedQueue<org.jboss.netty.channel.Channel> localChannels
Associated LocalChannel


channel

public final org.jboss.netty.channel.Channel channel
Network Channel


lastTimeUsed

public long lastTimeUsed
Last Time in ms this channel was used by a LocalChannel

Constructor Detail

NetworkChannel

public NetworkChannel(org.jboss.netty.channel.Channel networkChannel)
Method Detail

add

public void add(org.jboss.netty.channel.Channel localChannel)
         throws OpenR66ProtocolRemoteShutdownException
Throws:
OpenR66ProtocolRemoteShutdownException

remove

public void remove(org.jboss.netty.channel.Channel localChannel)

shutdownAllLocalChannels

public void shutdownAllLocalChannels()

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2009-2012 Frederic Bregier. All Rights Reserved.