org.caleigo.toolkit.tunnel
Class HTTPTunnelServer

java.lang.Object
  extended byorg.caleigo.toolkit.tunnel.AbstractTunnelServer
      extended byorg.caleigo.toolkit.tunnel.HTTPTunnelServer
All Implemented Interfaces:
ITunnelListener, ITunnelServer

public class HTTPTunnelServer
extends AbstractTunnelServer

Version:
1.00
Author:
Mattias Hagstrand

Nested Class Summary
protected  class HTTPTunnelServer.CloseMessageConsumer
           
protected  class HTTPTunnelServer.HTTPInputStream
           
 
Field Summary
protected  int mCurrentSessionID
           
protected  java.util.Hashtable mRegisteredTunnels
           
 
Fields inherited from class org.caleigo.toolkit.tunnel.AbstractTunnelServer
mIsInitialized, mMessageConsumers, mRegisteredCodecs, mRegisteredPackers, mTunnels, mTunnelServerListeners
 
Constructor Summary
HTTPTunnelServer()
           
 
Method Summary
protected  void closeConnection(int sessionID)
           
 void connectionLost(TunnelEvent event)
          Invoked on an ITunnel on the client side when the connection to the server has been lost.
protected  int createSessionID()
           
protected  void doOnTunnelClosed(ITunnel tunnel)
           
protected  void handleInputData(int sessionID, byte[] data)
           
protected  void newConnection(java.lang.Object connectionMessage, java.io.OutputStream outputStream, int sessionID)
          Sets up a new connection.
 void tunnelClosed(TunnelEvent event)
          Invoked when the ITunnel has been closed.
protected  void waitForSessionClose(java.lang.Integer sessionID)
           
 
Methods inherited from class org.caleigo.toolkit.tunnel.AbstractTunnelServer
addMessageConsumer, addTunnel, addTunnelServerListener, finalize, fireTunnelAddedEvent, fireTunnelRemovedEvent, getCodec, getPacker, getTunnel, getTunnelCount, getTunnels, initialize, registerCodec, registerPacker, removeMessageConsumer, removeTunnel, removeTunnelServerListener, setUpTunnel
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mCurrentSessionID

protected int mCurrentSessionID

mRegisteredTunnels

protected java.util.Hashtable mRegisteredTunnels
Constructor Detail

HTTPTunnelServer

public HTTPTunnelServer()
Method Detail

newConnection

protected void newConnection(java.lang.Object connectionMessage,
                             java.io.OutputStream outputStream,
                             int sessionID)
Sets up a new connection. This method will block until the connection is closed.


closeConnection

protected void closeConnection(int sessionID)

tunnelClosed

public void tunnelClosed(TunnelEvent event)
Description copied from class: AbstractTunnelServer
Invoked when the ITunnel has been closed. This happens on the server side when the tunnel on the client side is closed. The source ITunnel is finalized before this method is invoked.

Specified by:
tunnelClosed in interface ITunnelListener
Overrides:
tunnelClosed in class AbstractTunnelServer

connectionLost

public void connectionLost(TunnelEvent event)
Description copied from class: AbstractTunnelServer
Invoked on an ITunnel on the client side when the connection to the server has been lost. The source ITunnel is finalized before this method is invoked.

Specified by:
connectionLost in interface ITunnelListener
Overrides:
connectionLost in class AbstractTunnelServer

createSessionID

protected int createSessionID()

handleInputData

protected void handleInputData(int sessionID,
                               byte[] data)

doOnTunnelClosed

protected void doOnTunnelClosed(ITunnel tunnel)

waitForSessionClose

protected void waitForSessionClose(java.lang.Integer sessionID)


Copyright © 2005 Caleigo. All Rights Reserved.