com.opera.core.systems.scope.stp
Class StpConnectionListener

java.lang.Object
  extended by com.opera.core.systems.scope.stp.StpConnectionListener
All Implemented Interfaces:
SocketListener

public class StpConnectionListener
extends Object
implements SocketListener

This class handles accepting STP connections. STP connections are accepted in the SocketListener.canRead(java.nio.channels.SelectableChannel) method, which then spawns an StpConnection.

Author:
Jan Vidar Krey

Constructor Summary
StpConnectionListener(int port, IConnectionHandler handler, EventHandler eventHandler, boolean manualConnect, SocketMonitor monitor)
           
 
Method Summary
 boolean canRead(SelectableChannel channel)
           
 boolean canWrite(SelectableChannel ch)
           
protected  void finalize()
           
 void start()
          Starts the STP connection listener.
 void stop()
          Shuts down and cleans up the STP connection to Opera.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StpConnectionListener

public StpConnectionListener(int port,
                             IConnectionHandler handler,
                             EventHandler eventHandler,
                             boolean manualConnect,
                             SocketMonitor monitor)
                      throws IOException
Throws:
IOException
Method Detail

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable

stop

public void stop()
Shuts down and cleans up the STP connection to Opera.


start

public void start()
           throws IOException
Starts the STP connection listener.

Throws:
IOException - if unable to bind to address

canRead

public boolean canRead(SelectableChannel channel)
                throws IOException
Specified by:
canRead in interface SocketListener
Returns:
true if more reading is expected.
Throws:
IOException

canWrite

public boolean canWrite(SelectableChannel ch)
                 throws IOException
Specified by:
canWrite in interface SocketListener
Returns:
true if more writing is needed.
Throws:
IOException


Copyright © 2012. All Rights Reserved.