sqlg2.db
Class HttpDispatcher

java.lang.Object
  extended by sqlg2.db.HttpDispatcher

public final class HttpDispatcher
extends java.lang.Object

Server-side object for HTTP access to business interfaces. Method dispatch(String, java.io.ObjectInputStream, java.io.ObjectOutputStream) should be invoked from servlets.

Servlet container can have more than one HttpDispatcher object, and distinguish them by application name (which should be reflected in servlet URL; for example, servlet on /remoting/app1 path invokes HttpDispatcher of application app1, etc).

HttpDispatcher object should be created only once for application.


Constructor Summary
HttpDispatcher(java.lang.String application, AuthenticationHelper helper, DBSpecific specific)
           
 
Method Summary
 void dispatch(java.lang.String hostName, java.io.ObjectInputStream ois, java.io.ObjectOutputStream oos)
          Dispatch of HTTP PUT request.
 void shutdown()
          Server shutdown
static void writeResponse(java.io.ObjectOutputStream oos, java.lang.Object result, java.lang.Throwable error)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpDispatcher

public HttpDispatcher(java.lang.String application,
                      AuthenticationHelper helper,
                      DBSpecific specific)
Method Detail

dispatch

public void dispatch(java.lang.String hostName,
                     java.io.ObjectInputStream ois,
                     java.io.ObjectOutputStream oos)
              throws java.io.IOException
Dispatch of HTTP PUT request.

Parameters:
hostName - host name of client from which call originated
ois - input data
oos - output data
Throws:
java.io.IOException

writeResponse

public static void writeResponse(java.io.ObjectOutputStream oos,
                                 java.lang.Object result,
                                 java.lang.Throwable error)
                          throws java.io.IOException
Throws:
java.io.IOException

shutdown

public void shutdown()
Server shutdown