antelder    2002/06/14 07:28:04

  Modified:    java/src/org/apache/wsif/base WSIFDefaultOperation.java
               java/src/org/apache/wsif/providers/soap/apacheaxis
                        WSIFOperation_ApacheAxis.java
               java/src/org/apache/wsif/providers/soap/apachesoap
                        WSIFOperation_ApacheSOAP.java
               java/src/org/apache/wsif/providers/jms
                        WSIFOperation_Jms.java
  Log:
  Change to allow the native JMS provider to set JMS properties from the context
  
  Revision  Changes    Path
  1.4       +4 -2      
xml-axis-wsif/java/src/org/apache/wsif/base/WSIFDefaultOperation.java
  
  Index: WSIFDefaultOperation.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis-wsif/java/src/org/apache/wsif/base/WSIFDefaultOperation.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- WSIFDefaultOperation.java 14 Jun 2002 12:17:37 -0000      1.3
  +++ WSIFDefaultOperation.java 14 Jun 2002 14:28:03 -0000      1.4
  @@ -79,6 +79,7 @@
       transient protected HashMap inJmsProps = new HashMap();
       transient protected HashMap outJmsProps = new HashMap();
       transient protected HashMap inJmsPropVals = new HashMap();
  +    protected WSIFMessage context;
      
       /**
        * @see WSIFOperation#executeRequestResponseOperation(WSIFMessage, WSIFMessage, 
WSIFMessage)
  @@ -388,6 +389,7 @@
        */
       public void setContext(WSIFMessage context) {
           Tr.entry(this, context);
  +        this.context = context;
           Tr.exit();
       }
   
  @@ -396,7 +398,7 @@
        */
       public WSIFMessage getContext() {
           Tr.entry(this);
  -        Tr.exit(null);
  -        return null;
  +        Tr.exit(context);
  +        return context;
       }
   }
  
  
  
  1.7       +0 -26     
xml-axis-wsif/java/src/org/apache/wsif/providers/soap/apacheaxis/WSIFOperation_ApacheAxis.java
  
  Index: WSIFOperation_ApacheAxis.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis-wsif/java/src/org/apache/wsif/providers/soap/apacheaxis/WSIFOperation_ApacheAxis.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- WSIFOperation_ApacheAxis.java     12 Jun 2002 15:35:38 -0000      1.6
  +++ WSIFOperation_ApacheAxis.java     14 Jun 2002 14:28:03 -0000      1.7
  @@ -117,7 +117,6 @@
       transient protected String inputEncodingStyle;
       transient protected String inputNamespace;
       transient protected String actionUri;
  -    transient protected WSIFMessage context;
       transient protected Class returnType = null;
   
       // for async operation
  @@ -837,31 +836,6 @@
               msg.setName(name);
           Tr.exit(msg);
           return msg;
  -    }
  -
  -    /**
  -     * Allows the application programmer or stub to pass context 
  -     * information to the binding. The Port implementation may use 
  -     * this context - for example to update a SOAP header. There is 
  -     * no definition of how a Port may utilize the context.
  -     * 
  -     * @param context   the context to be used
  -     */
  -    public void setContext(WSIFMessage context) {
  -        Tr.entry(this, context);
  -        this.context = context;
  -        Tr.exit();
  -    }
  -
  -    /**
  -     * Gets the context information for this binding.
  -     * 
  -     * @param the context being used 
  -     */
  -    public WSIFMessage getContext() {
  -        Tr.entry(this);
  -        Tr.exit(context);
  -        return context;
       }
   
       /**
  
  
  
  1.6       +0 -26     
xml-axis-wsif/java/src/org/apache/wsif/providers/soap/apachesoap/WSIFOperation_ApacheSOAP.java
  
  Index: WSIFOperation_ApacheSOAP.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis-wsif/java/src/org/apache/wsif/providers/soap/apachesoap/WSIFOperation_ApacheSOAP.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- WSIFOperation_ApacheSOAP.java     12 Jun 2002 15:35:38 -0000      1.5
  +++ WSIFOperation_ApacheSOAP.java     14 Jun 2002 14:28:03 -0000      1.6
  @@ -127,7 +127,6 @@
       transient protected WSIFPort_ApacheSOAP portInstance;
       transient protected Operation operation;
       transient protected Definition definition;
  -    transient protected WSIFMessage context;
   
       // cached information to allow efficinet operation calls
       transient protected List partNames;
  @@ -1262,31 +1261,6 @@
           Tr.entry(this, partSerializerName);
           this.partSerializerName = partSerializerName;
           Tr.exit();
  -    }
  -
  -    /**
  -     * Allows the application programmer or stub to pass context 
  -     * information to the binding. The Port implementation may use 
  -     * this context - for example to update a SOAP header. There is 
  -     * no definition of how a Port may utilize the context.
  -     * 
  -     * @param context   the context to be used
  -     */
  -    public void setContext(WSIFMessage context) {
  -        Tr.entry(this, context);
  -        this.context = context;
  -        Tr.exit();
  -    }
  -
  -    /**
  -     * Gets the context information for this binding.
  -     * 
  -     * @param the context being used 
  -     */
  -    public WSIFMessage getContext() {
  -        Tr.entry(this);
  -        Tr.exit(context);
  -        return context;
       }
   
       /**
  
  
  
  1.4       +30 -0     
xml-axis-wsif/java/src/org/apache/wsif/providers/jms/WSIFOperation_Jms.java
  
  Index: WSIFOperation_Jms.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis-wsif/java/src/org/apache/wsif/providers/jms/WSIFOperation_Jms.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- WSIFOperation_Jms.java    12 Jun 2002 21:07:50 -0000      1.3
  +++ WSIFOperation_Jms.java    14 Jun 2002 14:28:03 -0000      1.4
  @@ -180,6 +180,9 @@
                       WSIFJMSFinder.newFinder(fieldJmsPort.getObjectReference()),
                       fieldJmsPort.getObjectReference().getJmsProvDestName(),
                       WSIFProperties.getSyncTimeout());
  +
  +             setDestinationContext( jmsDest );
  +
               // send the jms message    
               String correlId = sendJmsMessage(input, jmsDest);
               javax.jms.Message response = jmsDest.receive(correlId);
  @@ -253,6 +256,9 @@
                       fieldJmsPort.getObjectReference().getJmsProvDestName(),
                       WSIFProperties.getSyncTimeout());
   
  +
  +            setDestinationContext( jmsDest );
  +
               // send the jms message    
               correlId = new WSIFJMSCorrelationId(sendJmsMessage(input, jmsDest));
               if (handler != null) {
  @@ -662,6 +668,30 @@
           Tr.entry(this);
           Tr.exit(asyncOperation);
           return asyncOperation;
  +    }
  +
  +    /**
  +     * This sets up any context JMS property values in the Destination
  +     */
  +    private void setDestinationContext(WSIFJMSDestination dest) {
  +       if ( context == null 
  +       || dest == null ) {
  +          return;
  +       }
  +       String partName;
  +       HashMap jmsProps = new HashMap();
  +       for (Iterator i = context.getPartNames(); i.hasNext(); ) {
  +          partName = (String)i.next();
  +          if ( partName.startsWith( WSIFConstants.CONTEXT_JMS_PREFIX ) ) {
  +             try {
  +                jmsProps.put( partName.substring( 
WSIFConstants.CONTEXT_JMS_PREFIX.length() ), 
  +                              context.getObjectPart( partName ) );
  +             } catch (WSIFException ex) {}
  +          } 
  +       }
  +       if ( jmsProps.size() > 0 ) {
  +          dest.setProperties( jmsProps );
  +       }
       }
   
       public String deep() {
  
  
  


Reply via email to