You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fx-dev@ws.apache.org by Patrick Collins <pa...@active-endpoints.com> on 2005/05/20 22:40:38 UTC

Sandesha: RMInvoker

Hi,

I have attached a minor bug fix to the RMInvoker class.

    public void run() {
        while (true) {
            try {
                Thread.sleep(Constants.RMINVOKER_SLEEP_TIME);
                RMMessageContext rmMessageContext = ... 

		    // **** this will cause NPE is rmMessageContext is null
                AddressingHeaders addrHeaders = rmMessageContext.get...
		    
                if (rmMessageContext != null)
                {
			rmMessageContext.getAddressingHeaders();
                  // **** should be here 
                  // AddressingHeaders addrHeaders = rmMessageContext.get...


The attached file contains some refactoring of the run method to allow for
subclassing.  My issue is that I am not using the JavaProvider to handle my
actual invokes. 

I also moved the Thread code into the class itself (startInvoker method).
Running in a J2EE environment, I cannot always create new Thread objects.
The startInvoker method would allow subclasses to use an alternative impl
(ie: WorkManager) for watching the queue.  Ideally, the RMInvoker wouldn't
implement Runnable at all - but could certainly create one internally as
needed. I have also attached the updated version of RMInitiator per this
change.

My other suggestion would be to pass the IStorageManager impl to the
required server classes (as is done with the ClientStorageManager).  So in
this case, the RMInvoker would change to accept the IStorageManager in its
constructor. I did not make this change (as it cuts across a number of other
classes as well).

In addition, I encapsulated field access to the storageManager member (via a
protected getXXX method) so I could access it from my subclass (although
alternatively, I could have just created a new ServerStorageManager instance
in the subclass).

Regards,

Patrick