org.jdiameter.server.impl.io.tcp
Class NetworkGuard

java.lang.Object
  extended by org.jdiameter.server.impl.io.tcp.NetworkGuard
All Implemented Interfaces:
java.lang.Runnable, INetworkGuard

public class NetworkGuard
extends java.lang.Object
implements INetworkGuard, java.lang.Runnable


Field Summary
protected  IConcurrentFactory concurrentFactory
           
protected  boolean isWork
           
protected  java.util.concurrent.CopyOnWriteArrayList<INetworkConnectionListener> listeners
           
protected  IMessageParser parser
           
protected  int port
           
protected  java.nio.channels.Selector selector
           
protected  java.net.ServerSocket serverSocket
           
 
Constructor Summary
NetworkGuard(java.net.InetAddress inetAddress, int port, IConcurrentFactory concurrentFactory, IMessageParser parser)
           
NetworkGuard(java.net.InetAddress inetAddress, int port, IMessageParser parser)
          Deprecated. 
 
Method Summary
 void addListener(INetworkConnectionListener listener)
          Append new listener
 void destroy()
          Release all attached resources (socket and etc)
 void remListener(INetworkConnectionListener listener)
          Remove listener
 void run()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

parser

protected IMessageParser parser

concurrentFactory

protected IConcurrentFactory concurrentFactory

port

protected int port

listeners

protected java.util.concurrent.CopyOnWriteArrayList<INetworkConnectionListener> listeners

isWork

protected boolean isWork

selector

protected java.nio.channels.Selector selector

serverSocket

protected java.net.ServerSocket serverSocket
Constructor Detail

NetworkGuard

@Deprecated
public NetworkGuard(java.net.InetAddress inetAddress,
                               int port,
                               IMessageParser parser)
             throws java.lang.Exception
Deprecated. 

Throws:
java.lang.Exception

NetworkGuard

public NetworkGuard(java.net.InetAddress inetAddress,
                    int port,
                    IConcurrentFactory concurrentFactory,
                    IMessageParser parser)
             throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

run

public void run()
Specified by:
run in interface java.lang.Runnable

addListener

public void addListener(INetworkConnectionListener listener)
Description copied from interface: INetworkGuard
Append new listener

Specified by:
addListener in interface INetworkGuard
Parameters:
listener - listener instance

remListener

public void remListener(INetworkConnectionListener listener)
Description copied from interface: INetworkGuard
Remove listener

Specified by:
remListener in interface INetworkGuard
Parameters:
listener - listener instance

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

destroy

public void destroy()
Description copied from interface: INetworkGuard
Release all attached resources (socket and etc)

Specified by:
destroy in interface INetworkGuard


Copyright © 2010. All Rights Reserved.