com.caucho.hessian.server
Class HessianServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by com.caucho.hessian.server.HessianServlet
All Implemented Interfaces:
java.io.Serializable, Servlet, ServletConfig
Direct Known Subclasses:
TestHessian2Servlet, TestHessianServlet

public class HessianServlet
extends HttpServlet

Servlet for serving Hessian services.

See Also:
Serialized Form

Constructor Summary
HessianServlet()
           
 
Method Summary
protected  Hessian2Input createHessian2Input(java.io.InputStream is)
           
 java.lang.Class<?> getAPIClass()
          Gets the api-class.
protected  java.lang.ClassLoader getContextClassLoader()
           
 SerializerFactory getSerializerFactory()
          Gets the serializer factory.
 java.lang.String getServletInfo()
          Returns a string describing the servlet.
 void init(ServletConfig config)
          Initialize the service, including the service object.
protected  void invoke(java.io.InputStream is, java.io.OutputStream os, java.lang.String objectId, SerializerFactory serializerFactory)
           
 void service(ServletRequest request, ServletResponse response)
          Execute a request.
 void setAPIClass(java.lang.Class<?> api)
          Sets the api-class.
 void setDebug(boolean isDebug)
          Sets the debugging flag.
 void setHome(java.lang.Object home)
          Sets the home implementation
 void setHomeAPI(java.lang.Class<?> api)
          Sets the home api.
 void setLogName(java.lang.String name)
          Sets the debugging log name.
 void setObject(java.lang.Object object)
          Sets the object implementation
 void setObjectAPI(java.lang.Class<?> api)
          Sets the object api.
 void setSendCollectionType(boolean sendType)
          Sets the serializer send collection java type.
 void setSerializerFactory(SerializerFactory factory)
          Sets the serializer factory.
 void setService(java.lang.Object service)
          Sets the service class.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, log, log, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HessianServlet

public HessianServlet()
Method Detail

getServletInfo

public java.lang.String getServletInfo()
Description copied from class: GenericServlet
Returns a string describing the servlet.

Specified by:
getServletInfo in interface Servlet
Overrides:
getServletInfo in class GenericServlet

setHomeAPI

public void setHomeAPI(java.lang.Class<?> api)
Sets the home api.


setHome

public void setHome(java.lang.Object home)
Sets the home implementation


setObjectAPI

public void setObjectAPI(java.lang.Class<?> api)
Sets the object api.


setObject

public void setObject(java.lang.Object object)
Sets the object implementation


setService

public void setService(java.lang.Object service)
Sets the service class.


setAPIClass

public void setAPIClass(java.lang.Class<?> api)
Sets the api-class.


getAPIClass

public java.lang.Class<?> getAPIClass()
Gets the api-class.


setSerializerFactory

public void setSerializerFactory(SerializerFactory factory)
Sets the serializer factory.


getSerializerFactory

public SerializerFactory getSerializerFactory()
Gets the serializer factory.


setSendCollectionType

public void setSendCollectionType(boolean sendType)
Sets the serializer send collection java type.


setDebug

public void setDebug(boolean isDebug)
Sets the debugging flag.


setLogName

public void setLogName(java.lang.String name)
Sets the debugging log name.


init

public void init(ServletConfig config)
          throws ServletException
Initialize the service, including the service object.

Specified by:
init in interface Servlet
Overrides:
init in class GenericServlet
Parameters:
config - the servlet's configuration
Throws:
ServletException

getContextClassLoader

protected java.lang.ClassLoader getContextClassLoader()

service

public void service(ServletRequest request,
                    ServletResponse response)
             throws java.io.IOException,
                    ServletException
Execute a request. The path-info of the request selects the bean. Once the bean's selected, it will be applied.

Specified by:
service in interface Servlet
Overrides:
service in class HttpServlet
Parameters:
request - request information. Normally servlets will cast this to HttpServletRequest
response - response information. Normally servlets will cast this to HttpServletRequest
Throws:
java.io.IOException
ServletException

invoke

protected void invoke(java.io.InputStream is,
                      java.io.OutputStream os,
                      java.lang.String objectId,
                      SerializerFactory serializerFactory)
               throws java.lang.Exception
Throws:
java.lang.Exception

createHessian2Input

protected Hessian2Input createHessian2Input(java.io.InputStream is)