You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Andreas Veithen <an...@gmail.com> on 2010/12/21 23:11:25 UTC

Re: svn commit: r1051479 - /axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/AxisServlet.java

Afkham,

Why would it be the responsibility of a method called "initTransport"
to initialize the ListingAgent?

Andreas

On Tue, Dec 21, 2010 at 13:54,  <az...@apache.org> wrote:
> Author: azeez
> Date: Tue Dec 21 12:54:09 2010
> New Revision: 1051479
>
> URL: http://svn.apache.org/viewvc?rev=1051479&view=rev
> Log:
> Fix for AXIS2-3863
>
>
> Modified:
>    axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/AxisServlet.java
>
> Modified: axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/AxisServlet.java
> URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/AxisServlet.java?rev=1051479&r1=1051478&r2=1051479&view=diff
> ==============================================================================
> --- axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/AxisServlet.java (original)
> +++ axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/AxisServlet.java Tue Dec 21 12:54:09 2010
> @@ -478,19 +478,21 @@ public class AxisServlet extends HttpSer
>                         "must be configured with a port number. WSDL generation will be " +
>                         "unreliable.");
>             }
> -
> -            ListenerManager listenerManager = new ListenerManager();
> -            listenerManager.init(configContext);
> -            listenerManager.start();
> -            agent = new ListingAgent(configContext);
>
> +            initTransport();
>             initParams();
> -
>         } catch (Exception e) {
>             throw new ServletException(e);
>         }
>     }
> -
> +
> +    protected void initTransport() {
> +        ListenerManager listenerManager = new ListenerManager();
> +        listenerManager.init(configContext);
> +        listenerManager.start();
> +        agent = new ListingAgent(configContext);
> +    }
> +
>     private AxisServletListener getAxisServletListener(String name) {
>         TransportInDescription desc = axisConfiguration.getTransportIn(name);
>         if (desc == null) {
> @@ -550,9 +552,7 @@ public class AxisServlet extends HttpSer
>      */
>     @Override
>     public void init() throws ServletException {
> -        if (this.servletConfig != null
> -                &&
> -                !initCalled) {
> +        if (this.servletConfig != null && !initCalled) {
>             init(this.servletConfig);
>         }
>     }
>
>
>

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


Re: svn commit: r1051479 - /axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/AxisServlet.java

Posted by Afkham Azeez <af...@gmail.com>.
Actually, ListingAgent code does not belong in AxisServlet since this is
something related to the Axis2 console. It was wrong to place that in
AxisServlet in the first place.

Azeez

On Wed, Dec 22, 2010 at 10:58 AM, Afkham Azeez <af...@gmail.com> wrote:

> Yeah, thanks for pointing out. I will move the ListingAgent init code to a
> separate method.
>
> Azeez
>
>
> On Wed, Dec 22, 2010 at 3:41 AM, Andreas Veithen <
> andreas.veithen@gmail.com> wrote:
>
>> Afkham,
>>
>> Why would it be the responsibility of a method called "initTransport"
>> to initialize the ListingAgent?
>>
>> Andreas
>>
>> On Tue, Dec 21, 2010 at 13:54,  <az...@apache.org> wrote:
>> > Author: azeez
>> > Date: Tue Dec 21 12:54:09 2010
>> > New Revision: 1051479
>> >
>> > URL: http://svn.apache.org/viewvc?rev=1051479&view=rev
>> > Log:
>> > Fix for AXIS2-3863
>> >
>> >
>> > Modified:
>> >
>>  axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/AxisServlet.java
>> >
>> > Modified:
>> axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/AxisServlet.java
>> > URL:
>> http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/AxisServlet.java?rev=1051479&r1=1051478&r2=1051479&view=diff
>> >
>> ==============================================================================
>> > ---
>> axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/AxisServlet.java
>> (original)
>> > +++
>> axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/AxisServlet.java
>> Tue Dec 21 12:54:09 2010
>> > @@ -478,19 +478,21 @@ public class AxisServlet extends HttpSer
>> >                         "must be configured with a port number. WSDL
>> generation will be " +
>> >                         "unreliable.");
>> >             }
>> > -
>> > -            ListenerManager listenerManager = new ListenerManager();
>> > -            listenerManager.init(configContext);
>> > -            listenerManager.start();
>> > -            agent = new ListingAgent(configContext);
>> >
>> > +            initTransport();
>> >             initParams();
>> > -
>> >         } catch (Exception e) {
>> >             throw new ServletException(e);
>> >         }
>> >     }
>> > -
>> > +
>> > +    protected void initTransport() {
>> > +        ListenerManager listenerManager = new ListenerManager();
>> > +        listenerManager.init(configContext);
>> > +        listenerManager.start();
>> > +        agent = new ListingAgent(configContext);
>> > +    }
>> > +
>> >     private AxisServletListener getAxisServletListener(String name) {
>> >         TransportInDescription desc =
>> axisConfiguration.getTransportIn(name);
>> >         if (desc == null) {
>> > @@ -550,9 +552,7 @@ public class AxisServlet extends HttpSer
>> >      */
>> >     @Override
>> >     public void init() throws ServletException {
>> > -        if (this.servletConfig != null
>> > -                &&
>> > -                !initCalled) {
>> > +        if (this.servletConfig != null && !initCalled) {
>> >             init(this.servletConfig);
>> >         }
>> >     }
>> >
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
>> For additional commands, e-mail: java-dev-help@axis.apache.org
>>
>>
>
>
> --
> *Afkham Azeez*
> Senior Software Architect & Senior Manager; WSO2, Inc.; http://wso2.com,
> *
> *
> *Member; Apache Software Foundation; **http://www.apache.org/*<http://www.apache.org/>
> *
> email: **azeez@wso2.com* <az...@wso2.com>* cell: +94 77 3320919
> blog: **http://blog.afkham.org* <http://blog.afkham.org>*
> twitter: **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez>
> *
> linked-in: **http://lk.linkedin.com/in/afkhamazeez*
> *
> *
> *Lean . Enterprise . Middleware*
> *
> *
>
>


-- 
*Afkham Azeez*
Senior Software Architect & Senior Manager; WSO2, Inc.; http://wso2.com,
*
*
*Member; Apache Software Foundation;
**http://www.apache.org/*<http://www.apache.org/>
*
email: **azeez@wso2.com* <az...@wso2.com>* cell: +94 77 3320919
blog: **http://blog.afkham.org* <http://blog.afkham.org>*
twitter: **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez>
*
linked-in: **http://lk.linkedin.com/in/afkhamazeez*
*
*
*Lean . Enterprise . Middleware*
*
*

Re: svn commit: r1051479 - /axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/AxisServlet.java

Posted by Afkham Azeez <af...@gmail.com>.
Yeah, thanks for pointing out. I will move the ListingAgent init code to a
separate method.

Azeez

On Wed, Dec 22, 2010 at 3:41 AM, Andreas Veithen
<an...@gmail.com>wrote:

> Afkham,
>
> Why would it be the responsibility of a method called "initTransport"
> to initialize the ListingAgent?
>
> Andreas
>
> On Tue, Dec 21, 2010 at 13:54,  <az...@apache.org> wrote:
> > Author: azeez
> > Date: Tue Dec 21 12:54:09 2010
> > New Revision: 1051479
> >
> > URL: http://svn.apache.org/viewvc?rev=1051479&view=rev
> > Log:
> > Fix for AXIS2-3863
> >
> >
> > Modified:
> >
>  axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/AxisServlet.java
> >
> > Modified:
> axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/AxisServlet.java
> > URL:
> http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/AxisServlet.java?rev=1051479&r1=1051478&r2=1051479&view=diff
> >
> ==============================================================================
> > ---
> axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/AxisServlet.java
> (original)
> > +++
> axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/AxisServlet.java
> Tue Dec 21 12:54:09 2010
> > @@ -478,19 +478,21 @@ public class AxisServlet extends HttpSer
> >                         "must be configured with a port number. WSDL
> generation will be " +
> >                         "unreliable.");
> >             }
> > -
> > -            ListenerManager listenerManager = new ListenerManager();
> > -            listenerManager.init(configContext);
> > -            listenerManager.start();
> > -            agent = new ListingAgent(configContext);
> >
> > +            initTransport();
> >             initParams();
> > -
> >         } catch (Exception e) {
> >             throw new ServletException(e);
> >         }
> >     }
> > -
> > +
> > +    protected void initTransport() {
> > +        ListenerManager listenerManager = new ListenerManager();
> > +        listenerManager.init(configContext);
> > +        listenerManager.start();
> > +        agent = new ListingAgent(configContext);
> > +    }
> > +
> >     private AxisServletListener getAxisServletListener(String name) {
> >         TransportInDescription desc =
> axisConfiguration.getTransportIn(name);
> >         if (desc == null) {
> > @@ -550,9 +552,7 @@ public class AxisServlet extends HttpSer
> >      */
> >     @Override
> >     public void init() throws ServletException {
> > -        if (this.servletConfig != null
> > -                &&
> > -                !initCalled) {
> > +        if (this.servletConfig != null && !initCalled) {
> >             init(this.servletConfig);
> >         }
> >     }
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-dev-help@axis.apache.org
>
>


-- 
*Afkham Azeez*
Senior Software Architect & Senior Manager; WSO2, Inc.; http://wso2.com,
*
*
*Member; Apache Software Foundation;
**http://www.apache.org/*<http://www.apache.org/>
*
email: **azeez@wso2.com* <az...@wso2.com>* cell: +94 77 3320919
blog: **http://blog.afkham.org* <http://blog.afkham.org>*
twitter: **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez>
*
linked-in: **http://lk.linkedin.com/in/afkhamazeez*
*
*
*Lean . Enterprise . Middleware*
*
*