You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by de...@apache.org on 2005/07/19 07:38:30 UTC

svn commit: r219618 - in /webservices/axis/trunk/java/modules/core: src/org/apache/axis2/deployment/ src/org/apache/axis2/description/ src/org/apache/axis2/engine/ src/org/apache/axis2/phaseresolver/ test-resources/deployment/ConfigWithObservers/ test/...

Author: deepal
Date: Mon Jul 18 22:37:23 2005
New Revision: 219618

URL: http://svn.apache.org/viewcvs?rev=219618&view=rev
Log:
Making AxisConfiguartion observable . I will send a descriptive mail to mailing list soon

Added:
    webservices/axis/trunk/java/modules/core/src/org/apache/axis2/engine/AxisEvent.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis2/engine/AxisObserver.java
    webservices/axis/trunk/java/modules/core/test-resources/deployment/ConfigWithObservers/
    webservices/axis/trunk/java/modules/core/test-resources/deployment/ConfigWithObservers/axis2.xml
    webservices/axis/trunk/java/modules/core/test/org/apache/axis2/deployment/AddingObserverTest.java
    webservices/axis/trunk/java/modules/core/test/org/apache/axis2/deployment/AxisObserverImpl.java
Modified:
    webservices/axis/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentConstants.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentParser.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis2/deployment/axis2.xml
    webservices/axis/trunk/java/modules/core/src/org/apache/axis2/description/ServiceDescription.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfiguration.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfigurationImpl.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis2/phaseresolver/PhaseResolver.java

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentConstants.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentConstants.java?rev=219618&r1=219617&r2=219618&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentConstants.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentConstants.java Mon Jul 18 22:37:23 2005
@@ -27,6 +27,7 @@
     String SERVICEWSDL = "META-INF/service.wsdl";
     String MODULEXML = "META-INF/module.xml";
     String PARAMETERST = "parameter";// paramater start tag
+    String LISTENERST = "listener";// paramater start tag
     String HANDERST = "handler";
     String MODULEST = "module";
     String PHASEST = "phase";

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentParser.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentParser.java?rev=219618&r1=219617&r2=219618&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentParser.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentParser.java Mon Jul 18 22:37:23 2005
@@ -30,6 +30,7 @@
 import org.apache.axis2.engine.AxisConfigurationImpl;
 import org.apache.axis2.engine.AxisFault;
 import org.apache.axis2.engine.MessageReceiver;
+import org.apache.axis2.engine.AxisObserver;
 import org.apache.axis2.transport.TransportListener;
 import org.apache.axis2.transport.TransportSender;
 import org.apache.commons.logging.Log;
@@ -42,6 +43,8 @@
 import javax.xml.stream.XMLStreamReader;
 import java.io.InputStream;
 import java.util.ArrayList;
+import java.util.Observer;
+import java.util.Observable;
 
 /**
  * This class is used to parse the following xml douments
@@ -229,6 +232,8 @@
                                     "Flow type is a required attribute in " +
                                     ST);
                         }
+                    } else if (LISTENERST.equals(ST)){
+                        processListener(axisGlobal);
                     } else {
                         throw new UnsupportedOperationException(
                                 ST +
@@ -618,6 +623,66 @@
         parameter.setValue(element);
         return parameter;
     }
+
+    private void processListener(AxisConfigurationImpl axisGlobal) throws DeploymentException {
+        AxisObserver observer = null;
+        int attribCount = pullparser.getAttributeCount();
+        if (attribCount ==1) {
+            String attname = pullparser.getAttributeLocalName(0);
+            String attvalue = pullparser.getAttributeValue(0);
+            if (CLASSNAME.equals(attname)) {
+                try {
+                    Class observerclass =  Class.forName(attvalue,true,Thread.currentThread().
+                            getContextClassLoader());
+                    observer =  (AxisObserver) observerclass.newInstance();
+                } catch (ClassNotFoundException e) {
+                    throw new DeploymentException(e);
+                } catch (IllegalAccessException e) {
+                    throw new DeploymentException(e);
+                } catch (InstantiationException e) {
+                    throw new DeploymentException(e);
+                }
+            }
+
+        } else {
+            throw new DeploymentException("bad listener arguments");
+        }
+
+        boolean END_LISTENER = false;
+        try {
+            while (!END_LISTENER) {
+                int eventType = pullparser.next();
+                if (eventType == XMLStreamConstants.END_DOCUMENT) {
+                    END_LISTENER = true;
+                }else if (eventType == XMLStreamConstants.START_ELEMENT) {
+                    String tagnae = pullparser.getLocalName();
+                    if (tagnae.equals(PARAMETERST)) {
+                        Parameter parameter = processParameter();
+                        observer.addParameter(parameter);
+                    } else {
+                        throw new DeploymentException(
+                                "parser Exception : un supported element" +
+                                tagnae);
+                    }
+
+                }else if (eventType == XMLStreamConstants.END_ELEMENT) {
+                    String endtagname = pullparser.getLocalName();
+                    if (LISTENERST.equals(endtagname)) {
+                        END_LISTENER = true;
+                        break;
+                    }
+                } else if (eventType == XMLStreamConstants.CHARACTERS) {
+                }
+            }
+        } catch (XMLStreamException e) {
+            throw new DeploymentException("parser Exception", e);
+        } catch (Exception e) {
+            throw new DeploymentException(e);
+        }
+        observer.init();
+        axisGlobal.addObservers(observer);
+    }
+
 
     /**
      * this method is to process the HandlerMetaData tag in the either service.xml or axis2.xml

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis2/deployment/axis2.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/deployment/axis2.xml?rev=219618&r1=219617&r2=219618&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis2/deployment/axis2.xml (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis2/deployment/axis2.xml Mon Jul 18 22:37:23 2005
@@ -11,6 +11,11 @@
     <parameter name="userName" locked="xsd:false">admin</parameter>
     <parameter name="password" locked="xsd:false">axis2</parameter>
 
+<!--    The way of adding listener to the system-->
+<!--    <listener class="org.apache.axis2.ObserverIMPL">-->
+<!--        <parameter name="RSS_URL" locked="xsd:false">http://127.0.0.1/rss</parameter>-->
+<!--    </listener>-->
+
 
 
     <!-- ================================================= -->

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis2/description/ServiceDescription.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/description/ServiceDescription.java?rev=219618&r1=219617&r2=219618&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis2/description/ServiceDescription.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis2/description/ServiceDescription.java Mon Jul 18 22:37:23 2005
@@ -40,11 +40,7 @@
 import javax.xml.namespace.QName;
 import java.io.IOException;
 import java.io.Writer;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
+import java.util.*;
 
 /**
  * Class ServiceDescription
@@ -58,7 +54,8 @@
 
     private Definition difDefinition = null; //to store the wsdl definition , which is build at the deployment time
 
-
+    //to keep the time that last update time of the service
+    private long lastupdate ;
     /**
      * TODO this should be in the WSDLInterface, yet we want it to have in the
      * the Services, so we put this here for M1 until we foud better way to do
@@ -626,6 +623,17 @@
         } catch (IOException e) {
             throw new AxisFault(e);
         }
+    }
+
+    /**
+     * This method will set the current time as last update time of the service
+     */
+    public void setLastupdate(){
+        lastupdate = new Date().getTime();
+    }
+
+    public long getLastupdate(){
+        return lastupdate;
     }
 
 }

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfiguration.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfiguration.java?rev=219618&r1=219617&r2=219618&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfiguration.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfiguration.java Mon Jul 18 22:37:23 2005
@@ -22,9 +22,7 @@
 import org.apache.axis2.description.TransportOutDescription;
 
 import javax.xml.namespace.QName;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Hashtable;
+import java.util.*;
 
 /**
  * The palce where all the Global states of Axis is kept.

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfigurationImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfigurationImpl.java?rev=219618&r1=219617&r2=219618&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfigurationImpl.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfigurationImpl.java Mon Jul 18 22:37:23 2005
@@ -30,12 +30,7 @@
 
 import javax.xml.namespace.QName;
 import java.io.File;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
+import java.util.*;
 
 /**
  * Class EngineRegistryImpl
@@ -48,6 +43,7 @@
 
     private Hashtable errornesModules;
 
+
     /**
      * Field modules
      */
@@ -91,6 +87,9 @@
 
     private String axis2Repository = null;
 
+    //to store AxisObserver Objects
+    private ArrayList observersList = null;
+
     protected HashMap messagRecievers;
     /////////////////////// From AxisGlobal /////////////////////////////////////
     /**
@@ -107,6 +106,7 @@
         outFaultPhases = new ArrayList();
         errornesServices = new Hashtable();
         errornesModules = new Hashtable();
+        observersList = new ArrayList();
 
         inPhasesUptoAndIncludingPostDispatch = new ArrayList();
         inPhasesUptoAndIncludingPostDispatch.add(
@@ -163,6 +163,8 @@
         services.put(service.getName(), service);
         PhaseResolver handlerResolver = new PhaseResolver(this, service);
         handlerResolver.buildchains();
+        service.setLastupdate();
+        notifyObserves(AxisEvent.SERVICE_DEPLOY ,service);
     }
 
     /**
@@ -202,6 +204,10 @@
      * @throws AxisFault
      */
     public synchronized void removeService(QName name) throws AxisFault {
+        ServiceDescription service = getService(name);
+        if (service != null) {
+            notifyObserves(AxisEvent.SERVICE_DEPLOY , service);
+        }
         services.remove(name);
     }
 
@@ -382,4 +388,16 @@
         this.axis2Repository = axis2Repository;
     }
 
+    private void notifyObserves(int event_type , ServiceDescription service){
+        AxisEvent event = new AxisEvent(service,event_type);
+        for (int i = 0; i < observersList.size(); i++) {
+            AxisObserver axisObserver = (AxisObserver) observersList.get(i);
+            axisObserver.update(event);
+        }
+    }
+
+    public void addObservers(AxisObserver axisObserver){
+        observersList.add(axisObserver);
+    }
+    
 }

Added: webservices/axis/trunk/java/modules/core/src/org/apache/axis2/engine/AxisEvent.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/engine/AxisEvent.java?rev=219618&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis2/engine/AxisEvent.java (added)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis2/engine/AxisEvent.java Mon Jul 18 22:37:23 2005
@@ -0,0 +1,58 @@
+package org.apache.axis2.engine;
+
+import org.apache.axis2.description.ServiceDescription;
+
+import java.util.EventObject;
+
+/*
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*
+*/
+
+/**
+ * Author : Deepal Jayasinghe
+ * Date: Jul 18, 2005
+ * Time: 2:40:02 PM
+ */
+public class AxisEvent {
+
+    /**
+     * Axis event will throw when ever some considerable thing happen to
+     * <code>AxisConfiguration</code>  and registred Listeners will get
+     * informed.
+     */
+
+    public static final int SERVICE_DEPLOY = 1;
+    public static final int SERVICE_REMOVE = 0;
+
+    private ServiceDescription service ;
+
+    private int EVENT_TYPE;
+
+    public AxisEvent(ServiceDescription service, int EVENT_TYPE) {
+        this.service = service;
+        this.EVENT_TYPE = EVENT_TYPE;
+    }
+
+    public ServiceDescription getService() {
+        return service;
+    }
+
+    public int getEventType() {
+        return EVENT_TYPE;
+    }
+
+}

Added: webservices/axis/trunk/java/modules/core/src/org/apache/axis2/engine/AxisObserver.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/engine/AxisObserver.java?rev=219618&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis2/engine/AxisObserver.java (added)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis2/engine/AxisObserver.java Mon Jul 18 22:37:23 2005
@@ -0,0 +1,36 @@
+package org.apache.axis2.engine;
+
+import org.apache.axis2.description.Parameter;
+
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * 
+ */
+
+/**
+ * Author : Deepal Jayasinghe
+ * Date: Jul 19, 2005
+ * Time: 9:51:26 AM
+ */
+public interface AxisObserver {
+    //The initilization code will go here
+    void init();
+    void update(AxisEvent event);
+
+    //there can be parameters for the Observers
+    void addParameter(Parameter parameter);
+    Parameter getParameter(String name);
+}

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis2/phaseresolver/PhaseResolver.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/phaseresolver/PhaseResolver.java?rev=219618&r1=219617&r2=219618&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis2/phaseresolver/PhaseResolver.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis2/phaseresolver/PhaseResolver.java Mon Jul 18 22:37:23 2005
@@ -535,6 +535,7 @@
         HashMap opeartions = service.getOperations();
         Collection opCol = opeartions.values();
         boolean engaged = false;
+        service.addModuleOperations(module);
         for (Iterator iterator = opCol.iterator(); iterator.hasNext();) {
             OperationDescription opDesc = (OperationDescription) iterator.next();
             Collection modules = opDesc.getModules();
@@ -551,7 +552,6 @@
                 opDesc.addToEngageModuleList(module);
             }
         }
-        service.addModuleOperations(module);
     }
 
 

Added: webservices/axis/trunk/java/modules/core/test-resources/deployment/ConfigWithObservers/axis2.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test-resources/deployment/ConfigWithObservers/axis2.xml?rev=219618&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/core/test-resources/deployment/ConfigWithObservers/axis2.xml (added)
+++ webservices/axis/trunk/java/modules/core/test-resources/deployment/ConfigWithObservers/axis2.xml Mon Jul 18 22:37:23 2005
@@ -0,0 +1,100 @@
+<axisconfig name="AxisJava2.0">
+    <!-- ================================================= -->
+    <!-- Parameters -->
+    <!-- ================================================= -->
+    <parameter name="hotdeployment" locked="xsd:false">true</parameter>
+    <parameter name="hotupdate" locked="xsd:false">false</parameter>
+    <!-- Uncomment this to enable REST support -->
+    <!--    <parameter name="enableREST" locked="xsd:false">true</parameter>-->
+
+
+    <parameter name="userName" locked="xsd:false">admin</parameter>
+    <parameter name="password" locked="xsd:false">axis2</parameter>
+
+<!--    The way of adding listener to the system-->
+    <listener class="org.apache.axis2.deployment.AxisObserverImpl">
+        <parameter name="RSS_URL" locked="xsd:false">http://127.0.0.1/rss</parameter>
+    </listener>
+
+
+
+    <!-- ================================================= -->
+    <!-- Message Receivers -->
+    <!-- ================================================= -->
+    <!-- This is the Deafult Message Receiver for the Request Response style Operations -->
+    <messageReceiver mep="INOUT" class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
+
+    <!-- ================================================= -->
+    <!-- Transport Ins -->
+    <!-- ================================================= -->
+    <transportReceiver name="http" class="org.apache.axis2.transport.http.SimpleHTTPServer">
+        <parameter name="port" locked="xsd:false">6060</parameter>
+    </transportReceiver>
+
+    <!-- Uncomment this one with the appropriate papameters to enable the SMTP transport Receiver
+    <transportReceiver name="mail" class="org.apache.axis2.transport.mail.SimpleMailListener">
+          <parameter name="transport.mail.pop3.host" locked="xsd:false">127.0.0.1</parameter>
+          <parameter name="transport.mail.pop3.user" locked="xsd:false">axis2</parameter>
+          <parameter name="transport.mail.pop3.password" locked="xsd:false">axis2</parameter>
+          <parameter name="transport.mail.pop3.port" locked="xsd:false">110</parameter>
+          <parameter name="transport.mail.replyToAddress" locked="xsd:false">axis2@127.0.0.1</parameter>
+      </transportReceiver> -->
+
+    <transportReceiver name="tcp" class="org.apache.axis2.transport.tcp.TCPServer">
+        <parameter name="port" locked="xsd:false">6060</parameter>
+    </transportReceiver>
+
+    <!-- ================================================= -->
+    <!-- Transport Outs -->
+    <!-- ================================================= -->
+
+    <transportSender name="http" class="org.apache.axis2.transport.http.HTTPTransportSender"/>
+    <transportSender name="tcp" class="org.apache.axis2.transport.tcp.TCPTransportSender"/>
+    <transportSender name="local" class="org.apache.axis2.transport.local.LocalTransportSender"/>
+    <transportSender name="commons-http" class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
+        <parameter name="PROTOCOL" locked="xsd:false">HTTP/1.1</parameter>
+        <parameter name="Transfer-Encoding" locked="xsd:false">chunked</parameter>
+    </transportSender>
+
+    <!-- Uncomment this one with the appropriate papameters to enable the SMTP transport Receiver
+   <transportSender name="mail" class="org.apache.axis2.transport.mail.MailTransportSender">
+       <parameter name="transport.mail.smtp.host" locked="xsd:false">127.0.0.1</parameter>
+       <parameter name="transport.mail.smtp.user" locked="xsd:false">axis2</parameter>
+       <parameter name="transport.mail.smtp.password" locked="xsd:false">axis2</parameter>
+       <parameter name="transport.mail.smtp.port" locked="xsd:false">25</parameter>
+   </transportSender>
+   -->
+
+    <!-- ================================================= -->
+    <!-- Global Modules  -->
+    <!-- ================================================= -->
+    <!-- Uncomment this to enable Addressing
+    <module ref="addressing"/> -->
+
+    <!-- ================================================= -->
+    <!-- Phases  -->
+    <!-- ================================================= -->
+    <phaseOrder type="inflow">
+        <!--  System pre defined phases       -->
+        <phase name="TransportIn"/>
+        <phase name="PreDispatch"/>
+        <phase name="Dispatch"/>
+        <phase name="PostDispatch"/>
+        <!--  System pre defined phases       -->
+        <!--   After Postdispatch phase module author or or service author can add any phase he want      -->
+        <phase name="userphase1"/>
+    </phaseOrder>
+    <phaseOrder type="outflow">
+        <!--      user can add his own phases to this area  -->
+        <phase name="userphase1"/>
+    </phaseOrder>
+    <phaseOrder type="INfaultflow">
+        <!--      user can add his own phases to this area  -->
+        <phase name="userphase1"/>
+    </phaseOrder>
+    <phaseOrder type="Outfaultflow">
+        <!--      user can add his own phases to this area  -->
+        <phase name="userphase1"/>
+    </phaseOrder>
+</axisconfig>
+

Added: webservices/axis/trunk/java/modules/core/test/org/apache/axis2/deployment/AddingObserverTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test/org/apache/axis2/deployment/AddingObserverTest.java?rev=219618&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/core/test/org/apache/axis2/deployment/AddingObserverTest.java (added)
+++ webservices/axis/trunk/java/modules/core/test/org/apache/axis2/deployment/AddingObserverTest.java Mon Jul 18 22:37:23 2005
@@ -0,0 +1,44 @@
+package org.apache.axis2.deployment;
+
+import org.apache.axis2.engine.AxisConfiguration;
+import org.apache.axis2.context.ConfigurationContextFactory;
+import junit.framework.TestCase;
+
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * 
+ */
+
+/**
+ * Author : Deepal Jayasinghe
+ * Date: Jul 19, 2005
+ * Time: 10:24:15 AM
+ */
+public class AddingObserverTest extends TestCase{
+
+     AxisConfiguration er;
+
+    public void testAddingObservs() throws Exception{
+        try {
+            String filename = "./test-resources/deployment/ConfigWithObservers";
+            ConfigurationContextFactory builder = new ConfigurationContextFactory();
+            er =  builder.buildConfigurationContext(filename).getAxisConfiguration();
+            assertNotNull(er);
+        } catch (DeploymentException e) {
+            throw new DeploymentException(e);
+        }
+    }
+}

Added: webservices/axis/trunk/java/modules/core/test/org/apache/axis2/deployment/AxisObserverImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test/org/apache/axis2/deployment/AxisObserverImpl.java?rev=219618&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/core/test/org/apache/axis2/deployment/AxisObserverImpl.java (added)
+++ webservices/axis/trunk/java/modules/core/test/org/apache/axis2/deployment/AxisObserverImpl.java Mon Jul 18 22:37:23 2005
@@ -0,0 +1,49 @@
+package org.apache.axis2.deployment;
+
+import org.apache.axis2.engine.AxisObserver;
+import org.apache.axis2.engine.AxisEvent;
+import org.apache.axis2.description.Parameter;
+
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * 
+ */
+
+/**
+ * Author : Deepal Jayasinghe
+ * Date: Jul 19, 2005
+ * Time: 10:55:51 AM
+ */
+public class AxisObserverImpl implements AxisObserver{
+
+    //The initilization code will go here
+    public void init() {
+        //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public void update(AxisEvent event) {
+        //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    //there can be parameters for the Observers
+    public void addParameter(Parameter parameter) {
+        //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public Parameter getParameter(String name) {
+        return null;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+}