You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Desmond Whewell (CV/ETL)" <de...@ericsson.com> on 2007/05/25 11:17:24 UTC

[axis2]What is the equivalent of 'ServletContextListener' in Axis2?

Is there an equivalent in Axis2 that gives the capability that
ServletContextListener gives in Servlets?

I have used ServletContextListener in Tomcat as a way of copying
<context-params>, defined in web.xml, into System properties. These
properties can then be examined throughout the buisness logic to control
behaviour. The listener looks like:

        // Copy the context parameters into the System properties
        ServletContext context = event.getServletContext();

        String itemName = null;
        String itemValue = null;
        Enumeration names = context.getInitParameterNames();
        while (names.hasMoreElements()) {
            itemName = (String) (names.nextElement());

            // Do not overwrite properties that already exist. I.e.
those that
            // may have been passed in by other means.
            if (System.getProperty(itemName) == null) {
                itemValue = context.getInitParameter(itemName);
                if (itemValue != null) {
                    System.setProperty(itemName, itemValue);
                }
            }
        }


I would like to do the same with Axis2 services using the equivalent
services.xml and <parameter>. Do such hooks exist in Axis2 and will it
ensure that the properties end up in the correct classloader? 

Incidently, is there a schema definition for the services.xml instances?

Cheers, Des


RE: [axis2]What is the equivalent of 'ServletContextListener' in Axis2?

Posted by "Desmond Whewell (CV/ETL)" <de...@ericsson.com>.
Thank you, I will study that.

Was that information available on the Axis2 site? I always look there
first for reference documentation. I will add the wso2 site to my trawl
net.

Cheers, Des
 

-----Original Message-----
From: Davanum Srinivas [mailto:davanum@gmail.com] 
Sent: 25 May 2007 13:29
To: axis-user@ws.apache.org
Subject: Re: [axis2]What is the equivalent of 'ServletContextListener'
in Axis2?

Try ServiceLifeCycle:
http://wso2.org/library/333

-- dims

On 5/25/07, Desmond Whewell (CV/ETL) <de...@ericsson.com>
wrote:
>
>
> Sorry, I omitted to say I'm using Axis2 1.2 as a war file on Tomcat 
> 5.5
>
>  ________________________________
>  From: Desmond Whewell (CV/ETL) [mailto:desmond.whewell@ericsson.com]
> Sent: 25 May 2007 10:17
> To: axis-user@ws.apache.org
> Subject: [axis2]What is the equivalent of 'ServletContextListener' in
Axis2?
>
>
>
>
> Is there an equivalent in Axis2 that gives the capability that 
> ServletContextListener gives in Servlets?
>
> I have used ServletContextListener in Tomcat as a way of copying 
> <context-params>, defined in web.xml, into System properties. These 
> properties can then be examined throughout the buisness logic to 
> control behaviour. The listener looks like:
>
>         // Copy the context parameters into the System properties
>         ServletContext context = event.getServletContext();
>
>         String itemName = null;
>         String itemValue = null;
>         Enumeration names = context.getInitParameterNames();
>         while (names.hasMoreElements()) {
>             itemName = (String) (names.nextElement());
>
>             // Do not overwrite properties that already exist. I.e. 
> those that
>             // may have been passed in by other means.
>             if (System.getProperty(itemName) == null) {
>                 itemValue = context.getInitParameter(itemName);
>                 if (itemValue != null) {
>                     System.setProperty(itemName, itemValue);
>                 }
>             }
>         }
>
>
> I would like to do the same with Axis2 services using the equivalent 
> services.xml and <parameter>. Do such hooks exist in Axis2 and will it

> ensure that the properties end up in the correct classloader?
>
> Incidently, is there a schema definition for the services.xml
instances?
>
> Cheers, Des


--
Davanum Srinivas :: http://davanum.wordpress.com

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


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


Re: [axis2]What is the equivalent of 'ServletContextListener' in Axis2?

Posted by Davanum Srinivas <da...@gmail.com>.
Try ServiceLifeCycle:
http://wso2.org/library/333

-- dims

On 5/25/07, Desmond Whewell (CV/ETL) <de...@ericsson.com> wrote:
>
>
> Sorry, I omitted to say I'm using Axis2 1.2 as a war file on Tomcat 5.5
>
>  ________________________________
>  From: Desmond Whewell (CV/ETL) [mailto:desmond.whewell@ericsson.com]
> Sent: 25 May 2007 10:17
> To: axis-user@ws.apache.org
> Subject: [axis2]What is the equivalent of 'ServletContextListener' in Axis2?
>
>
>
>
> Is there an equivalent in Axis2 that gives the capability that
> ServletContextListener gives in Servlets?
>
> I have used ServletContextListener in Tomcat as a way of copying
> <context-params>, defined in web.xml, into System properties. These
> properties can then be examined throughout the buisness logic to control
> behaviour. The listener looks like:
>
>         // Copy the context parameters into the System properties
>         ServletContext context = event.getServletContext();
>
>         String itemName = null;
>         String itemValue = null;
>         Enumeration names = context.getInitParameterNames();
>         while (names.hasMoreElements()) {
>             itemName = (String) (names.nextElement());
>
>             // Do not overwrite properties that already exist. I.e. those
> that
>             // may have been passed in by other means.
>             if (System.getProperty(itemName) == null) {
>                 itemValue = context.getInitParameter(itemName);
>                 if (itemValue != null) {
>                     System.setProperty(itemName, itemValue);
>                 }
>             }
>         }
>
>
> I would like to do the same with Axis2 services using the equivalent
> services.xml and <parameter>. Do such hooks exist in Axis2 and will it
> ensure that the properties end up in the correct classloader?
>
> Incidently, is there a schema definition for the services.xml instances?
>
> Cheers, Des


-- 
Davanum Srinivas :: http://davanum.wordpress.com

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


RE: [axis2]What is the equivalent of 'ServletContextListener' in Axis2?

Posted by "Desmond Whewell (CV/ETL)" <de...@ericsson.com>.
Sorry, I omitted to say I'm using Axis2 1.2 as a war file on Tomcat 5.5

________________________________

From: Desmond Whewell (CV/ETL) [mailto:desmond.whewell@ericsson.com] 
Sent: 25 May 2007 10:17
To: axis-user@ws.apache.org
Subject: [axis2]What is the equivalent of 'ServletContextListener' in
Axis2?



Is there an equivalent in Axis2 that gives the capability that
ServletContextListener gives in Servlets? 

I have used ServletContextListener in Tomcat as a way of copying
<context-params>, defined in web.xml, into System properties. These
properties can then be examined throughout the buisness logic to control
behaviour. The listener looks like:

        // Copy the context parameters into the System properties 
        ServletContext context = event.getServletContext(); 

        String itemName = null; 
        String itemValue = null; 
        Enumeration names = context.getInitParameterNames(); 
        while (names.hasMoreElements()) { 
            itemName = (String) (names.nextElement()); 

            // Do not overwrite properties that already exist. I.e.
those that 
            // may have been passed in by other means. 
            if (System.getProperty(itemName) == null) { 
                itemValue = context.getInitParameter(itemName); 
                if (itemValue != null) { 
                    System.setProperty(itemName, itemValue); 
                } 
            } 
        } 


I would like to do the same with Axis2 services using the equivalent
services.xml and <parameter>. Do such hooks exist in Axis2 and will it
ensure that the properties end up in the correct classloader? 

Incidently, is there a schema definition for the services.xml instances?


Cheers, Des