com.caucho.hessian.server
Class HessianServlet

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

public class HessianServlet
extends javax.servlet.GenericServlet

Servlet for serving Hessian services.

See Also:
Serialized Form

Nested Class Summary
(package private) static class HessianServlet.LogWriter
           
 
Field Summary
private  java.lang.Class _homeAPI
           
private  java.lang.Object _homeImpl
           
private  HessianSkeleton _homeSkeleton
           
private  boolean _isDebug
           
private  java.util.logging.Logger _log
           
private  java.lang.Class _objectAPI
           
private  java.lang.Object _objectImpl
           
private  HessianSkeleton _objectSkeleton
           
private  SerializerFactory _serializerFactory
           
 
Constructor Summary
HessianServlet()
           
 
Method Summary
protected  Hessian2Input createHessian2Input(java.io.InputStream is)
           
private  java.lang.Class findRemoteAPI(java.lang.Class implClass)
           
 java.lang.Class getAPIClass()
          Gets the api-class.
protected  java.lang.ClassLoader getContextClassLoader()
           
 SerializerFactory getSerializerFactory()
          Gets the serializer factory.
 java.lang.String getServletInfo()
           
private  void init(java.lang.Object service)
           
 void init(javax.servlet.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)
           
private  java.lang.Class loadClass(java.lang.String className)
           
 void service(javax.servlet.ServletRequest request, javax.servlet.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.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_log

private java.util.logging.Logger _log

_homeAPI

private java.lang.Class _homeAPI

_homeImpl

private java.lang.Object _homeImpl

_objectAPI

private java.lang.Class _objectAPI

_objectImpl

private java.lang.Object _objectImpl

_homeSkeleton

private HessianSkeleton _homeSkeleton

_objectSkeleton

private HessianSkeleton _objectSkeleton

_serializerFactory

private SerializerFactory _serializerFactory

_isDebug

private boolean _isDebug
Constructor Detail

HessianServlet

public HessianServlet()
Method Detail

getServletInfo

public java.lang.String getServletInfo()
Specified by:
getServletInfo in interface javax.servlet.Servlet
Overrides:
getServletInfo in class javax.servlet.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(javax.servlet.ServletConfig config)
          throws javax.servlet.ServletException
Initialize the service, including the service object.

Specified by:
init in interface javax.servlet.Servlet
Overrides:
init in class javax.servlet.GenericServlet
Throws:
javax.servlet.ServletException

findRemoteAPI

private java.lang.Class findRemoteAPI(java.lang.Class implClass)

loadClass

private java.lang.Class loadClass(java.lang.String className)
                           throws java.lang.ClassNotFoundException
Throws:
java.lang.ClassNotFoundException

getContextClassLoader

protected java.lang.ClassLoader getContextClassLoader()

init

private void init(java.lang.Object service)
           throws javax.servlet.ServletException
Throws:
javax.servlet.ServletException

service

public void service(javax.servlet.ServletRequest request,
                    javax.servlet.ServletResponse response)
             throws java.io.IOException,
                    javax.servlet.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 javax.servlet.Servlet
Specified by:
service in class javax.servlet.GenericServlet
Throws:
java.io.IOException
javax.servlet.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)


Copyright 2003-2011. All Rights Reserved.