net.sf.crispy.impl.http
Class HttpServlet
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
net.sf.crispy.server.HttpServiceEndpoint
net.sf.crispy.impl.http.HttpServlet
- All Implemented Interfaces:
- Constant, java.io.Serializable, ServiceEndpoint, javax.servlet.Servlet, javax.servlet.ServletConfig, SingleServiceContainer
- Direct Known Subclasses:
- RestServlet
- public class HttpServlet
- extends HttpServiceEndpoint
- implements Constant, SingleServiceContainer
- See Also:
- Serialized Form
Field Summary |
protected static org.apache.commons.logging.Log |
log
|
Method Summary |
void |
addService(java.lang.String pvInterfaceName,
java.lang.Object pvServiceImpl)
Add service implementation. |
void |
addService(java.lang.String pvServiceInterfaceName,
java.lang.String pvServiceImplName)
Create a instance from the service impl class name. |
protected java.util.Vector |
convertInParameterTypes(java.lang.String[] pvParamTypes)
|
protected void |
doGet(javax.servlet.http.HttpServletRequest pvRequest,
javax.servlet.http.HttpServletResponse pvResponse)
|
protected void |
doPost(javax.servlet.http.HttpServletRequest pvRequest,
javax.servlet.http.HttpServletResponse pvResponse)
|
protected java.lang.Object[] |
getArgs(java.lang.Object pvParameters)
|
java.lang.reflect.Method |
getMethod(java.lang.Object pvService,
java.util.Map pvParameterMap,
java.lang.String pvServiceClassName,
java.lang.String pvMethodName)
|
java.lang.Object |
getService(javax.servlet.http.HttpServletRequest pvRequest,
javax.servlet.http.HttpServletResponse pvResponse)
This is a alternative to the Object getService(String pvServiceInterfaceName) method.
|
java.lang.Object |
getService(java.lang.String pvServiceInterfaceName)
Find the service impl. |
protected java.lang.String[] |
getServiceAndMethodName(java.lang.String pvServiceClassName,
java.lang.String pvMethodName)
|
int |
getServiceSize()
Size of services in the container. |
void |
init(javax.servlet.ServletConfig pvConfig)
|
void |
removeService(java.lang.String pvServiceInterfaceName)
Remove the service from the container. |
Methods inherited from class javax.servlet.http.HttpServlet |
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service |
Methods inherited from class javax.servlet.GenericServlet |
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
protected static final org.apache.commons.logging.Log log
HttpServlet
public HttpServlet()
init
public void init(javax.servlet.ServletConfig pvConfig)
throws javax.servlet.ServletException
- Specified by:
init
in interface javax.servlet.Servlet
- Throws:
javax.servlet.ServletException
addService
public void addService(java.lang.String pvInterfaceName,
java.lang.Object pvServiceImpl)
- Description copied from interface:
SingleServiceContainer
- Add service implementation.
- Specified by:
addService
in interface SingleServiceContainer
- Parameters:
pvInterfaceName
- Is the key in a map.pvServiceImpl
- Is the value in a map.
addService
public void addService(java.lang.String pvServiceInterfaceName,
java.lang.String pvServiceImplName)
- Description copied from interface:
SingleServiceContainer
- Create a instance from the service impl class name.
- Specified by:
addService
in interface SingleServiceContainer
- Parameters:
pvServiceInterfaceName
- Is the key in a map.pvServiceImplName
- Is the class name from the service impl.
removeService
public void removeService(java.lang.String pvServiceInterfaceName)
- Description copied from interface:
SingleServiceContainer
- Remove the service from the container.
- Specified by:
removeService
in interface SingleServiceContainer
- Parameters:
pvServiceInterfaceName
- Is the key in a map.
getService
public java.lang.Object getService(java.lang.String pvServiceInterfaceName)
- Description copied from interface:
SingleServiceContainer
- Find the service impl.
- Specified by:
getService
in interface SingleServiceContainer
- Parameters:
pvServiceInterfaceName
- Is the key in a map.
- Returns:
- The service impl or
null
.
getServiceSize
public int getServiceSize()
- Description copied from interface:
SingleServiceContainer
- Size of services in the container.
- Specified by:
getServiceSize
in interface SingleServiceContainer
- Returns:
- Size of services.
getService
public java.lang.Object getService(javax.servlet.http.HttpServletRequest pvRequest,
javax.servlet.http.HttpServletResponse pvResponse)
throws java.lang.Exception
- Description copied from class:
HttpServiceEndpoint
- This is a alternative to the
Object getService(String pvServiceInterfaceName)
method.
With this method you can use SessionID (request.getSession().getId()
)
for a service with scope equals Session.
- Overrides:
getService
in class HttpServiceEndpoint
- Parameters:
pvRequest
- pvResponse
-
- Returns:
- The service implementation. Default retun value is
null
.
For a real service implementation must override this method.
- Throws:
java.lang.Exception
doGet
protected void doGet(javax.servlet.http.HttpServletRequest pvRequest,
javax.servlet.http.HttpServletResponse pvResponse)
throws javax.servlet.ServletException,
java.io.IOException
- Throws:
javax.servlet.ServletException
java.io.IOException
doPost
protected void doPost(javax.servlet.http.HttpServletRequest pvRequest,
javax.servlet.http.HttpServletResponse pvResponse)
throws javax.servlet.ServletException,
java.io.IOException
- Throws:
javax.servlet.ServletException
java.io.IOException
getMethod
public java.lang.reflect.Method getMethod(java.lang.Object pvService,
java.util.Map pvParameterMap,
java.lang.String pvServiceClassName,
java.lang.String pvMethodName)
throws java.lang.Exception
- Throws:
java.lang.Exception
getArgs
protected java.lang.Object[] getArgs(java.lang.Object pvParameters)
getServiceAndMethodName
protected java.lang.String[] getServiceAndMethodName(java.lang.String pvServiceClassName,
java.lang.String pvMethodName)
throws java.lang.Exception
- Throws:
java.lang.Exception
convertInParameterTypes
protected java.util.Vector convertInParameterTypes(java.lang.String[] pvParamTypes)
Copyright © 2005-2006 Crispy. All Rights Reserved.