net.sf.sahi
Class Proxy

java.lang.Object
  extended by net.sf.sahi.Proxy

public class Proxy
extends java.lang.Object

Proxy manages Sahi's proxy server.
Proxy needs to know the base directory of Sahi.
This is configured by calling Configuration.init(String sahiBaseDir, String userDataDirectory)

Usage:

String sahiBasePath = "D:\\path\\to\\sahi_dir";
Sting userDataDirectory = "D:\\path\\to\\userdata_dir"; // userdata_dir is in sahiBasePath/userdata by default

net.sf.sahi.config.Configuration.initJava(sahiBasePath, userDataDirectory);

proxy = new Proxy();
proxy.start(true); // true represents asynchronous. The proxy server will listen on a separate thread. 

// browser actions

proxy.stop();


Constructor Summary
Proxy()
           
Proxy(int port)
           
 
Method Summary
 boolean isRunning()
          Indicates whether this proxy server can receive connections from clients
static void main(java.lang.String[] args)
           
 void start(boolean asynch)
          Starts the proxy.
 void stop()
          Stops the proxy.
static void stopCurrentIntance()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Proxy

public Proxy(int port)

Proxy

public Proxy()
Method Detail

main

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

stopCurrentIntance

public static void stopCurrentIntance()

stop

public void stop()
Stops the proxy.


start

public void start(boolean asynch)
Starts the proxy.

Parameters:
asynch - If true, starts Sahi's proxy in a separate thread.

isRunning

public boolean isRunning()
Indicates whether this proxy server can receive connections from clients

Returns:
see above