net.jradius.server
Class TCPListener

java.lang.Object
  extended by java.lang.Thread
      extended by net.jradius.server.JRadiusThread
          extended by net.jradius.server.TCPListener
All Implemented Interfaces:
Runnable, Listener
Direct Known Subclasses:
FreeRadiusListener

public abstract class TCPListener
extends JRadiusThread
implements Listener

The base abstract class of all Listeners

Author:
Gert Jan Verhoog, David Bird

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
protected  boolean active
           
protected  int backlog
           
protected  ListenerConfigurationItem config
           
protected  boolean keepAlive
           
protected  List<KeepAliveListener> keepAliveListeners
           
protected  org.apache.commons.logging.Log log
           
protected  int port
           
protected  BlockingQueue<ListenerRequest> queue
           
protected  org.apache.commons.pool.ObjectPool requestObjectPool
           
protected  boolean requiresSSL
           
protected  ServerSocket serverSocket
           
protected  String[] sslEnabledCiphers
           
protected  String[] sslEnabledProtocols
           
protected  boolean sslNeedClientAuth
           
protected  boolean sslWantClientAuth
           
protected  boolean usingSSL
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
TCPListener()
           
 
Method Summary
 void deadKeepAliveListener(KeepAliveListener keepAliveListener)
           
 boolean getActive()
           
 boolean isKeepAlive()
           
 boolean isUsingSSL()
           
 void listen()
          Listen for one object and place it on the request queue
 void run()
          The thread's run method repeatedly calls listen()
 void setActive(boolean active)
           
 void setBacklog(int backlog)
           
 void setConfiguration(ListenerConfigurationItem cfg)
           
 void setConfiguration(ListenerConfigurationItem cfg, boolean noKeepAlive)
           
 void setKeepAlive(boolean keepAlive)
           
 void setListenerConfigurationItem(ListenerConfigurationItem cfg)
          Sets the listeners ConfigurationItem
 void setPort(int port)
           
 void setRequestQueue(BlockingQueue<ListenerRequest> q)
          Sets the request queue for this listener
 void setUsingSSL(boolean usingSSL)
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.jradius.server.Listener
getName, parseRequest, start, stop
 

Field Detail

log

protected org.apache.commons.logging.Log log

active

protected boolean active

config

protected ListenerConfigurationItem config

queue

protected BlockingQueue<ListenerRequest> queue

port

protected int port

backlog

protected int backlog

requiresSSL

protected boolean requiresSSL

usingSSL

protected boolean usingSSL

keepAlive

protected boolean keepAlive

serverSocket

protected ServerSocket serverSocket

keepAliveListeners

protected final List<KeepAliveListener> keepAliveListeners

sslWantClientAuth

protected boolean sslWantClientAuth

sslNeedClientAuth

protected boolean sslNeedClientAuth

sslEnabledProtocols

protected String[] sslEnabledProtocols

sslEnabledCiphers

protected String[] sslEnabledCiphers

requestObjectPool

protected org.apache.commons.pool.ObjectPool requestObjectPool
Constructor Detail

TCPListener

public TCPListener()
Method Detail

setConfiguration

public void setConfiguration(ListenerConfigurationItem cfg)
Specified by:
setConfiguration in interface Listener

setConfiguration

public void setConfiguration(ListenerConfigurationItem cfg,
                             boolean noKeepAlive)
                      throws KeyStoreException,
                             NoSuchAlgorithmException,
                             CertificateException,
                             UnrecoverableKeyException,
                             KeyManagementException,
                             IOException
Throws:
KeyStoreException
NoSuchAlgorithmException
CertificateException
UnrecoverableKeyException
KeyManagementException
IOException

setRequestQueue

public void setRequestQueue(BlockingQueue<ListenerRequest> q)
Sets the request queue for this listener

Specified by:
setRequestQueue in interface Listener
Parameters:
q - the RequestQueue;

setListenerConfigurationItem

public void setListenerConfigurationItem(ListenerConfigurationItem cfg)
Sets the listeners ConfigurationItem

Parameters:
cfg - a configuration item

listen

public void listen()
            throws Exception
Listen for one object and place it on the request queue

Throws:
IOException
InterruptedException
RadiusException
Exception

deadKeepAliveListener

public void deadKeepAliveListener(KeepAliveListener keepAliveListener)

getActive

public boolean getActive()
Specified by:
getActive in interface Listener

setActive

public void setActive(boolean active)
Specified by:
setActive in interface Listener

run

public void run()
The thread's run method repeatedly calls listen()

Specified by:
run in interface Runnable
Overrides:
run in class Thread

isUsingSSL

public boolean isUsingSSL()

isKeepAlive

public boolean isKeepAlive()

setBacklog

public void setBacklog(int backlog)

setKeepAlive

public void setKeepAlive(boolean keepAlive)

setPort

public void setPort(int port)

setUsingSSL

public void setUsingSSL(boolean usingSSL)


Copyright © 2011 Coova Technologies, LLC, All Rights Reserved.