org.jboss.mq.il.http
Class HTTPClientILService

java.lang.Object
  extended byorg.jboss.mq.il.http.HTTPClientILService
All Implemented Interfaces:
ClientILService (src) , java.lang.Runnable

public class HTTPClientILService
extends java.lang.Object
implements java.lang.Runnable, ClientILService (src)

The HTTP/S implementation of the ClientILService object. One of these exists for each Connection object. Normally, this would be where you would boot up a client-side listener for the server to invoke. However in this case, we poll the server instead. In short, the ClientIL that we provide, once serialized and shipped to the server, simply places requests the server makes to it in a server-side storage mechanism. Then, when we send an HTTP request to the server, the servlet looks for queued requests waiting for us, batches them up and returns them in the response. Since we place ALL requests delivered to ANY instance of the ClientIL in a central storage queue, we have to have a way to get only the requests placed in storage by OUR ClientIL. Originally, I attempted to use the ConnectionId for this purpose, but it proooved to be less than ideal due to the fact that it created many cases where requests were being fielded to an instance of a ClientIL which was sent over the wire prior to the server returning our ConnectionId. This resulted in lost requests. Furthermore, since this had no control over exactly when the ConnectionId was set, we were forced to loop until it was not null. The current implementation doesn�t' suffer from these issues, as we can take full control over the process of setting our identifier and therefore, set the identifier on our ClientIL at creation time.


Constructor Summary
HTTPClientILService()
           
 
Method Summary
 ClientIL (src) getClientIL()
          After initialization, this method may be called to obtain a reference to a ClientIL object.
 void init(Connection (src)  connection, java.util.Properties props)
          After construction, the ClientILService is initialized with a reference to the Connection object and the connection properties.
 void run()
           
 void start()
          Once started, the ClientIL instance should process all server requests.
 void stop()
          Once stopped, the ClientIL instance stop processing all server requests.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HTTPClientILService

public HTTPClientILService()
Method Detail

getClientIL

public ClientIL (src)  getClientIL()
                     throws java.lang.Exception
Description copied from interface: ClientILService (src)
After initialization, this method may be called to obtain a reference to a ClientIL object. This object will eventually be serialized and sent to the server so that he can invoke methods on connection it was initialized with.

Specified by:
getClientIL in interface ClientILService (src)
Returns:
The ClientIL value
Throws:
java.lang.Exception - Description of Exception

init

public void init(Connection (src)  connection,
                 java.util.Properties props)
          throws java.lang.Exception
Description copied from interface: ClientILService (src)
After construction, the ClientILService is initialized with a reference to the Connection object and the connection properties.

Specified by:
init in interface ClientILService (src)
Parameters:
connection - Description of Parameter
props - Description of Parameter
Throws:
java.lang.Exception - Description of Exception

start

public void start()
           throws java.lang.Exception
Description copied from interface: ClientILService (src)
Once started, the ClientIL instance should process all server requests.

Specified by:
start in interface ClientILService (src)
Throws:
java.lang.Exception - Description of Exception

stop

public void stop()
          throws java.lang.Exception
Description copied from interface: ClientILService (src)
Once stopped, the ClientIL instance stop processing all server requests. if( cr_server != null ) cr_server.close(); if (cr!=null && cr instanceof java.rmi.Remote) { java.rmi.server.UnicastRemoteObject.unexportObject((java.rmi.Remote)cr, true); }

Specified by:
stop in interface ClientILService (src)
Throws:
java.lang.Exception - Description of Exception

run

public void run()
Specified by:
run in interface java.lang.Runnable