1 6 7 package org.enhydra.shark.asap; 8 9 import java.rmi.RemoteException ; 10 11 import javax.xml.rpc.holders.ObjectHolder ; 12 import javax.xml.rpc.holders.StringHolder ; 13 14 import org.apache.axis.types.URI; 15 import org.enhydra.shark.api.common.SharkConstants; 16 import org.enhydra.shark.asap.types.*; 17 import org.enhydra.shark.asap.types.holders.GetPropertiesRsHolder; 18 import org.enhydra.shark.asap.types.holders.ResponseHolder; 19 20 26 public class AsapObserverBindingImpl implements ObserverPortType { 27 public void getProperties(Request rqHead, 28 String rqBody, 29 ResponseHolder rsHead, 30 GetPropertiesRsHolder rsBody) throws java.rmi.RemoteException { 31 URI rqReceiverKey = AsapBindingUtilitiesImpl.turnHeads(rqHead, rsHead); 32 rsBody.value = new GetPropertiesRs(); 33 } 34 35 public void completed(Request rqHead, 36 CompletedRq rqBody, 37 ResponseHolder rsHead, 38 StringHolder rsBody) throws java.rmi.RemoteException { 39 URI rqReceiverKey = AsapBindingUtilitiesImpl.turnHeads(rqHead, rsHead); 40 URI rqInstanceKey = rqBody.getInstanceKey(); 41 CompletedRqResultData rqResultData = rqBody.getResultData(); 42 43 if (!AsapBindingUtilitiesImpl.sendEventToActivity(rqReceiverKey, 44 rqInstanceKey.toString(), 45 rqResultData, 46 null, 47 null)) { 48 } 51 rsBody.value = ""; 52 } 53 54 public void stateChanged(Request rqHead, 55 StateChangedRq rqBody, 56 ResponseHolder rsHead, 57 StringHolder rsBody) throws java.rmi.RemoteException { 58 URI rqReceiverKey = AsapBindingUtilitiesImpl.turnHeads(rqHead, rsHead); 59 URI rqSenderKey = rqHead.getSenderKey(); 60 StateType rqPreviousState = rqBody.getPreviousState(); 61 StateType rqState = rqBody.getState(); 62 try { 63 String newState = AsapBindingUtilitiesImpl.parseState(rqState); 64 if (!SharkConstants.STATE_CLOSED_COMPLETED.equals(newState)) { 65 AsapBindingUtilitiesImpl.sendEventToActivity(rqReceiverKey, 66 rqSenderKey.toString(), 67 null, 68 AsapBindingUtilitiesImpl.parseState(rqPreviousState), 69 AsapBindingUtilitiesImpl.parseState(rqState)); 70 } 71 } catch (Exception e) { 72 throw new RemoteException (e.getMessage(), e); 73 } 74 rsBody.value = ""; 78 } 79 } | Popular Tags |