|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.servlet.GenericServlet | +--javax.servlet.http.HttpServlet | +--org.bsf.remoting.http.HttpSessionServer
This is the servlet that intercept all the client calls and transmits these to the EJBs. All the client calls are Http POST calls that use url rewriting to keep the session id.
If the client uses authentication, it should call an authenticate(String login, String password) on a session.
The lookup on EJB are made through the _ejbContext InitialContext. This context is instantiated using the properties
Field Summary | |
private static javax.naming.Context |
_ejbContext
|
private static java.lang.String |
_ejbContextProperties
|
private int |
_maxServiceIndex
|
(package private) org.apache.commons.logging.Log |
log
|
protected static java.util.Hashtable |
serviceCache
|
private static java.lang.String |
STATEFULL_CACHE
|
Fields inherited from class javax.servlet.http.HttpServlet |
|
Fields inherited from class javax.servlet.GenericServlet |
|
Constructor Summary | |
HttpSessionServer()
|
Method Summary | |
protected void |
doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
The only http call used by the client side is POST in order to deal with unlimited (??) |
private javax.ejb.EJBObject |
getEjbReference(HttpServiceRequest httpServiceRequest,
javax.servlet.http.HttpServletRequest request)
Retrieves the reference to the EJBObject by the definition or by the cache depending on the request. |
private javax.ejb.EJBObject |
getFromCache(HttpServiceKey serviceKey,
javax.servlet.http.HttpServletRequest request)
Retrieve the statefull service from cache |
private HttpServiceRequest |
getHttpServiceRequest(javax.servlet.http.HttpServletRequest request)
gets the request from the http stream |
private java.lang.Class[] |
getParamTypes(java.lang.Object[] p_args)
As we invoke the method on the remote service using the reflect package, we must know the classes of the arguments |
private javax.ejb.EJBObject |
getRemote(EJBDefinition p_service)
Used for a call on a stateless service. |
void |
init()
Uses the properties defined in the servlet environment to instantiate the principalManager and the initial context properties. |
private static void |
initEjbContext(java.lang.String jndiProperties)
|
private static java.lang.Object[] |
narrowArgs(java.lang.Object[] p_args)
Allows the session to have remote EJBObject as arguments |
private HttpServiceResponse |
processRemoteCall(javax.ejb.EJBObject remoteService,
HttpServiceRequest httpServiceRequest,
javax.servlet.http.HttpServletRequest request)
|
private void |
putInCache(HttpServiceKey p_serviceKey,
javax.ejb.EJBObject p_stub,
javax.servlet.http.HttpServletRequest request)
We put in cache the handles to prepare the passivation |
private void |
writeHttpServiceResponse(javax.servlet.http.HttpServletResponse response,
HttpServiceResponse httpServiceResponse)
writes the response in the http stream |
Methods inherited from class javax.servlet.http.HttpServlet |
doDelete, doGet, 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 |
Field Detail |
org.apache.commons.logging.Log log
protected static java.util.Hashtable serviceCache
private int _maxServiceIndex
private static javax.naming.Context _ejbContext
private static java.lang.String _ejbContextProperties
private static final java.lang.String STATEFULL_CACHE
Constructor Detail |
public HttpSessionServer()
Method Detail |
public void init() throws javax.servlet.ServletException
init
in class javax.servlet.GenericServlet
javax.servlet.ServletException
protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
doPost
in class javax.servlet.http.HttpServlet
javax.servlet.ServletException
java.io.IOException
private javax.ejb.EJBObject getEjbReference(HttpServiceRequest httpServiceRequest, javax.servlet.http.HttpServletRequest request)
private HttpServiceResponse processRemoteCall(javax.ejb.EJBObject remoteService, HttpServiceRequest httpServiceRequest, javax.servlet.http.HttpServletRequest request) throws java.rmi.NoSuchObjectException
java.rmi.NoSuchObjectException
private void writeHttpServiceResponse(javax.servlet.http.HttpServletResponse response, HttpServiceResponse httpServiceResponse) throws java.io.IOException
java.io.IOException
private HttpServiceRequest getHttpServiceRequest(javax.servlet.http.HttpServletRequest request) throws java.io.IOException
java.io.IOException
private java.lang.Class[] getParamTypes(java.lang.Object[] p_args)
private javax.ejb.EJBObject getRemote(EJBDefinition p_service)
private void putInCache(HttpServiceKey p_serviceKey, javax.ejb.EJBObject p_stub, javax.servlet.http.HttpServletRequest request)
private javax.ejb.EJBObject getFromCache(HttpServiceKey serviceKey, javax.servlet.http.HttpServletRequest request)
private static java.lang.Object[] narrowArgs(java.lang.Object[] p_args)
private static void initEjbContext(java.lang.String jndiProperties)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |