You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Raymond Feng <en...@gmail.com> on 2007/08/08 06:29:49 UTC

An erreta is needed for ServiceReference definition in the Java Common Annotations and APIs Specification V1.00

Hi,

The java spec defines the org.osoa.sca.ServiceReference as follows:

911 package org.osoa.sca;
912
913 public interface ServiceReference<B> extends CallableReference<B>{
914
915 Object getConversationID();
916 void setConversationID(Object conversationId) throws 
IllegalStateException;
917 void setCallbackID(Object callbackID);
918 Object getCallback();
919 void setCallback(Object callback);
920 }

I believe we need to add a method to the interface: Object getCallbackID();

Please see the justification in line 621 and 639 in the same spec as quoted 
below:

619 The following is a repeat of the client code fragment above, but with 
the assumption that in this case the
620 MyServiceCallback is stateless. The client in this case needs to set the 
callback ID before invoking the
621 service and then needs to get the callback ID when the response is 
received.
622
623
624 private ServiceReference<MyService> myService;
625
626 @Reference
627 public void setMyService(ServiceReference<MyService> service){
628 myService = service;
629 }
630
631 public void aClientMethod() {
632 String someKey = "1234";
633 ...
634
635 myService.setCallbackID(someKey);
636 myService.getService().someMethod(arg);
637 }
638 public void receiveResult(String result) {
639 Object key = myService.getCallbackID();
640 // Lookup any relevant state based on "key"
641 // code to process the result
642 }

Thanks,
Raymond 


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org