org.jabber.jabberbeans.serverside
Class Launcher

java.lang.Object
  |
  +--org.jabber.jabberbeans.serverside.Launcher

public class Launcher
extends java.lang.Object

Launcher is some simple code to negotiate a connection with a Jabber server as a component. After negotiation, it launches a component. Important: a base_exec connection uses stdin/stdout for communication. It is very important that System.err is used over System.out, as System.out will be considered outgoing data to the server.


Constructor Summary
Launcher()
           
 
Method Summary
protected  void AcceptHandler()
          Support routine for base_accept.
protected  void ConnectHandler()
          Support routine for base_connect.
protected  void ExecHandler()
          Support routine for base_exec.
static void main(java.lang.String[] args)
           
 void ServerConnect()
           
 void start()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Launcher

public Launcher()
Method Detail

main

public static final void main(java.lang.String[] args)

start

public final void start()

AcceptHandler

protected void AcceptHandler()
Support routine for base_accept. base_accept will cause the server to listen in on a port, waiting for connections. After a connection is established, there is a limited amount of time to complete authenication. Steps: 1. set-up protocol handler (done previous) 2. connect to server 3. send header 4. wait for response 5. read in session ID from stream header. 6. hash based on id + secret 7. send handshake with hash 8. wait for response: - if , resend hash (step 7) - if disconnect/timeout, go back to step 2. - if , continue 9. connection established, start custom logic.


ConnectHandler

protected void ConnectHandler()
Support routine for base_connect. base_connect will cause the server to connect to a port on a remote machine. After a connection is established, the server actually authenticates with us. There is a limited amount of time to complete authenication. Steps: 1. set-up protocol handler (done previous) 2. open for connections 3. wait for header 4. send response with Session ID 5. compute handshake based on secret and session ID sent. 6. for ten seconds: 6a. wait for handshake to come in 6b. verify handshake - if valid, return empty handshake and exit loop - if invalid, return stream:error 6c. if time expires without a valid handshake coming in, disconnect. and go back to 3. 7. connection established, start custom logic.


ExecHandler

protected void ExecHandler()
Support routine for base_exec. base_exec will cause the client to be launched on the local machine - the client will then do its I/O on stdin/stdout.. We do not authenticate since we are local. Spoofing is the least of our problems in that case. Steps: 1. set-up protocol handler (done previous) 2. set up connection on stdin/stdout 3. send response 4. wait for header 5. connection established, start custom logic.


ServerConnect

public void ServerConnect()