|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.bsf.remoting.http.HttpSessionClient
This class handle the http protocole for the application server communication. Client classes can make http calls in parallel threads. The number of thread is limited by the field maxThreadCount. The parameters of the communication (port, host, ...)can be set by the ressource BsfModules.xml.
Field Summary | |
protected static HttpSessionClient |
_instance
|
private static java.lang.String |
AUTHENTICATED_SERVLET
|
private java.lang.String |
context
The context used at deployment time. |
private int |
curUsedThread
The number of thread that are currently making a call |
private static java.lang.String |
DEFAULT_PROTOCOL
Default call method is http |
private static int |
DEFAULT_THREAD_COUNT
Default Server File |
private java.lang.String |
host
Where is the server |
private static org.apache.commons.logging.Log |
log
|
private java.lang.String |
login
Used for authentification |
private int |
maxThreadCount
The number of parallel thread used to perform the http call. |
private static java.lang.String |
MIME_TYPE
BSF default mime type |
private java.lang.String |
pass
password used for basic authentification |
private int |
port
Http Port used |
private java.lang.String |
protocol
The method used to transmit the call, the default is http but it can be https to secure the communication |
private static int |
requestNb
|
private static java.lang.String |
SERVER_CONTEXT
Default Server File |
private static java.lang.String |
SERVER_HOST
Default Server Host |
private static int |
SERVER_PORT
Default Server Port |
private java.lang.String |
sessionId
|
private static java.lang.String |
UNAUTHENTICATED_SERVLET
|
Constructor Summary | |
protected |
HttpSessionClient()
Default constructor |
Method Summary | |
private java.lang.String |
getAuthenticatedServerFile()
|
static HttpSessionClient |
getInstance()
Singleton instanciation |
int |
getThreadCount()
|
private void |
getThreadLock()
This method is used to limit the concurrent http call to the max fixed by maxThreadCount and to wait the end of the first call that will return the session id. |
private java.lang.String |
getUnauthenticatedServerFile()
|
java.lang.Object |
invoke(EJBDefinition p_service,
java.lang.reflect.Method m,
java.lang.Object[] args)
Invokes a stateless remote service |
java.lang.Object |
invoke(HttpServiceKey p_servicekey,
java.lang.reflect.Method m,
java.lang.Object[] args)
Invokes a statefull remote service |
private java.lang.Object |
invokeHttp(HttpServiceRequest request)
Performs the http call. |
private boolean |
isAuthenticatedCall()
|
private void |
releaseThreadLock()
|
void |
setContext(java.lang.String context)
Set the context used at deployment time. |
void |
setHost(java.lang.String host)
|
void |
setLogin(java.lang.String login)
|
void |
setPassword(java.lang.String pass)
|
void |
setPort(int port)
|
void |
setProtocol(java.lang.String protocol)
sets the used protocol. |
void |
setServerFile(java.lang.String serverFile)
Deprecated. setServerContext should be used instead. |
void |
setThreadCount(int threadCount)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static org.apache.commons.logging.Log log
private static int requestNb
private java.lang.String sessionId
private static final java.lang.String AUTHENTICATED_SERVLET
private static final java.lang.String UNAUTHENTICATED_SERVLET
private static final java.lang.String DEFAULT_PROTOCOL
private static final java.lang.String SERVER_HOST
private static final int SERVER_PORT
private static final java.lang.String SERVER_CONTEXT
private static final int DEFAULT_THREAD_COUNT
private static final java.lang.String MIME_TYPE
private java.lang.String protocol
private java.lang.String host
private java.lang.String context
private java.lang.String login
private java.lang.String pass
private int port
private int maxThreadCount
private int curUsedThread
protected static HttpSessionClient _instance
Constructor Detail |
protected HttpSessionClient()
Method Detail |
public java.lang.Object invoke(EJBDefinition p_service, java.lang.reflect.Method m, java.lang.Object[] args) throws java.lang.Throwable
java.lang.Throwable
public java.lang.Object invoke(HttpServiceKey p_servicekey, java.lang.reflect.Method m, java.lang.Object[] args) throws java.lang.Throwable
java.lang.Throwable
private java.lang.Object invokeHttp(HttpServiceRequest request) throws java.lang.Throwable
java.lang.Throwable
private void getThreadLock()
private void releaseThreadLock()
public static HttpSessionClient getInstance() throws java.lang.IllegalStateException
java.lang.IllegalStateException
private boolean isAuthenticatedCall()
public void setHost(java.lang.String host)
public void setProtocol(java.lang.String protocol)
protocol
- public void setServerFile(java.lang.String serverFile)
serverFile
- the deployment context and the servlet. For instance /myApp/httpSession.public void setContext(java.lang.String context)
context
- private java.lang.String getUnauthenticatedServerFile()
private java.lang.String getAuthenticatedServerFile()
public void setPort(int port)
public int getThreadCount()
public void setThreadCount(int threadCount)
public void setLogin(java.lang.String login)
public void setPassword(java.lang.String pass)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |