jaliya      2005/05/17 05:49:52

  Modified:    sandesha/interop build.xml
               sandesha/interop/org/apache/sandesha/samples/interop/testclient
                        InteropStub.java TestRunnerThread.java
               sandesha/interop/webapp/jsp interop.jsp
  Log:
  Fixed the possible threading problems in the interop client
  
  Revision  Changes    Path
  1.11      +2 -0      ws-fx/sandesha/interop/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/ws-fx/sandesha/interop/build.xml,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- build.xml 17 May 2005 07:23:46 -0000      1.10
  +++ build.xml 17 May 2005 12:49:52 -0000      1.11
  @@ -435,4 +435,6 @@
   
        <target name="war" depends="create.war" description="creates the war 
file" />
   
  + 
  +
   </project>
  
  
  
  1.8       +17 -2     
ws-fx/sandesha/interop/org/apache/sandesha/samples/interop/testclient/InteropStub.java
  
  Index: InteropStub.java
  ===================================================================
  RCS file: 
/home/cvs/ws-fx/sandesha/interop/org/apache/sandesha/samples/interop/testclient/InteropStub.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- InteropStub.java  17 May 2005 07:23:46 -0000      1.7
  +++ InteropStub.java  17 May 2005 12:49:52 -0000      1.8
  @@ -21,6 +21,20 @@
   import javax.xml.rpc.ParameterMode;
   
   public class InteropStub {
  +
  +    private InteropStub(){}
  +
  +    private static InteropStub stub=null;
  +
  +    public static InteropStub getInstance(){
  +        if(stub!=null){
  +           return stub;
  +        }else{
  +            stub=new InteropStub();
  +            return stub;
  +        }
  +    }
  +
       public static InteropCallback getCallback() {
           return callback;
       }
  @@ -30,7 +44,8 @@
       }
   
       private static InteropCallback callback=null;
  -    public void runPing(InteropBean bean) {
  +
  +    public synchronized void runPing(InteropBean bean) {
   
           String target = bean.getTarget();
           String from = bean.getFrom();
  @@ -96,7 +111,7 @@
           }
       }
   
  -    public void runEcho(InteropBean bean) {
  +    public synchronized void runEcho(InteropBean bean) {
   
           String target = bean.getTarget();
           String from = bean.getFrom();
  
  
  
  1.3       +1 -1      
ws-fx/sandesha/interop/org/apache/sandesha/samples/interop/testclient/TestRunnerThread.java
  
  Index: TestRunnerThread.java
  ===================================================================
  RCS file: 
/home/cvs/ws-fx/sandesha/interop/org/apache/sandesha/samples/interop/testclient/TestRunnerThread.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestRunnerThread.java     14 May 2005 02:45:39 -0000      1.2
  +++ TestRunnerThread.java     17 May 2005 12:49:52 -0000      1.3
  @@ -28,7 +28,7 @@
        
        public void run(){
                
  -             InteropStub stub = new InteropStub ();
  +             InteropStub stub = InteropStub.getInstance();
                String operation = bean.getOperation();
                
                
  
  
  
  1.4       +2 -2      ws-fx/sandesha/interop/webapp/jsp/interop.jsp
  
  Index: interop.jsp
  ===================================================================
  RCS file: /home/cvs/ws-fx/sandesha/interop/webapp/jsp/interop.jsp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- interop.jsp       17 May 2005 07:23:46 -0000      1.3
  +++ interop.jsp       17 May 2005 12:49:52 -0000      1.4
  @@ -292,8 +292,8 @@
                        RMProvider.setCallback(callback);
                        Sender.setCallback(callback);
   
  -            InteropStub stub= new InteropStub();
  -            InteropStub.setCallback(callback); 
  +            InteropStub stub= InteropStub.getInstance();
  +            InteropStub.setCallback(callback);
                if(operation.equalsIgnoreCase("ping")){
                       stub.runPing(bean);
               }else if(operation.equalsIgnoreCase("echoString") ){
  
  
  

Reply via email to