axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Davanum Srinivas <d...@yahoo.com>
Subject Re: Removing --messageContext from Wsdl2java (re: cvs commit: xml-axis/java/test/RPCDispatch Service.java TestRPC.java)
Date Wed, 05 Dec 2001 13:55:09 GMT
+1.

--- Russell Butek <butek@us.ibm.com> wrote:
> With Sam's changes below, we no longer need the --messageContext option in
> Wsdl2java.  Unless someone has some serious reservations, I plan to remove
> it in the next couple days.
> 
> Russell Butek
> butek@us.ibm.com
> ---------------------- Forwarded by Russell Butek/Austin/IBM on 12/05/2001
> 07:43 AM ---------------------------
> 
> 
> 
> 
> 
> rubys@apache.org on 12/04/2001 06:27:18 PM
> 
> Please respond to axis-dev@xml.apache.org
> 
> To:   xml-axis-cvs@apache.org
> cc:
> 
> Subject:  cvs commit: xml-axis/java/test/RPCDispatch Service.java
>       TestRPC.java
> 
> 
> 
> 
> rubys       01/12/04 16:27:18
> 
>   Modified:    java/src/org/apache/axis AxisEngine.java MessageContext.java
>                java/src/org/apache/axis/client AxisClient.java
>                java/src/org/apache/axis/server AxisServer.java
>                java/test/RPCDispatch Service.java TestRPC.java
>   Log:
>   Implement an alternate means by which the current active message context
>   can be retrieved by a web service.  Previously this was accomplished with
>   an optional first parameter - which is still supported for the moment
>   (I'd deprecate it if I could see a way to do it).
> 
>   The active message context is defined as the one passed to last
>   AxisEngine.invoke on the call stack.
> 
>   The active message context can be retrieved using either of the following
>   static methods:
>     AxisEngine.getCurrentMessageContext();
>     MessageContext.getCurrentContext();
> 
>   Revision  Changes    Path
>   1.59      +24 -0     xml-axis/java/src/org/apache/axis/AxisEngine.java
> 
>   Index: AxisEngine.java
>   ===================================================================
>   RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/AxisEngine.java,v
>   retrieving revision 1.58
>   retrieving revision 1.59
>   diff -u -r1.58 -r1.59
>   --- AxisEngine.java    2001/12/03 22:49:22  1.58
>   +++ AxisEngine.java    2001/12/05 00:27:18  1.59
>   @@ -119,6 +119,30 @@
>        protected WSDDGlobalConfiguration myGlobalConfig = null;
> 
>        /**
>   +     * Thread local storage used for locating the active message
> context.
>   +     * This information is only valid for the lifetime of this request.
>   +     */
>   +    private static ThreadLocal currentMessageContext = new ThreadLocal
> ();
>   +
>   +    /**
>   +     * Set the active message context.
>   +     *
>   +     * @param mc - the new active message context.
>   +     */
>   +    protected static void setCurrentMessageContext(MessageContext mc) {
>   +        currentMessageContext.set(mc);
>   +    }
>   +
>   +    /**
>   +     * Get the active message context.
>   +     *
>   +     * @return the current active message context
>   +     */
>   +    public static MessageContext getCurrentMessageContext() {
>   +        return (MessageContext) currentMessageContext.get();
>   +    }
>   +
>   +    /**
>         * No-arg constructor.
>         *
>         */
> 
> 
> 
>   1.67      +8 -1
> xml-axis/java/src/org/apache/axis/MessageContext.java
> 
>   Index: MessageContext.java
>   ===================================================================
>   RCS file:
> /home/cvs/xml-axis/java/src/org/apache/axis/MessageContext.java,v
>   retrieving revision 1.66
>   retrieving revision 1.67
>   diff -u -r1.66 -r1.67
>   --- MessageContext.java     2001/11/27 04:08:59  1.66
>   +++ MessageContext.java     2001/12/05 00:27:18  1.67
>   @@ -156,10 +156,17 @@
>         */
>        private Hashtable bag ;
> 
>   +    /**
>   +     * Get the active message context.
>   +     * @return the current active message context
>   +     */
>   +    public static MessageContext getCurrentContext() {
>   +       return AxisEngine.getCurrentMessageContext();
>   +    }
>   +
>        public MessageContext(AxisEngine engine) {
>            this.axisEngine = engine;
>        }
>   -
> 
>        /**
>         * Mappings of QNames to serializers/deserializers (and therfore
> 
> 
> 
>   1.34      +12 -2
> xml-axis/java/src/org/apache/axis/client/AxisClient.java
> 
>   Index: AxisClient.java
>   ===================================================================
>   RCS file:
> /home/cvs/xml-axis/java/src/org/apache/axis/client/AxisClient.java,v
>   retrieving revision 1.33
>   retrieving revision 1.34
>   diff -u -r1.33 -r1.34
>   --- AxisClient.java    2001/12/03 22:49:23  1.33
>   +++ AxisClient.java    2001/12/05 00:27:18  1.34
>   @@ -110,7 +110,13 @@
>            String  hName = null ;
>            Handler h     = null ;
> 
>   +        // save previous context
>   +        MessageContext previousContext = getCurrentMessageContext();
>   +
>            try {
>   +            // set active context
>   +            setCurrentMessageContext(msgContext);
>   +
>                hName = msgContext.getStrProp( MessageContext.ENGINE_HANDLER
> );
>                if (category.isDebugEnabled()) {
>                    category.debug( "EngineHandler: " + hName );
>   @@ -187,11 +193,15 @@
>                    // Do SOAP Semantics checks here - this needs to be a
> call to
>                    // a pluggable object/handler/something
>                }
>   -        }
>   -        catch( Exception e ) {
>   +
>   +        } catch( Exception e ) {
>                // Should we even bother catching it ?
>                category.error( e );
>                throw AxisFault.makeFault(e);
>   +
>   +        } finally {
>   +            // restore previous state
>   +            setCurrentMessageContext(previousContext);
>            }
> 
>            if (category.isDebugEnabled()) {
> 
> 
> 
>   1.50      +10 -0
> xml-axis/java/src/org/apache/axis/server/AxisServer.java
> 
>   Index: AxisServer.java
>   ===================================================================
>   RCS file:
> /home/cvs/xml-axis/java/src/org/apache/axis/server/AxisServer.java,v
>   retrieving revision 1.49
>   retrieving revision 1.50
>   diff -u -r1.49 -r1.50
>   --- AxisServer.java    2001/12/03 22:49:24  1.49
>   +++ AxisServer.java    2001/12/05 00:27:18  1.50
>   @@ -148,7 +148,13 @@
>            String  hName = null ;
>            Handler h     = null ;
> 
>   +        // save previous context
>   +        MessageContext previousContext = getCurrentMessageContext();
>   +
>            try {
>   +            // set active context
>   +            setCurrentMessageContext(msgContext);
>   +
>                hName = msgContext.getStrProp( MessageContext.ENGINE_HANDLER
> );
> 
=== message truncated ===


=====
Davanum Srinivas - http://jguru.com/dims/

__________________________________________________
Do You Yahoo!?
Buy the perfect holiday gifts at Yahoo! Shopping.
http://shopping.yahoo.com

Mime
View raw message