org.mortbay.loadbalancer
Class Listener

java.lang.Object
  extended by org.mortbay.util.LifeCycleThread
      extended by org.mortbay.loadbalancer.Listener
All Implemented Interfaces:
java.lang.Runnable, LifeCycle

public class Listener
extends LifeCycleThread


Constructor Summary
Listener()
           
Listener(ByteBufferPool pool, InetAddrPort address, Policy policy)
           
Listener(ByteBufferPool pool, java.net.InetSocketAddress address, Policy policy)
           
 
Method Summary
 ByteBufferPool getBufferPool()
           
 java.net.InetSocketAddress getInetSocketAddress()
           
 Policy getPolicy()
           
 java.nio.channels.Selector getSelector()
           
 void loop()
           
 void setBufferPool(ByteBufferPool bufferPool)
           
 void setInetSocketAddress(java.net.InetSocketAddress address)
           
 void start()
          Start the LifeCycle.
 void stop()
          Stop the LifeCycle.
 
Methods inherited from class org.mortbay.util.LifeCycleThread
error, exception, getThread, isDaemon, isStarted, run, setDaemon
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Listener

public Listener()
         throws java.io.IOException
Throws:
java.io.IOException

Listener

public Listener(ByteBufferPool pool,
                java.net.InetSocketAddress address,
                Policy policy)
         throws java.io.IOException
Throws:
java.io.IOException

Listener

public Listener(ByteBufferPool pool,
                InetAddrPort address,
                Policy policy)
         throws java.io.IOException
Throws:
java.io.IOException
Method Detail

getSelector

public java.nio.channels.Selector getSelector()

getPolicy

public Policy getPolicy()

getInetSocketAddress

public java.net.InetSocketAddress getInetSocketAddress()

setInetSocketAddress

public void setInetSocketAddress(java.net.InetSocketAddress address)

getBufferPool

public ByteBufferPool getBufferPool()

setBufferPool

public void setBufferPool(ByteBufferPool bufferPool)

start

public void start()
           throws java.lang.Exception
Description copied from interface: LifeCycle
Start the LifeCycle.

Specified by:
start in interface LifeCycle
Overrides:
start in class LifeCycleThread
Throws:
java.lang.Exception - An arbitrary exception may be thrown.

stop

public void stop()
          throws java.lang.InterruptedException
Description copied from interface: LifeCycle
Stop the LifeCycle. The LifeCycle may wait for current activities to complete normally, but it can be interrupted.

Specified by:
stop in interface LifeCycle
Overrides:
stop in class LifeCycleThread
Throws:
java.lang.InterruptedException - Stopping a lifecycle is rarely atomic and may be interrupted by another thread. If this happens InterruptedException is throw and the component will be in an indeterminant state and should probably be discarded.

loop

public void loop()
          throws java.lang.Exception
Specified by:
loop in class LifeCycleThread
Throws:
java.lang.InterruptedException
java.io.InterruptedIOException
java.lang.Exception


Copyright © 2004 Mortbay Consulting Pty. Ltd. All Rights Reserved.