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:
java.lang.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
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
protected  ListenerConfigurationItem config
           
protected  java.util.concurrent.BlockingQueue<ListenerRequest> queue
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
TCPListener()
           
 
Method Summary
 void deadKeepAliveListener(KeepAliveListener keepAliveListener)
           
 boolean isActive()
           
 boolean isKeepAlive()
           
 boolean isUsingSSL()
           
 void listen()
          Listen for one object and place it on the request queue
abstract  JRadiusEvent parseRequest(java.io.InputStream inputStream)
           
 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(java.util.concurrent.BlockingQueue<ListenerRequest> q)
          Sets the request queue for this listener
 void setUsingSSL(boolean usingSSL)
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.jradius.server.Listener
getName, start, stop
 

Field Detail

config

protected ListenerConfigurationItem config

queue

protected java.util.concurrent.BlockingQueue<ListenerRequest> queue
Constructor Detail

TCPListener

public TCPListener()
Method Detail

parseRequest

public abstract JRadiusEvent parseRequest(java.io.InputStream inputStream)
                                   throws java.io.IOException,
                                          RadiusException
Specified by:
parseRequest in interface Listener
Throws:
java.io.IOException
RadiusException

setConfiguration

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

setConfiguration

public void setConfiguration(ListenerConfigurationItem cfg,
                             boolean noKeepAlive)
                      throws java.security.KeyStoreException,
                             java.security.NoSuchAlgorithmException,
                             java.security.cert.CertificateException,
                             java.security.UnrecoverableKeyException,
                             java.security.KeyManagementException,
                             java.io.IOException
Throws:
java.security.KeyStoreException
java.security.NoSuchAlgorithmException
java.security.cert.CertificateException
java.security.UnrecoverableKeyException
java.security.KeyManagementException
java.io.IOException

setRequestQueue

public void setRequestQueue(java.util.concurrent.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 java.io.IOException,
                   java.lang.InterruptedException,
                   RadiusException
Listen for one object and place it on the request queue

Throws:
java.io.IOException
java.lang.InterruptedException
RadiusException

deadKeepAliveListener

public void deadKeepAliveListener(KeepAliveListener keepAliveListener)

isActive

public boolean isActive()

setActive

public void setActive(boolean active)

run

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

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.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 © 2008 JRadius Project, All Rights Reserved.