com.admc.jamama.server.proxy
Class TCPProxyServer

java.lang.Object
  extended byAbstractDynamicMBean
      extended bycom.admc.jamama.server.proxy.TCPProxyServer
All Implemented Interfaces:
Configurable, java.lang.Runnable, Server

public class TCPProxyServer
extends AbstractDynamicMBean
implements Server

See Also:
Serialized Form

Nested Class Summary
 class TCPProxyServer.SessionThread
           
 
Constructor Summary
TCPProxyServer()
          Need a default constructor for Agent use (may also be required for MBean use...
TCPProxyServer(java.lang.String listenhost, int listenport, java.lang.String targethost, int targetport, java.io.File inMycert, java.lang.String inMypwd, java.io.File inCacert)
          This constructor won't be used by Jamama startup.
 
Method Summary
 void configure(java.lang.Object inCfg)
          Initialize the object's state with information in the given Jaxb object.
protected  MBeanAttributeInfo[] createMBeanAttributeInfo()
           
 java.lang.String getCacert()
           
 java.lang.Object getConfig()
          Returns the Jaxb object used to configure this.
 int getConnectionCount()
           
 java.lang.String[] getConnections()
           
 java.lang.String getListenHost()
           
 int getListenPort()
           
 int getMaxSessions()
           
protected  java.lang.String getMBeanDescription()
           
 java.lang.String getMycert()
           
 java.lang.String getMypwd()
           
 java.lang.String getName()
          Name which Jamama config file uses to identify this object instance.
 boolean getRun()
          Say whether main thread of this Server is running.
 java.lang.String getTargetHost()
           
 int getTargetPort()
           
 boolean isRun()
           
static void main(java.lang.String[] sa)
           
 void restoreRunState()
          Start up server iff server is configured to start automatically.
 void run()
          Main thread
 void setCacert(java.lang.String inFilename)
           
 void setListenHost(java.lang.String inHostname)
           
 void setListenPort(int inPort)
           
 void setMaxSessions(int inMaxSess)
           
 void setMycert(java.lang.String inFilename)
           
 void setMypwd(java.lang.String inPwd)
           
 void setRun(boolean inRun)
          Start or stop the main thread in this object.
 void setTargetHost(java.lang.String inHostname)
           
 void setTargetPort(int inPort)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TCPProxyServer

public TCPProxyServer()
Need a default constructor for Agent use (may also be required for MBean use... JMX docs are ambiguous


TCPProxyServer

public TCPProxyServer(java.lang.String listenhost,
                      int listenport,
                      java.lang.String targethost,
                      int targetport,
                      java.io.File inMycert,
                      java.lang.String inMypwd,
                      java.io.File inCacert)
               throws java.lang.Exception
This constructor won't be used by Jamama startup. Currently used by the main() method for debug. May be used by the factory MBean in future.

Method Detail

createMBeanAttributeInfo

protected MBeanAttributeInfo[] createMBeanAttributeInfo()

getMBeanDescription

protected java.lang.String getMBeanDescription()

restoreRunState

public void restoreRunState()
Description copied from interface: Server
Start up server iff server is configured to start automatically.

Specified by:
restoreRunState in interface Server
See Also:
Server

isRun

public boolean isRun()
See Also:
Server

getMaxSessions

public int getMaxSessions()

setMaxSessions

public void setMaxSessions(int inMaxSess)

getRun

public boolean getRun()
Description copied from interface: Server
Say whether main thread of this Server is running.

Specified by:
getRun in interface Server
Returns:
Indication of whether Server main thread is running.
See Also:
Server

getConnectionCount

public int getConnectionCount()

getConnections

public java.lang.String[] getConnections()

main

public static void main(java.lang.String[] sa)
                 throws java.lang.Exception
Throws:
java.lang.Exception

setListenHost

public void setListenHost(java.lang.String inHostname)

getListenHost

public java.lang.String getListenHost()

setListenPort

public void setListenPort(int inPort)

getListenPort

public int getListenPort()

setTargetHost

public void setTargetHost(java.lang.String inHostname)

getTargetHost

public java.lang.String getTargetHost()

setTargetPort

public void setTargetPort(int inPort)

getTargetPort

public int getTargetPort()

setCacert

public void setCacert(java.lang.String inFilename)

setMycert

public void setMycert(java.lang.String inFilename)

setMypwd

public void setMypwd(java.lang.String inPwd)

getCacert

public java.lang.String getCacert()

getMycert

public java.lang.String getMycert()

getMypwd

public java.lang.String getMypwd()

run

public void run()
Main thread

Specified by:
run in interface java.lang.Runnable

setRun

public void setRun(boolean inRun)
Description copied from interface: Server
Start or stop the main thread in this object.

Specified by:
setRun in interface Server
Parameters:
inRun - true to start up thread; false to stop it
See Also:
Server

configure

public void configure(java.lang.Object inCfg)
Description copied from interface: Configurable
Initialize the object's state with information in the given Jaxb object.

Specified by:
configure in interface Configurable
Parameters:
inCfg - A Jaxb object corresponding to a XML document branch.
See Also:
Configurable

getName

public java.lang.String getName()
Description copied from interface: Configurable
Name which Jamama config file uses to identify this object instance.

Specified by:
getName in interface Configurable
See Also:
Configurable

getConfig

public java.lang.Object getConfig()
Description copied from interface: Configurable
Returns the Jaxb object used to configure this.

Specified by:
getConfig in interface Configurable
See Also:
Configurable