Author: hemapani
Date: Sat Sep 11 08:18:04 2004
New Revision: 45897
Added:
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/project.properties
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/project.xml
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/conf/
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/conf/log4j.properties
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/conf/simplelog.properties
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/docs/
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/docs/TODO.txt
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/docs/architecture-doc.html
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/AxisFault.java
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/CommonExecutor.java
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/Handler.java
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/encoding/
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/encoding/Deserializer.java
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/encoding/Serializer.java
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/encoding/XMLPullParser.java
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/engine/
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/engine/AbstractCommonExecuter.java
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/engine/AxisEngine.java
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/engine/Global.java
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/engine/HandlerInvoker.java
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/engine/MessageContext.java
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/engine/Operation.java
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/engine/Service.java
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/engine/Transport.java
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/AbstractEngineElement.java
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/ConcreateFlow.java
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/ConcreateFlowInclude.java
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/ConcreateModuleInclude.java
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/ConcreateTypeMappingInclude.java
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/EngineElement.java
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/EngineRegistry.java
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/EngineRepository.java
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/Flow.java
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/FlowInclude.java
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/Module.java
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/ModuleInclude.java
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/NamedEngineElement.java
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/Parameter.java
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/TypeMapping.java
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/TypeMappingInclude.java
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/utils/
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/utils/HashedBaundle.java
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/schema/
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/test/
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/test/org/
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/test/org/apache/
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/test/org/apache/axis/
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/test/org/apache/axis/AbstractTestCase.java
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/test/org/apache/axis/engine/
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/test/org/apache/axis/engine/EngineTest.java
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/test/org/apache/axis/engine/registry/
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/test/org/apache/axis/engine/registry/AbstractCommonExecuter.java
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/test/org/apache/axis/engine/registry/MockFlow.java
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/test/org/apache/axis/engine/registry/SimpleEngineRegistry.java
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/test/org/apache/axis/engine/registry/SimpleGlobal.java
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/test/org/apache/axis/engine/registry/SimpleModule.java
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/test/org/apache/axis/engine/registry/SimpleOperation.java
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/test/org/apache/axis/engine/registry/SimpleService.java
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/test/org/apache/axis/engine/registry/SimpleTransport.java
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/test/org/apache/axis/engine/registry/SpeakingHandler.java
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/test/org/apache/axis/engine/registry/SpeakingProvider.java
Log:
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/project.properties
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/project.properties Sat Sep 11 08:18:04 2004
@@ -0,0 +1,9 @@
+##
+## $Revision: 1.3 $ $Date: 2004/07/28 15:21:22 $
+##
+
+maven.repo.remote=http://ws.apache.org/~dims/maven, http://www.ibiblio.org/maven, http://ws.apache.org/~hemapani/maven
+maven.xdoc.date=left
+maven.xdoc.version=${pom.currentVersion}
+
+maven.jar.excludes=**/jndi.properties
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/project.xml
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/project.xml Sat Sep 11 08:18:04 2004
@@ -0,0 +1,131 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<project>
+ <!-- a unique name for this project -->
+ <id>axis2</id>
+
+ <!-- a short but descriptive name for the project -->
+ <name>Axis2.0</name>
+
+ <!-- The version of the project under development, e.g.
+ 1.1, 1.2, 2.0-SNAPSHOT -->
+ <currentVersion>1.0</currentVersion>
+
+ <!-- details about the organization that 'owns' the project -->
+ <organization>
+ <name>Apache Software Foundation</name>
+ <url>http://www.apache.org/</url>
+ <logo>http://ws.apache.org/images/jakarta-logo-blue.gif</logo>
+ </organization>
+
+ <!-- the year the project started -->
+ <inceptionYear>2003</inceptionYear>
+ <package>org.apache.axis</package>
+ <logo>http://maven.apache.org/images/maven.jpg</logo>
+ <description>Next Generation of Apache Axis 2.0</description>
+ <!-- a short description of what the project does -->
+ <shortDescription>Axis 2.0</shortDescription>
+
+ <!-- the project home page -->
+ <url>http://ws.apache.org/axis2/</url>
+ <issueTrackingUrl>http://nagoya.apache.org/scarab/servlet/scarab/</issueTrackingUrl>
+ <siteAddress>ws.apache.org</siteAddress>
+ <siteDirectory>/www/ews.ws.apache.org/</siteDirectory>
+ <distributionDirectory>/www/ws.apache.org/builds/</distributionDirectory>
+
+ <!-- the version control repository and http url for online access
+ the connection element has the form:
+ scm:<system>:<system specific connection string> -->
+<!--
+ <repository>
+ <connection>scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:ws-axis/contrib/ews</connection>
+ <url>http://cvs.apache.org/viewcvs/ws-axis/contrib/ews/</url>
+ </repository>
+-->
+ <!-- any mailing lists for the project -->
+ <mailingLists>
+ <mailingList>
+ <name>Axis Developer List</name>
+ <subscribe>axis-dev-subscribe@ws.apache.org</subscribe>
+ <unsubscribe>axis-dev-unsubscribe@ws.apache.org</unsubscribe>
+ </mailingList>
+ </mailingLists>
+
+ <!-- ========== -->
+ <!-- Developers -->
+ <!-- ========== -->
+
+ <developers>
+ <!-- e.g.
+ <developer>
+ <name>Davanum Srinivas</name>
+ <id>dims</id>
+ <email>dims@apache.org</email>
+ <organization></organization>
+ </developer>
+ -->
+ </developers>
+
+
+
+ <!-- build information for the project -->
+ <build>
+ <nagEmailAddress>axis-dev@ws.apache.org</nagEmailAddress>
+ <sourceDirectory>src/java</sourceDirectory>
+ <unitTestSourceDirectory>src/test</unitTestSourceDirectory>
+
+ <unitTest>
+ <includes>
+ <include>**/*Test.java</include>
+ </includes>
+ </unitTest>
+
+ <resources>
+ <resource>
+ <directory>conf</directory>
+ <includes>
+ <include>**/*Provider</include>
+ <include>**/*.properties</include>
+ </includes>
+ </resource>
+ <resource>
+ <directory>schema</directory>
+ <includes>
+ <include>*.dtd</include>
+ <include>*.xsd</include>
+ </includes>
+ </resource>
+ </resources>
+ </build>
+
+ <!-- ============ -->
+ <!-- Dependencies -->
+ <!-- ============ -->
+
+ <dependencies>
+ <dependency>
+ <groupId>axis</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>SNAPSHOT</version>
+ <properties>
+ <module>true</module>
+ </properties>
+ </dependency>
+ <dependency>
+ <groupId>axis</groupId>
+ <artifactId>jaxrpc</artifactId>
+ <version>SNAPSHOT</version>
+ <properties>
+ <module>true</module>
+ </properties>
+ </dependency>
+ <dependency>
+ <groupId>axis</groupId>
+ <artifactId>saaj</artifactId>
+ <version>SNAPSHOT</version>
+ <properties>
+ <module>true</module>
+ </properties>
+ </dependency>
+ </dependencies>
+</project>
+
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/conf/log4j.properties
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/conf/log4j.properties Sat Sep 11 08:18:04 2004
@@ -0,0 +1,21 @@
+# Set root category priority to INFO and its only appender to CONSOLE.
+#log4j.rootCategory=INFO, CONSOLE
+log4j.rootCategory=FATAL, CONSOLE, LOGFILE
+
+# Set the enterprise logger category to FATAL and its only appender to CONSOLE.
+log4j.logger.org.apache.axis.enterprise=FATAL, CONSOLE,LOGFILE
+
+# CONSOLE is set to be a ConsoleAppender using a PatternLayout.
+log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
+log4j.appender.CONSOLE.Threshold=FATAL
+#log4j.appender.CONSOLE.Threshold=INFO
+log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONSOLE.layout.ConversionPattern=- %m%n
+
+# LOGFILE is set to be a File appender using a PatternLayout.
+log4j.appender.LOGFILE=org.apache.log4j.FileAppender
+log4j.appender.LOGFILE.File=axis.log
+log4j.appender.LOGFILE.Append=true
+log4j.appender.LOGFILE.Threshold=FATAL
+log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
+log4j.appender.LOGFILE.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/conf/simplelog.properties
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/conf/simplelog.properties Sat Sep 11 08:18:04 2004
@@ -0,0 +1,2 @@
+org.apache.commons.logging.simplelog.defaultlog=fatal
+
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/docs/TODO.txt
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/docs/TODO.txt Sat Sep 11 08:18:04 2004
@@ -0,0 +1 @@
+how the DD are parsed
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/docs/architecture-doc.html
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/docs/architecture-doc.html Sat Sep 11 08:18:04 2004
@@ -0,0 +1,20 @@
+<html>
+<head>
+ <title>Archtecture Guide</title>
+</head>
+<body>
+ <p>The Documents are Kept at the WIKI till
+ they take shape</p>
+ <h1>Architecture Document</h1>
+ <a href="http://wiki.apache.org/ws/FrontPage/Architecture">http://wiki.apache.org/ws/FrontPage/Architecture</a>
+ <h1>Modules</h1>
+ <ol>
+ <li><a href="http://wiki.apache.org/ws/FrontPage/Architecture/Engine">Engine</a></li>
+ <li><a href="http://wiki.apache.org/ws/FrontPage/Architecture/Encoding">Encoding</a></li>
+ <li><a href="http://wiki.apache.org/ws/FrontPage/Architecture/OM">OM</a></li>
+ <li><a href="http://wiki.apache.org/ws/FrontPage/Architecture/Deployment">Deployment</a></li>
+ <li><a href="http://wiki.apache.org/ws/FrontPage/Architecture/WSDL">WSDL</a></li>
+ <li><a href="http://wiki.apache.org/ws/FrontPage/Architecture/Build">Build</a></li>
+ </ol>
+</body>
+</html>
\ No newline at end of file
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/AxisFault.java
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/AxisFault.java Sat Sep 11 08:18:04 2004
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.axis;
+
+
+/**
+ * An exception which maps cleanly to a SOAP fault.
+ * This is a base class for exceptions which are mapped to faults.
+ * SOAP faults contain
+ * <ol>
+ * <li>A fault string
+ * <li>A fault code
+ * <li>A fault actor
+ * <li>Fault details; an xml tree of fault specific stuff
+ * </ol>
+ * @author Doug Davis (dug@us.ibm.com)
+ * @author James Snell (jasnell@us.ibm.com)
+ * @author Steve Loughran
+ */
+
+public class AxisFault extends java.rmi.RemoteException {
+ /**
+ *
+ */
+ public AxisFault() {
+ super();
+ // TODO Auto-generated constructor stub
+ }
+
+ /**
+ * @param arg0
+ */
+ public AxisFault(String arg0) {
+ super(arg0);
+ // TODO Auto-generated constructor stub
+ }
+
+ /**
+ * @param arg0
+ * @param arg1
+ */
+ public AxisFault(String arg0, Throwable arg1) {
+ super(arg0, arg1);
+ // TODO Auto-generated constructor stub
+ }
+
+}
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/CommonExecutor.java
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/CommonExecutor.java Sat Sep 11 08:18:04 2004
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.axis;
+
+import org.apache.axis.engine.MessageContext;
+import org.apache.axis.registry.EngineElement;
+
+/**
+ * Common Excecuter is self contianed. It should handle all the funcations
+ * it self. It handles following
+ * <ol>
+ * <li>Ordering of the Handlers inside itself.</li>
+ * <li>If error occured inside the send(..),recive(..) the comman executer should
+ * rollback the the handlers and throw the exeception.</li>
+ * </ol>
+ */
+public interface CommonExecutor extends EngineElement{
+ public static final String TRANSPORT_WORKER = "trnsport";
+ public static final String GLOBEL_WORKER = "globel";
+ public static final String SERVICE_WORKER = "service";
+
+ public void send(MessageContext mc)throws AxisFault;
+ public void recive(MessageContext mc)throws AxisFault;
+ public void rollback(MessageContext mc)throws AxisFault;
+ public void processFaultFlow(MessageContext mc)throws AxisFault;
+
+}
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/Handler.java
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/Handler.java Sat Sep 11 08:18:04 2004
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.axis;
+
+import java.io.Serializable;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axis.engine.MessageContext;
+import org.apache.axis.registry.NamedEngineElement;
+
+public interface Handler extends Serializable,NamedEngineElement {
+ /**
+ * Invoke is called to do the actual work of the Handler object.
+ * If there is a fault during the processing of this method it is
+ * invoke's job to catch the exception and undo any partial work
+ * that has been completed. Once we leave 'invoke' if a fault
+ * is thrown, this classes 'onFault' method will be called.
+ * Invoke should rethrow any exceptions it catches, wrapped in
+ * an AxisFault.
+ *
+ * @param msgContext the <code>MessageContext</code> to process with this
+ * <code>Handler</code>.
+ * @throws AxisFault if the handler encounters an error
+ */
+ public void invoke(MessageContext msgContext) throws AxisFault ;
+
+ /**
+ * Called when a subsequent handler throws a fault.
+ *
+ * @param msgContext the <code>MessageContext</code> to process the fault
+ * to
+ */
+ public void revoke(MessageContext msgContext);
+
+ public void setName(QName name);
+ public QName getName();
+};
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/encoding/Deserializer.java
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/encoding/Deserializer.java Sat Sep 11 08:18:04 2004
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+package org.apache.axis.encoding;
+
+import javax.xml.namespace.QName;
+
+public interface Deserializer {
+ public Object deserialize(QName xmlName,XMLPullParser parser);
+ public int deserializeInt(XMLPullParser parser);
+ public double deserializeDouble(XMLPullParser parser);
+ public long deserializeLong(XMLPullParser parser);
+ public float deserializeFloat(XMLPullParser parser);
+ public boolean deserializeBoolean(XMLPullParser parser);
+ public byte deserializeByte(XMLPullParser parser);
+ public char deserializeChar(XMLPullParser parser);
+ public short deserializeShort(XMLPullParser parser);
+}
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/encoding/Serializer.java
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/encoding/Serializer.java Sat Sep 11 08:18:04 2004
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+package org.apache.axis.encoding;
+import java.io.IOException;
+import org.apache.xml.utils.QName;
+/**
+ * I consider this to be a interface as the Axis may use differant serializers and deserializers
+ * that works on DOM/SAX/StAx ..so it can have different timplementatoins behind this.
+ * StAx(pull)->SAX->DOM :)
+ */
+public interface Serializer {
+ public void serialize(Object object,QName xmlType,QName elementName)throws IOException;
+ //Should we have overridden tyes for the simple types ??
+ //I am feel like so
+ public void serialize(int in,QName elementName)throws IOException;
+ public void serialize(double in,QName elementName)throws IOException;
+ public void serialize(float in,QName elementName)throws IOException;
+ public void serialize(byte in,QName elementName)throws IOException;
+ public void serialize(long in,QName elementName)throws IOException;
+ public void serialize(boolean in,QName elementName)throws IOException;
+ public void serialize(short in,QName elementName)throws IOException;
+ public void serialize(char in,QName elementName)throws IOException;
+}
+
+
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/encoding/XMLPullParser.java
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/encoding/XMLPullParser.java Sat Sep 11 08:18:04 2004
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+package org.apache.axis.encoding;
+
+public interface XMLPullParser {
+
+}
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/engine/AbstractCommonExecuter.java
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/engine/AbstractCommonExecuter.java Sat Sep 11 08:18:04 2004
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.axis.engine;
+
+import org.apache.axis.AxisFault;
+import org.apache.axis.CommonExecutor;
+import org.apache.axis.registry.AbstractEngineElement;
+
+public abstract class AbstractCommonExecuter extends AbstractEngineElement implements CommonExecutor {
+ public void processFaultFlow(MessageContext mc)throws AxisFault {}
+ public void rollback(MessageContext mc)throws AxisFault {}
+}
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/engine/AxisEngine.java
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/engine/AxisEngine.java Sat Sep 11 08:18:04 2004
@@ -0,0 +1,143 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.axis.engine;
+
+import java.util.Stack;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axis.AxisFault;
+import org.apache.axis.CommonExecutor;
+import org.apache.axis.registry.EngineRegistry;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * There is one engine for the Server and the Client. the send() and recive()
+ * Methods are the basic operations the Sync, Async messageing are build on top.
+ * Two methods will find and execute the <code>CommonExecuter</code>'s Transport,
+ * Global,Service.
+ */
+public class AxisEngine {
+ private Log log = LogFactory.getLog(getClass());
+ private EngineRegistry registry;
+ public AxisEngine(EngineRegistry registry){
+ log.info("Axis Engine Started");
+ this.registry = registry;
+ }
+
+ public void send(MessageContext mc)throws AxisFault{
+ Stack executionStack = new Stack();
+ QName currentTansportName = null;
+ QName currentServiceName = null;
+
+ Transport transport = null;
+ Global globel = null;
+ Service service = null;
+ Operation operation = null;
+
+ log.info("Start the send()");
+ //Dispatch the Global and Transport.
+ currentTansportName = mc.getCurrentTansport();
+ log.info("Dispatch transport");
+ transport = registry.getTransPort(currentTansportName);
+ log.info("Axis Engine Dispatch Global");
+ globel = registry.getGlobal();
+
+ log.info("Dispatch Service Name");
+ //dispatch the service Name
+ currentServiceName = mc.getCurrentService();
+ service = registry.getService(currentServiceName);
+ try{
+ service.send(mc);
+ executionStack.push(service);
+
+ globel.send(mc);
+ executionStack.push(globel);
+
+ transport.send(mc);
+ executionStack.push(transport);
+ }catch(AxisFault e){
+ while(!executionStack.isEmpty()){
+ CommonExecutor commonExecutor = (CommonExecutor)executionStack.pop();
+ commonExecutor.rollback(mc);
+ }
+ if(mc.isProcessingFault()){
+ //TODO log and exit
+ log.debug("Error in fault flow",e);
+ }else{
+ log.debug("send failed",e);
+ mc.setProcessingFault(true);
+ service.processFaultFlow(mc);
+ globel.processFaultFlow(mc);
+ transport.processFaultFlow(mc);
+ }
+ }
+ log.info("end the send()");
+ }
+
+ public void recive(MessageContext mc)throws AxisFault{
+ Stack executionStack = new Stack();
+ QName currentTansportName = null;
+ QName currentServiceName = null;
+
+ Transport transport = null;
+ Global globel = null;
+ Service service = null;
+ Operation operation = null;
+
+ log.info("Start the recive()");
+ //Dispatch the Global and Transport.
+ currentTansportName = mc.getCurrentTansport();
+ log.info("Dispatch transport");
+ transport = registry.getTransPort(currentTansportName);
+ log.info("Axis Engine Dispatch Global");
+ globel = registry.getGlobal();
+
+ try{
+ transport.recive(mc);
+ executionStack.push(transport);
+
+ globel.recive(mc);
+ executionStack.push(globel);
+
+ log.info("Dispatch Service Name");
+ //dispatch the service Name
+ currentServiceName = mc.getCurrentService();
+ service = registry.getService(currentServiceName);
+
+ service.recive(mc);
+ executionStack.push(service);
+ }catch(AxisFault e){
+ while(!executionStack.isEmpty()){
+ CommonExecutor commonExecutor = (CommonExecutor)executionStack.pop();
+ commonExecutor.rollback(mc);
+ }
+ if(mc.isProcessingFault()){
+ //TODO log and exit
+ log.debug("Error in fault flow",e);
+ }else{
+ log.debug("recive() failed",e);
+ mc.setProcessingFault(true);
+ service.processFaultFlow(mc);
+ globel.processFaultFlow(mc);
+ transport.processFaultFlow(mc);
+ }
+ }
+ log.info("end the recive()");
+ }
+}
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/engine/Global.java
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/engine/Global.java Sat Sep 11 08:18:04 2004
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.axis.engine;
+
+import org.apache.axis.CommonExecutor;
+import org.apache.axis.registry.EngineElement;
+import org.apache.axis.registry.FlowInclude;
+import org.apache.axis.registry.Module;
+import org.apache.axis.registry.ModuleInclude;
+import org.apache.axis.registry.TypeMappingInclude;
+/**
+ * Executes the Handlers that should be executed for every web Service and
+ * Contians the all global elements.
+ */
+public interface Global extends FlowInclude,EngineElement,
+ TypeMappingInclude,CommonExecutor,ModuleInclude{
+ public int getModuleCount();
+ public Module getModule(int index);
+}
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/engine/HandlerInvoker.java
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/engine/HandlerInvoker.java Sat Sep 11 08:18:04 2004
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.axis.engine;
+
+import java.util.ArrayList;
+
+import org.apache.axis.AxisFault;
+import org.apache.axis.CommonExecutor;
+import org.apache.axis.Handler;
+import org.apache.axis.registry.Flow;
+
+/**
+ * A utility class to
+ * <ol>
+ * <li>accepts Flows, Handlers and find all the Handlers.</li>
+ * <li>Order them accoreding to the Pahsed rules.</li>
+ * <li>Execute the Handlers.</li>
+ * </ol>
+ * @author Srinath Perera(hemapani@opensource.lk)
+ */
+public class HandlerInvoker {
+ private ArrayList handlers;
+ private CommonExecutor worker;
+ private int currentHandlerIndex = 0;
+
+ public HandlerInvoker(CommonExecutor worker){
+ this.worker = worker;
+ handlers = new ArrayList();
+ }
+ public void addFlow(Flow flow){
+ if(flow != null){
+ int length = flow.getHandlerCount();
+ for(int i = 0;i<length;i++){
+ handlers.add(flow.getHandler(i));
+ }
+ }
+ }
+
+ public void addHandler(Handler handler){
+ handlers.add(handler);
+ }
+
+ public void orderTheHandlers(){
+ //TODO
+ }
+
+ public void invoke(MessageContext msgcontext)throws AxisFault{
+ int length = handlers.size();
+ for(;currentHandlerIndex<length;currentHandlerIndex++){
+ Handler handler = (Handler)handlers.get(currentHandlerIndex);
+ handler.invoke(msgcontext);
+ }
+ currentHandlerIndex = 0;
+ }
+ public void revoke(MessageContext msgcontext)throws AxisFault{
+ int length = handlers.size();
+ if(currentHandlerIndex == 0){
+ currentHandlerIndex = length;
+ }
+ for(;currentHandlerIndex > 0 ;currentHandlerIndex--){
+ Handler handler = (Handler)handlers.get(currentHandlerIndex);
+ handler.revoke(msgcontext);
+ }
+ currentHandlerIndex = 0;
+ }
+}
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/engine/MessageContext.java
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/engine/MessageContext.java Sat Sep 11 08:18:04 2004
@@ -0,0 +1,83 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.axis.engine;
+
+import javax.xml.namespace.QName;
+/**
+ * The palce where all the service specific states are kept.
+ * All the Global states kept in the <code>EngineRegistry</code> and all the
+ * Service states kept in the <code>MessageContext</code>. Other runtime
+ * artifacts does not keep states foward from the execution.
+ */
+public class MessageContext {
+ private boolean processingFault = false;
+ private QName currentTansport = null;
+ private QName currentService = null;
+ private QName currentOperation = null;
+
+
+ public boolean isProcessingFault(){
+ return processingFault;
+ }
+ public void setProcessingFault(boolean processingFault){
+ this.processingFault = processingFault;
+ }
+ /**
+ * @return
+ */
+ public QName getCurrentTansport() {
+ return currentTansport;
+ }
+
+
+ /**
+ * @param name
+ */
+ public void setCurrentTansport(QName name) {
+ currentTansport = name;
+ }
+
+ /**
+ * @return
+ */
+ public QName getCurrentOperation() {
+ return currentOperation;
+ }
+
+
+ /**
+ * @param name
+ */
+ public void setCurrentOperation(QName name) {
+ currentOperation = name;
+ }
+
+ /**
+ * @param name
+ */
+ public void setCurrentService(QName name) {
+ currentService = name;
+ }
+
+ /**
+ * @return
+ */
+ public QName getCurrentService() {
+ return currentService;
+ }
+
+}
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/engine/Operation.java
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/engine/Operation.java Sat Sep 11 08:18:04 2004
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.axis.engine;
+
+import org.apache.axis.CommonExecutor;
+import org.apache.axis.Handler;
+import org.apache.axis.registry.FlowInclude;
+import org.apache.axis.registry.NamedEngineElement;
+/**
+ * Runtime representation of the WSDL Operation
+ */
+public interface Operation extends FlowInclude,NamedEngineElement,CommonExecutor{
+ public Handler getProvider();
+ public void setProvider(Handler handler);
+}
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/engine/Service.java
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/engine/Service.java Sat Sep 11 08:18:04 2004
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.axis.engine;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axis.CommonExecutor;
+import org.apache.axis.registry.FlowInclude;
+import org.apache.axis.registry.ModuleInclude;
+import org.apache.axis.registry.NamedEngineElement;
+import org.apache.axis.registry.TypeMappingInclude;
+
+/**
+ * Runtime representation of the WSDL Service
+ */
+
+public interface Service extends FlowInclude,NamedEngineElement,
+ TypeMappingInclude,CommonExecutor,ModuleInclude{
+ public Operation getOperation(QName index);
+ public void addOperation(Operation op);
+
+ public ClassLoader getClassLoader();
+}
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/engine/Transport.java
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/engine/Transport.java Sat Sep 11 08:18:04 2004
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.axis.engine;
+
+import org.apache.axis.CommonExecutor;
+import org.apache.axis.registry.FlowInclude;
+import org.apache.axis.registry.ModuleInclude;
+import org.apache.axis.registry.NamedEngineElement;
+
+/**
+ * Runtime representation of the possible transport used. e.g. HTTP/SMTP
+ */
+
+public interface Transport extends FlowInclude,NamedEngineElement
+ ,CommonExecutor,ModuleInclude{
+}
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/AbstractEngineElement.java
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/AbstractEngineElement.java Sat Sep 11 08:18:04 2004
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.axis.registry;
+
+import java.util.HashMap;
+
+import org.apache.axis.AxisFault;
+/**
+ * This is not a abstract class so the users can wrapped it.
+ * @author Srinath Perera(hemapani@opensource.lk)*
+ */
+public class AbstractEngineElement implements EngineElement{
+ private HashMap parameterMap;
+ public AbstractEngineElement() {
+ parameterMap = new HashMap();
+ }
+ public void cleanup()throws AxisFault {}
+ public void init()throws AxisFault {}
+ public void addParameter(Parameter param) {
+ parameterMap.put(param.getName(),param);
+
+ }
+ public Parameter getParameter(String key) {
+ return (Parameter)parameterMap.get(key);
+ }
+}
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/ConcreateFlow.java
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/ConcreateFlow.java Sat Sep 11 08:18:04 2004
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.axis.registry;
+
+import java.util.ArrayList;
+
+import org.apache.axis.Handler;
+
+/**
+ * @author hemapani@opensource.lk
+ */
+public class ConcreateFlow implements Flow {
+ protected ArrayList list = null;
+ public ConcreateFlow(){
+ list = new ArrayList();
+ }
+ public void addHandler(Handler handler) {
+ list.add(handler);
+ }
+ public Handler getHandler(int index) {
+ return (Handler)list.get(index);
+ }
+ public int getHandlerCount() {
+ return list.size();
+ }
+}
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/ConcreateFlowInclude.java
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/ConcreateFlowInclude.java Sat Sep 11 08:18:04 2004
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.axis.registry;
+
+/**
+ * @author hemapani@opensource.lk
+ */
+public class ConcreateFlowInclude implements FlowInclude {
+ private Flow in;
+ private Flow out;
+ private Flow fault;
+ public Flow getFaultFlow() {
+ return fault;
+ }
+
+ public Flow getInFlow() {
+ return in;
+ }
+
+ public Flow getOutFlow() {
+ return out;
+ }
+
+ public void setFaultFlow(Flow flow) {
+ this.fault = flow;
+ }
+
+ public void setInFlow(Flow flow) {
+ this.in = flow;
+ }
+
+ public void setOutFlow(Flow flow) {
+ this.out = flow;
+ }
+}
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/ConcreateModuleInclude.java
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/ConcreateModuleInclude.java Sat Sep 11 08:18:04 2004
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.axis.registry;
+
+import java.util.ArrayList;
+
+/**
+ * @author hemapani@opensource.lk
+ */
+public class ConcreateModuleInclude implements ModuleInclude {
+ private ArrayList modules;
+
+ public ConcreateModuleInclude(){
+ this.modules = new ArrayList();
+ }
+ public Module getModule(int index) {
+ return (Module)modules.get(index);
+ }
+ public int getModuleCount() {
+ return modules.size();
+ }
+ public void addModule(Module module) {
+ modules.add(module);
+ }
+}
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/ConcreateTypeMappingInclude.java
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/ConcreateTypeMappingInclude.java Sat Sep 11 08:18:04 2004
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.axis.registry;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import javax.xml.namespace.QName;
+
+/**
+ * @author hemapani@opensource.lk
+ */
+public class ConcreateTypeMappingInclude implements TypeMappingInclude{
+ private HashMap javamapping;
+ private HashMap xmlmapping;
+ private ArrayList mappingValues;
+
+ public ConcreateTypeMappingInclude(){
+ javamapping = new HashMap();
+ xmlmapping = new HashMap();
+ mappingValues = new ArrayList();
+ }
+
+ public void addTypeMapping(TypeMapping typeMapping) {
+ mappingValues.add(typeMapping);
+ javamapping.put(typeMapping.getJavaType().getName(),typeMapping);
+ xmlmapping.put(typeMapping.getXMLType(),typeMapping);
+
+ }
+
+ public TypeMapping getTypeMapping(Class javaType) {
+ return (TypeMapping)javamapping.get(javaType);
+ }
+
+ public TypeMapping getTypeMapping(int index) {
+ return (TypeMapping)mappingValues.get(index);
+ }
+
+ public TypeMapping getTypeMapping(QName xmlType) {
+ return (TypeMapping)xmlmapping.get(xmlType);
+ }
+
+ public int getTypeMappingCount() {
+ return mappingValues.size();
+ }
+
+}
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/EngineElement.java
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/EngineElement.java Sat Sep 11 08:18:04 2004
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.axis.registry;
+
+import org.apache.axis.AxisFault;
+/**
+ * This is the base class of all the elements in the Engine Registry Object Model.
+ */
+public interface EngineElement {
+ public void init()throws AxisFault;
+ public void cleanup()throws AxisFault;
+ public Parameter getParameter(String key);
+ public void addParameter(Parameter param);
+}
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/EngineRegistry.java
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/EngineRegistry.java Sat Sep 11 08:18:04 2004
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.axis.registry;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axis.AxisFault;
+import org.apache.axis.engine.Global;
+import org.apache.axis.engine.Service;
+import org.apache.axis.engine.Transport;
+
+/**
+ * The palce where all the Globel states of Axis is kept.
+ * All the Global states kept in the <code>EngineRegistry</code> and all the
+ * Service states kept in the <code>MessageContext</code>. Other runtime
+ * artifacts does not keep states foward from the execution.
+ */
+
+public interface EngineRegistry {
+ public Global getGlobal()throws AxisFault;
+
+ public int getTransportCount()throws AxisFault;
+ public Transport getTransPort(QName name)throws AxisFault;
+ public Transport getTransPort(int index)throws AxisFault;
+ public void addTransport(Transport transport)throws AxisFault;
+ public void removeTransport(QName name)throws AxisFault;
+
+ public int getServiceCount()throws AxisFault;
+ public Service getService(QName name)throws AxisFault;
+ public Service getService(int index)throws AxisFault;
+ public void addService(Service service)throws AxisFault;
+ public void removeService(QName name)throws AxisFault;
+
+ public int getModuleCount()throws AxisFault;
+ public Module getModule(QName name)throws AxisFault;
+ public Module getModule(int index)throws AxisFault;
+ public void addMdoule(Module module)throws AxisFault;
+}
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/EngineRepository.java
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/EngineRepository.java Sat Sep 11 08:18:04 2004
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.axis.registry;
+
+import org.apache.axis.CommonExecutor;
+import org.apache.axis.Handler;
+/**
+ * The Single place where all the instances of the <code>EngineRegistry</code>
+ * are created and managed. This is TODO.
+ */
+public interface EngineRepository {
+ public String register(Object objectToClone);
+ public CommonExecutor getCommonExecutor(String id);
+ public Handler getHandler(String id);
+}
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/Flow.java
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/Flow.java Sat Sep 11 08:18:04 2004
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.axis.registry;
+
+import org.apache.axis.Handler;
+/**
+ * Represents logical collection of handlers. The order of Handlers do not have
+ * any symantics.
+ */
+public interface Flow{
+ public int getHandlerCount();
+ public Handler getHandler(int index);
+ public void addHandler(Handler handler);
+}
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/FlowInclude.java
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/FlowInclude.java Sat Sep 11 08:18:04 2004
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.axis.registry;
+/**
+ * Logical Bag of Flows, a inflow, outflow,faultflow
+ */
+public interface FlowInclude{
+ public Flow getInFlow();
+ public Flow getOutFlow();
+ public Flow getFaultFlow();
+
+ public void setInFlow(Flow flow);
+ public void setOutFlow(Flow flow);
+ public void setFaultFlow(Flow flow);
+
+}
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/Module.java
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/Module.java Sat Sep 11 08:18:04 2004
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.axis.registry;
+
+/**
+ * Logical agrigation of TypeMapping,Handlers
+ */
+
+public interface Module extends FlowInclude,NamedEngineElement,TypeMappingInclude{
+
+}
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/ModuleInclude.java
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/ModuleInclude.java Sat Sep 11 08:18:04 2004
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.axis.registry;
+/**
+ * Logical Bag of Modules, a inflow, outflow,faultflow
+ */
+public interface ModuleInclude {
+ public int getModuleCount();
+ public Module getModule(int index);
+ public void addModule(Module module);
+
+}
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/NamedEngineElement.java
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/NamedEngineElement.java Sat Sep 11 08:18:04 2004
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.axis.registry;
+
+import javax.xml.namespace.QName;
+/**
+ * Engine element which has a name.
+ */
+public interface NamedEngineElement extends EngineElement{
+ public QName getName();
+}
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/Parameter.java
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/Parameter.java Sat Sep 11 08:18:04 2004
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.axis.registry;
+
+public interface Parameter {
+ public String getName();
+ public Object getValue();
+}
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/TypeMapping.java
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/TypeMapping.java Sat Sep 11 08:18:04 2004
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.axis.registry;
+
+import javax.xml.namespace.QName;
+
+/**
+ * @author hemapani@opensource.lk
+ */
+public interface TypeMapping {
+ public QName getXMLType();
+ public Class getJavaType();
+ /**
+ * @param style say it is litral or encoding
+ * @return
+ */
+ public Class getSerializer4Type(String style);
+ public Class getDeserailizer4Type(String style);
+}
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/TypeMappingInclude.java
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/TypeMappingInclude.java Sat Sep 11 08:18:04 2004
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.axis.registry;
+
+import javax.xml.namespace.QName;
+
+public interface TypeMappingInclude {
+ public int getTypeMappingCount();
+ public TypeMapping getTypeMapping(int index);
+ public TypeMapping getTypeMapping(QName xmlType);
+ public TypeMapping getTypeMapping(Class javaType);
+ public void addTypeMapping(TypeMapping typeMapping);
+}
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/utils/HashedBaundle.java
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/utils/HashedBaundle.java Sat Sep 11 08:18:04 2004
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.axis.utils;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+/**
+ * @author hemapani@opensource.lk
+ */
+public class HashedBaundle {
+ private ArrayList list;
+ private HashMap map;
+ public HashedBaundle(){
+ list = new ArrayList();
+ map = new HashMap();
+ }
+ public void add(Object key,Object obj){
+ list.add(obj);
+ map.put(key,obj);
+ }
+ public Object get(Object key){
+ return map.get(key);
+ }
+ public int getCount(){
+ return list.size();
+ }
+ public Object get(int index){
+ return this.list.get(index);
+ }
+ public void remove(Object key){
+ Object obj = map.remove(key);
+ list.remove(obj);
+ }
+
+}
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/test/org/apache/axis/AbstractTestCase.java
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/test/org/apache/axis/AbstractTestCase.java Sat Sep 11 08:18:04 2004
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.axis;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+/**
+ * Abstract base class for test cases.
+ */
+public abstract class AbstractTestCase
+ extends TestCase
+{
+ protected String testDir = "src/test/";
+ protected String sampleDir = "src/samples/";
+ protected String outDir = "target/generated/samples/";
+ protected String tempDir = "target/generated/temp";
+ /**
+ * Basedir for all file I/O. Important when running tests from
+ * the reactor.
+ */
+ public String basedir = System.getProperty("basedir");
+
+ /**
+ * Constructor.
+ */
+ public AbstractTestCase(String testName)
+ {
+ super(testName);
+ if(basedir == null){
+ basedir = new File(".").getAbsolutePath();
+ if(!(basedir.endsWith("axis")
+ ||basedir.endsWith("axis\\")
+ ||basedir.endsWith("axis/"))){
+ basedir = new File("./modules/axis").getAbsolutePath();
+ }
+ }
+ testDir = new File(basedir,testDir).getAbsolutePath();
+ sampleDir = new File(basedir,sampleDir).getAbsolutePath();
+ outDir = new File(basedir,outDir).getAbsolutePath();
+ tempDir = new File(basedir,tempDir).getAbsolutePath();
+ }
+
+ /**
+ * Get test input file.
+ *
+ * @param path Path to test input file.
+ */
+ public String getTestFile(String path)
+ {
+ return new File(basedir,path).getAbsolutePath();
+ }
+}
+
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/test/org/apache/axis/engine/EngineTest.java
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/test/org/apache/axis/engine/EngineTest.java Sat Sep 11 08:18:04 2004
@@ -0,0 +1,97 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.axis.engine;
+
+import javax.xml.namespace.QName;
+
+import junit.framework.TestCase;
+
+import org.apache.axis.engine.registry.MockFlow;
+import org.apache.axis.engine.registry.SimpleEngineRegistry;
+import org.apache.axis.engine.registry.SimpleGlobal;
+import org.apache.axis.engine.registry.SimpleModule;
+import org.apache.axis.engine.registry.SimpleOperation;
+import org.apache.axis.engine.registry.SimpleService;
+import org.apache.axis.engine.registry.SimpleTransport;
+import org.apache.axis.engine.registry.SpeakingProvider;
+import org.apache.axis.registry.EngineRegistry;
+import org.apache.axis.registry.Module;
+
+/**
+ * @author hemapani@opensource.lk
+ */
+public class EngineTest extends TestCase{
+ private QName serviceName = new QName("","EchoVoidService");
+ private QName operationName = new QName("","echoVoid");
+ private QName transportName = new QName("","NullTransport");
+ private EngineRegistry engineRegistry;
+ private MessageContext mc;
+
+ public EngineTest() {
+ super();
+ }
+
+ public EngineTest(String arg0) {
+ super(arg0);
+ }
+ protected void setUp() throws Exception {
+ Global global = new SimpleGlobal();
+ global.setInFlow(new MockFlow("globel inflow",4));
+ global.setOutFlow(new MockFlow("globel outflow",2));
+ global.setFaultFlow(new MockFlow("globel faultflow",1));
+ engineRegistry = new SimpleEngineRegistry(global);
+
+ Transport transport = new SimpleTransport(transportName);
+ transport.setInFlow(new MockFlow("transport inflow",4));
+ transport.setOutFlow(new MockFlow("transport outflow",2));
+ transport.setFaultFlow(new MockFlow("transport faultflow",1));
+ engineRegistry.addTransport(transport);
+
+ Service service = new SimpleService(serviceName);
+ service.setInFlow(new MockFlow("service inflow",4));
+ service.setOutFlow(new MockFlow("service outflow",5));
+ service.setFaultFlow(new MockFlow("service faultflow",1));
+
+ Module m1 = new SimpleModule(new QName("","A Mdoule 1"));
+ m1.setInFlow(new MockFlow("service module inflow",4));
+ m1.setFaultFlow(new MockFlow("service module faultflow",1));
+ service.addModule(m1);
+
+ Operation operation = new SimpleOperation(operationName);
+ operation.setInFlow(new MockFlow("inflow",4));
+ operation.setProvider(new SpeakingProvider());
+ service.addOperation(operation);
+ engineRegistry.addService(service);
+
+ mc = new MessageContext();
+ mc.setCurrentTansport(transportName);
+ mc.setCurrentService(serviceName);
+ mc.setCurrentOperation(operationName);
+ }
+
+ public void testSend()throws Exception{
+ AxisEngine engine = new AxisEngine(engineRegistry);
+ engine.send(mc);
+ }
+ public void testRecive()throws Exception{
+ AxisEngine engine = new AxisEngine(engineRegistry);
+ engine.recive(mc);
+ }
+ protected void tearDown() throws Exception {
+ }
+
+}
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/test/org/apache/axis/engine/registry/AbstractCommonExecuter.java
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/test/org/apache/axis/engine/registry/AbstractCommonExecuter.java Sat Sep 11 08:18:04 2004
@@ -0,0 +1,209 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.axis.engine.registry;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axis.AxisFault;
+import org.apache.axis.CommonExecutor;
+import org.apache.axis.engine.HandlerInvoker;
+import org.apache.axis.engine.MessageContext;
+import org.apache.axis.registry.AbstractEngineElement;
+import org.apache.axis.registry.ConcreateFlowInclude;
+import org.apache.axis.registry.ConcreateModuleInclude;
+import org.apache.axis.registry.ConcreateTypeMappingInclude;
+import org.apache.axis.registry.EngineElement;
+import org.apache.axis.registry.Flow;
+import org.apache.axis.registry.FlowInclude;
+import org.apache.axis.registry.Module;
+import org.apache.axis.registry.ModuleInclude;
+import org.apache.axis.registry.TypeMapping;
+import org.apache.axis.registry.TypeMappingInclude;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * This class use delegeation to give the multiple inheritance effect
+ * which is prefered over the generalization.
+ * @author (Srinath Perera)hemapani@opensource.lk
+ */
+public abstract class AbstractCommonExecuter
+ extends AbstractEngineElement
+ implements FlowInclude,EngineElement,
+ TypeMappingInclude,CommonExecutor,ModuleInclude {
+ private Log log = LogFactory.getLog(getClass());
+
+ protected HandlerInvoker invoker;
+
+ //the work is delegated to ConcreateXXInclude classes
+ protected FlowInclude flowInclude;
+ protected ModuleInclude modules;
+ protected TypeMappingInclude typemappings;
+
+ public AbstractCommonExecuter(){
+ invoker = new HandlerInvoker(this);
+ flowInclude = new ConcreateFlowInclude();
+ modules = new ConcreateModuleInclude();
+ typemappings = new ConcreateTypeMappingInclude();
+ }
+
+
+
+ public void processFaultFlow(MessageContext mc) throws AxisFault {
+ invoker.addFlow(getFaultFlow());
+ int moduleCount = getModuleCount();
+ for(int i = 0;i<moduleCount;i++){
+ Module module = getModule(i);
+ invoker.addFlow(module.getFaultFlow());
+ }
+ invoker.orderTheHandlers();
+ invoker.invoke(mc);
+ }
+
+
+ public void recive(MessageContext mc) throws AxisFault {
+ invoker.addFlow(getInFlow());
+ int moduleCount = getModuleCount();
+ for(int i = 0;i<moduleCount;i++){
+ Module module = getModule(i);
+ invoker.addFlow(module.getInFlow());
+ }
+ invoker.orderTheHandlers();
+ invoker.invoke(mc);
+ log.info("invoked "+getClass());
+ }
+
+ public void rollback(MessageContext mc) throws AxisFault {
+ invoker.revoke(mc);
+ }
+
+ public void send(MessageContext mc) throws AxisFault {
+ invoker.addFlow(getOutFlow());
+ int moduleCount = getModuleCount();
+ for(int i = 0;i<moduleCount;i++){
+ Module module = getModule(i);
+ invoker.addFlow(module.getOutFlow());
+ }
+ invoker.orderTheHandlers();
+ invoker.invoke(mc);
+ log.info("invoked "+getClass());
+ }
+
+
+ /**
+ * @return
+ */
+ public Flow getFaultFlow() {
+ return flowInclude.getFaultFlow();
+ }
+
+ /**
+ * @return
+ */
+ public Flow getInFlow() {
+ return flowInclude.getInFlow();
+ }
+
+ /**
+ * @return
+ */
+ public Flow getOutFlow() {
+ return flowInclude.getOutFlow();
+ }
+
+ /**
+ * @param flow
+ */
+ public void setFaultFlow(Flow flow) {
+ flowInclude.setFaultFlow(flow);
+ }
+
+ /**
+ * @param flow
+ */
+ public void setInFlow(Flow flow) {
+ flowInclude.setInFlow(flow);
+ }
+
+ /**
+ * @param flow
+ */
+ public void setOutFlow(Flow flow) {
+ flowInclude.setOutFlow(flow);
+ }
+
+ /**
+ * @param typeMapping
+ */
+ public void addTypeMapping(TypeMapping typeMapping) {
+ typemappings.addTypeMapping(typeMapping);
+ }
+
+ /**
+ * @param javaType
+ * @return
+ */
+ public TypeMapping getTypeMapping(Class javaType) {
+ return typemappings.getTypeMapping(javaType);
+ }
+
+ /**
+ * @param index
+ * @return
+ */
+ public TypeMapping getTypeMapping(int index) {
+ return typemappings.getTypeMapping(index);
+ }
+
+ /**
+ * @param xmlType
+ * @return
+ */
+ public TypeMapping getTypeMapping(QName xmlType) {
+ return typemappings.getTypeMapping(xmlType);
+ }
+
+ /**
+ * @return
+ */
+ public int getTypeMappingCount() {
+ return typemappings.getTypeMappingCount();
+ }
+
+ /**
+ * @param module
+ */
+ public void addModule(Module module) {
+ modules.addModule(module);
+ }
+
+ /**
+ * @param index
+ * @return
+ */
+ public Module getModule(int index) {
+ return modules.getModule(index);
+ }
+
+ /**
+ * @return
+ */
+ public int getModuleCount() {
+ return modules.getModuleCount();
+ }
+
+}
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/test/org/apache/axis/engine/registry/MockFlow.java
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/test/org/apache/axis/engine/registry/MockFlow.java Sat Sep 11 08:18:04 2004
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.axis.engine.registry;
+
+import org.apache.axis.registry.ConcreateFlow;
+import org.apache.axis.registry.Flow;
+
+public class MockFlow extends ConcreateFlow implements Flow{
+ public MockFlow(String message,int length){
+ super();
+ for(int i = 0;i<length;i++){
+ SpeakingHandler h1 = new SpeakingHandler("Executing "+ i +" inside "+message);
+ super.addHandler(h1);
+ }
+ }
+
+}
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/test/org/apache/axis/engine/registry/SimpleEngineRegistry.java
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/test/org/apache/axis/engine/registry/SimpleEngineRegistry.java Sat Sep 11 08:18:04 2004
@@ -0,0 +1,113 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.axis.engine.registry;
+
+import java.util.ArrayList;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axis.AxisFault;
+import org.apache.axis.engine.Global;
+import org.apache.axis.engine.Service;
+import org.apache.axis.engine.Transport;
+import org.apache.axis.registry.EngineRegistry;
+import org.apache.axis.registry.Module;
+import org.apache.axis.utils.HashedBaundle;
+
+public class SimpleEngineRegistry implements EngineRegistry{
+ private HashedBaundle modules;
+ private HashedBaundle transports;
+ private HashedBaundle services;
+ private Global global;
+
+ public SimpleEngineRegistry(Global global){
+ this.modules = new HashedBaundle();
+ this.transports = new HashedBaundle();
+ this.services = new HashedBaundle();
+ this.global = global;
+
+ }
+ public Global getGlobal() throws AxisFault {
+ return global;
+ }
+
+ public Module getModule(int index) throws AxisFault {
+ return (Module)modules.get(index);
+ }
+
+ public Module getModule(QName name) throws AxisFault {
+ return (Module)modules.get(name);
+ }
+
+ public int getModuleCount() throws AxisFault {
+ return modules.getCount();
+ }
+
+ public ArrayList getPahsesInOrder() throws AxisFault {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.axis.registry.EngineRegistry#getService(int)
+ */
+ public Service getService(int index) throws AxisFault {
+ return (Service)services.get(index);
+ }
+
+ public Service getService(QName name) throws AxisFault {
+ return (Service)services.get(name);
+ }
+
+ public int getServiceCount() throws AxisFault {
+ return services.getCount();
+ }
+
+ public Transport getTransPort(int index) throws AxisFault {
+ return (Transport)transports.get(index);
+ }
+
+ public Transport getTransPort(QName name) throws AxisFault {
+ return (Transport)transports.get(name);
+ }
+
+ public int getTransportCount() throws AxisFault {
+ return transports.getCount();
+ }
+
+ public void addMdoule(Module module) throws AxisFault {
+ modules.add(module.getName(),module);
+ }
+
+ public void addService(Service service) throws AxisFault {
+ services.add(service.getName(),service);
+
+ }
+
+ public void addTransport(Transport transport) throws AxisFault {
+ transports.add(transport.getName(),transport);
+ }
+
+ public void removeService(QName name) throws AxisFault {
+ services.remove(name);
+ }
+
+ public void removeTransport(QName name) throws AxisFault {
+ transports.remove(name);
+ }
+
+}
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/test/org/apache/axis/engine/registry/SimpleGlobal.java
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/test/org/apache/axis/engine/registry/SimpleGlobal.java Sat Sep 11 08:18:04 2004
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.axis.engine.registry;
+
+import org.apache.axis.engine.Global;
+
+public class SimpleGlobal extends AbstractCommonExecuter implements Global{
+}
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/test/org/apache/axis/engine/registry/SimpleModule.java
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/test/org/apache/axis/engine/registry/SimpleModule.java Sat Sep 11 08:18:04 2004
@@ -0,0 +1,104 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.axis.engine.registry;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axis.registry.AbstractEngineElement;
+import org.apache.axis.registry.Flow;
+import org.apache.axis.registry.Module;
+import org.apache.axis.registry.TypeMapping;
+
+public class SimpleModule extends AbstractEngineElement implements Module{
+ private Flow in;
+ private Flow out;
+ private Flow fault;
+ private QName name;
+
+ public SimpleModule(QName name){
+ this.name = name;
+ }
+ public Flow getFaultFlow() {
+ return fault;
+ }
+
+ public Flow getInFlow() {
+ return in;
+ }
+
+ public Flow getOutFlow() {
+ return out;
+ }
+
+ public void setFaultFlow(Flow flow) {
+ this.fault = flow;
+ }
+
+ public void setInFlow(Flow flow) {
+ this.in = flow;
+ }
+
+ public void setOutFlow(Flow flow) {
+ this.out = flow;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.axis.registry.TypeMappingInclude#addTypeMapping(org.apache.axis.registry.TypeMapping)
+ */
+ public void addTypeMapping(TypeMapping typeMapping) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.axis.registry.TypeMappingInclude#getTypeMapping(java.lang.Class)
+ */
+ public TypeMapping getTypeMapping(Class javaType) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.axis.registry.TypeMappingInclude#getTypeMapping(int)
+ */
+ public TypeMapping getTypeMapping(int index) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.axis.registry.TypeMappingInclude#getTypeMapping(javax.xml.namespace.QName)
+ */
+ public TypeMapping getTypeMapping(QName xmlType) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.axis.registry.TypeMappingInclude#getTypeMappingCount()
+ */
+ public int getTypeMappingCount() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ public QName getName() {
+ return name;
+ }
+
+
+}
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/test/org/apache/axis/engine/registry/SimpleOperation.java
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/test/org/apache/axis/engine/registry/SimpleOperation.java Sat Sep 11 08:18:04 2004
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.axis.engine.registry;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axis.AxisFault;
+import org.apache.axis.Handler;
+import org.apache.axis.engine.MessageContext;
+import org.apache.axis.engine.Operation;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+public class SimpleOperation extends AbstractCommonExecuter implements Operation{
+ private Log log = LogFactory.getLog(getClass());
+ private QName name;
+ private Handler provider;
+
+
+ public SimpleOperation(QName name){
+ this.name = name;
+ }
+ public void recive(MessageContext mc) throws AxisFault {
+ super.recive(mc);
+ Handler provider = getProvider();
+ if(provider != null){
+ log.info("invoking the Provider");
+ provider.invoke(mc);
+ }
+ }
+
+ public void send(MessageContext mc) throws AxisFault {
+ super.send(mc);
+ }
+ public QName getName() {
+ return name;
+ }
+
+ public Handler getProvider() {
+ return provider;
+ }
+
+ public void setProvider(Handler handler) {
+ provider = handler;
+ }
+
+}
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/test/org/apache/axis/engine/registry/SimpleService.java
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/test/org/apache/axis/engine/registry/SimpleService.java Sat Sep 11 08:18:04 2004
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.axis.engine.registry;
+
+import java.util.HashMap;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axis.AxisFault;
+import org.apache.axis.engine.MessageContext;
+import org.apache.axis.engine.Operation;
+import org.apache.axis.engine.Service;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+public class SimpleService extends AbstractCommonExecuter implements Service{
+ private Log log = LogFactory.getLog(getClass());
+ private HashMap operations = new HashMap();
+ private QName name;
+
+ public SimpleService(QName name){
+ this.name = name;
+ }
+ public ClassLoader getClassLoader() {
+ return Thread.currentThread().getContextClassLoader();
+ }
+
+ public Operation getOperation(QName index) {
+ return (Operation)operations.get(index);
+ }
+
+ public int getOperationCount() {
+ return operations.size();
+ }
+
+ public void recive(MessageContext mc) throws AxisFault {
+ super.recive(mc);
+ QName methodName = mc.getCurrentOperation();
+ Operation operation = getOperation(methodName);
+ log.info("find operation "+methodName);
+ operation.recive(mc);
+ }
+
+ public void send(MessageContext mc) throws AxisFault {
+ super.send(mc);
+ QName methodName = mc.getCurrentOperation();
+ Operation operation = getOperation(methodName);
+ log.info("find operation "+methodName);
+ operation.send(mc);
+ }
+
+ public QName getName() {
+ return name;
+ }
+
+ public void addOperation(Operation op) {
+ operations.put(op.getName(),op);
+ }
+
+}
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/test/org/apache/axis/engine/registry/SimpleTransport.java
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/test/org/apache/axis/engine/registry/SimpleTransport.java Sat Sep 11 08:18:04 2004
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.axis.engine.registry;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axis.engine.Transport;
+
+public class SimpleTransport extends AbstractCommonExecuter implements Transport{
+ private QName name;
+
+ public SimpleTransport(QName name){
+ this.name = name;
+ }
+
+ public QName getName() {
+ return name;
+ }
+
+}
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/test/org/apache/axis/engine/registry/SpeakingHandler.java
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/test/org/apache/axis/engine/registry/SpeakingHandler.java Sat Sep 11 08:18:04 2004
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.axis.engine.registry;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axis.AxisFault;
+import org.apache.axis.Handler;
+import org.apache.axis.engine.MessageContext;
+import org.apache.axis.registry.AbstractEngineElement;
+
+public class SpeakingHandler extends AbstractEngineElement implements Handler {
+ private String message;
+ private QName name;
+
+ public SpeakingHandler(){
+
+
+ }
+ public SpeakingHandler(String message){
+ this.message = message;
+ }
+
+ public QName getName() {
+ return name;
+ }
+
+ public void invoke(MessageContext msgContext) throws AxisFault {
+ System.out.println("I am "+ message +" Handler Running :)");
+ }
+
+ public void revoke(MessageContext msgContext) {
+ System.out.println("I am "+ message +" Handler Running :)");
+ }
+
+ public void setName(QName name) {
+ this.name = name;
+ }
+
+}
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/test/org/apache/axis/engine/registry/SpeakingProvider.java
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/test/org/apache/axis/engine/registry/SpeakingProvider.java Sat Sep 11 08:18:04 2004
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.axis.engine.registry;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axis.AxisFault;
+import org.apache.axis.Handler;
+import org.apache.axis.engine.MessageContext;
+import org.apache.axis.registry.AbstractEngineElement;
+
+public class SpeakingProvider extends AbstractEngineElement implements Handler {
+ private String message;
+ private QName name;
+
+ public SpeakingProvider(){}
+
+ public QName getName() {
+ return name;
+ }
+
+ public void invoke(MessageContext msgContext) throws AxisFault {
+ System.out.println("I am Speaking Provider Running :)");
+ }
+
+ public void revoke(MessageContext msgContext) {
+ System.out.println("I am Speaking Provider revoking :)");
+ }
+
+ public void setName(QName name) {
+ this.name = name;
+ }
+
+}
|