You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by pr...@apache.org on 2007/06/27 18:46:04 UTC
svn commit: r551228 [10/23] - in /webservices/axis2/branches/java/jaxws21:
./ etc/ modules/adb-codegen/src/org/apache/axis2/schema/
modules/adb-codegen/src/org/apache/axis2/schema/template/
modules/adb-codegen/src/org/apache/axis2/schema/writer/ module...
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/conf/axis2.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/conf/axis2.xml?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/conf/axis2.xml (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/conf/axis2.xml Wed Jun 27 09:45:37 2007
@@ -183,6 +183,38 @@
</transportReceiver>-->
<!-- ================================================= -->
+ <!-- Non-blocking http/s Transport Listener -->
+
+ <!-- the non blocking http transport based on HttpCore + NIO extensions
+ <transportReceiver name="http" class="org.apache.axis2.transport.nhttp.HttpCoreNIOListener">
+ <parameter name="port" locked="false">9000</parameter>
+ <parameter name="non-blocking" locked="false">true</parameter>
+ </transportReceiver>-->
+
+ <!-- the non blocking https transport based on HttpCore + SSL-NIO extensions
+ <transportReceiver name="https" class="org.apache.axis2.transport.nhttp.HttpCoreNIOSSLListener">
+ <parameter name="port" locked="false">9002</parameter>
+ <parameter name="non-blocking" locked="false">true</parameter>
+ <parameter name="keystore" locked="false">
+ <KeyStore>
+ <Location>identity.jks</Location>
+ <Type>JKS</Type>
+ <Password>password</Password>
+ <KeyPassword>password</KeyPassword>
+ </KeyStore>
+ </parameter>
+ <parameter name="truststore" locked="false">
+ <TrustStore>
+ <Location>trust.jks</Location>
+ <Type>JKS</Type>
+ <Password>password</Password>
+ </TrustStore>
+ </parameter>-->
+ <!--<parameter name="SSLVerifyClient">require</parameter>
+ supports optional|require or defaults to none -->
+ <!--</transportReceiver>-->
+
+ <!-- ================================================= -->
<!-- Mail Transport Listener -->
<!-- This is a sample configuration. It assumes a mail server running in localhost.
Listener pops messages that comes to the email address red@localhost. Users
@@ -235,6 +267,36 @@
<!--class="org.apache.axis2.transport.jms.JMSSender"/>-->
<!-- ================================================= -->
+ <!-- Non-blocking http/s Transport Sender -->
+
+ <!-- the non-blocking http transport sender based on HttpCore + NIO extensions
+ <transportSender name="http" class="org.apache.axis2.transport.nhttp.HttpCoreNIOSender">
+ <parameter name="non-blocking" locked="false">true</parameter>
+ </transportSender>-->
+
+ <!-- the non-blocking https transport sender based on HttpCore + NIO SSL extensions
+ <transportSender name="https" class="org.apache.axis2.transport.nhttp.HttpCoreNIOSSLSender">
+ <parameter name="non-blocking" locked="false">true</parameter>
+ <parameter name="keystore" locked="false">
+ <KeyStore>
+ <Location>identity.jks</Location>
+ <Type>JKS</Type>
+ <Password>password</Password>
+ <KeyPassword>password</KeyPassword>
+ </KeyStore>
+ </parameter>
+ <parameter name="truststore" locked="false">
+ <TrustStore>
+ <Location>trust.jks</Location>
+ <Type>JKS</Type>
+ <Password>password</Password>
+ </TrustStore>
+ </parameter>-->
+ <!--<parameter name="HostnameVerifier">DefaultAndLocalhost</parameter>
+ supports Strict|AllowAll|DefaultAndLocalhost or the default if none specified -->
+ <!--</transportSender>-->
+
+ <!-- ================================================= -->
<!-- Mail Transport Sender -->
<!--Only need to uncomment the sender. Configuration is achieved with every client.
At any instant mail host should be given. Sample configuration has been given.
@@ -280,11 +342,11 @@
<!-- System predefined phases -->
<phase name="Transport">
<handler name="RequestURIBasedDispatcher"
- class="org.apache.axis2.engine.RequestURIBasedDispatcher">
+ class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher">
<order phase="Transport"/>
</handler>
<handler name="SOAPActionBasedDispatcher"
- class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
+ class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher">
<order phase="Transport"/>
</handler>
</phase>
@@ -292,21 +354,21 @@
<phase name="PreDispatch"/>
<phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
<handler name="RequestURIBasedDispatcher"
- class="org.apache.axis2.engine.RequestURIBasedDispatcher"/>
+ class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher"/>
<handler name="SOAPActionBasedDispatcher"
- class="org.apache.axis2.engine.SOAPActionBasedDispatcher"/>
+ class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher"/>
<handler name="AddressingBasedDispatcher"
- class="org.apache.axis2.engine.AddressingBasedDispatcher"/>
+ class="org.apache.axis2.dispatchers.AddressingBasedDispatcher"/>
<handler name="RequestURIOperationDispatcher"
- class="org.apache.axis2.engine.RequestURIOperationDispatcher"/>
+ class="org.apache.axis2.dispatchers.RequestURIOperationDispatcher"/>
<handler name="SOAPMessageBodyBasedDispatcher"
- class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher"/>
+ class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher"/>
<handler name="HTTPLocationBasedDispatcher"
- class="org.apache.axis2.engine.HTTPLocationBasedDispatcher"/>
+ class="org.apache.axis2.dispatchers.HTTPLocationBasedDispatcher"/>
</phase>
<phase name="RMPhase"/>
<!-- System predefined phases -->
@@ -329,21 +391,21 @@
<phase name="PreDispatch"/>
<phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
<handler name="RequestURIBasedDispatcher"
- class="org.apache.axis2.engine.RequestURIBasedDispatcher"/>
+ class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher"/>
<handler name="SOAPActionBasedDispatcher"
- class="org.apache.axis2.engine.SOAPActionBasedDispatcher"/>
+ class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher"/>
<handler name="AddressingBasedDispatcher"
- class="org.apache.axis2.engine.AddressingBasedDispatcher"/>
+ class="org.apache.axis2.dispatchers.AddressingBasedDispatcher"/>
<handler name="RequestURIOperationDispatcher"
- class="org.apache.axis2.engine.RequestURIOperationDispatcher"/>
+ class="org.apache.axis2.dispatchers.RequestURIOperationDispatcher"/>
<handler name="SOAPMessageBodyBasedDispatcher"
- class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher"/>
+ class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher"/>
<handler name="HTTPLocationBasedDispatcher"
- class="org.apache.axis2.engine.HTTPLocationBasedDispatcher"/>
+ class="org.apache.axis2.dispatchers.HTTPLocationBasedDispatcher"/>
</phase>
<phase name="RMPhase"/>
<!-- user can add his own phases to this area -->
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/maven.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/maven.xml?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/maven.xml (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/maven.xml Wed Jun 27 09:45:37 2007
@@ -20,6 +20,12 @@
<ant:ant antfile="j2secbuild.xml" inheritall="true" inheritrefs="true" dir="test-resources/"/>
</j:jelly>
<ant:copy file="${basedir}/test-resources/deployment/axis2.xml" tofile="${basedir}/target/test-resources/deployment/axis2.xml"/>
+ <ant:path
+ id="ModuleLoadingTest.resource"
+ location="${basedir}/test-resources/deployment/ClasspathModule"/>
+ <maven:addPath
+ id="maven.dependency.classpath"
+ refid="ModuleLoadingTest.resource"/>
</j:if>
</postGoal>
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/pom.xml?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/pom.xml (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/pom.xml Wed Jun 27 09:45:37 2007
@@ -43,6 +43,10 @@
<groupId>org.apache.httpcomponents</groupId>
<artifactId>jakarta-httpcore</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>jakarta-httpcore-nio</artifactId>
+ </dependency>
<dependency>
<groupId>wsdl4j</groupId>
<artifactId>wsdl4j</artifactId>
@@ -51,6 +55,11 @@
<groupId>backport-util-concurrent</groupId>
<artifactId>backport-util-concurrent</artifactId>
</dependency>
+ <dependency>
+ <groupId>stax</groupId>
+ <artifactId>stax-api</artifactId>
+ <version>${stax.api.version}</version>
+ </dependency>
<dependency>
<groupId>${stax.impl.groupid}</groupId>
<artifactId>${stax.impl.artifactid}</artifactId>
@@ -92,6 +101,53 @@
<artifactId>commons-logging</artifactId>
</dependency>
</dependencies>
+ <profiles>
+ <profile>
+ <id>java14</id>
+ <activation>
+ <jdk>1.4</jdk>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <inherited>true</inherited>
+ <configuration>
+ <excludes>
+ <exclude>**/*NIOSSL*.java</exclude>
+ <exclude>**/SSLServerIOEventDispatch.java</exclude>
+ <exclude>**/SSLClientIOEventDispatch.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>java15</id>
+ <activation>
+ <jdk>1.5</jdk>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>jakarta-httpcore-niossl</artifactId>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <id>java16</id>
+ <activation>
+ <jdk>1.6</jdk>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>jakarta-httpcore-niossl</artifactId>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
<build>
<sourceDirectory>src</sourceDirectory>
<testSourceDirectory>test</testSourceDirectory>
@@ -118,7 +174,13 @@
<include>**/**</include>
</includes>
</testResource>
- </testResources>
+ <testResource>
+ <directory>test-resources/deployment/ClasspathModule</directory>
+ <includes>
+ <include>**/**</include>
+ </includes>
+ </testResource>
+ </testResources>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/project.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/project.xml?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/project.xml (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/project.xml Wed Jun 27 09:45:37 2007
@@ -23,10 +23,11 @@
<name>Apache Axis 2.0 - Kernel</name>
<id>axis2-kernel</id>
<groupId>org.apache.axis2</groupId>
- <description>Core Parts of Axis 2.0. This includes Axis 2.0 engine, Client API, Addressing support, etc.,</description>
+ <description>Core Parts of Axis 2.0. This includes Axis 2.0 engine, Client API, Addressing support, etc.,
+ </description>
<dependencies>
- <dependency>
+ <dependency>
<groupId>org.apache.ws.commons.axiom</groupId>
<artifactId>axiom-api</artifactId>
<version>${axiom.version}</version>
@@ -38,7 +39,7 @@
</dependency>
<!-- external JARs -->
-
+
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
@@ -63,14 +64,14 @@
<module>true</module>
</properties>
</dependency>
- <dependency>
- <groupId>servletapi</groupId>
- <artifactId>servletapi</artifactId>
- <version>${servletapi.version}</version>
- <properties>
- <module>true</module>
- </properties>
- </dependency>
+ <dependency>
+ <groupId>servletapi</groupId>
+ <artifactId>servletapi</artifactId>
+ <version>${servletapi.version}</version>
+ <properties>
+ <module>true</module>
+ </properties>
+ </dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
@@ -87,14 +88,14 @@
<module>true</module>
</properties>
</dependency>
- <dependency>
- <groupId>commons-fileupload</groupId>
- <artifactId>commons-fileupload</artifactId>
- <version>${commons.fileupload.version}</version>
- <properties>
- <module>true</module>
- </properties>
- </dependency>
+ <dependency>
+ <groupId>commons-fileupload</groupId>
+ <artifactId>commons-fileupload</artifactId>
+ <version>${commons.fileupload.version}</version>
+ <properties>
+ <module>true</module>
+ </properties>
+ </dependency>
<dependency>
<groupId>httpcomponents-httpcore</groupId>
<artifactId>jakarta-httpcore</artifactId>
@@ -102,9 +103,17 @@
<properties>
<module>true</module>
</properties>
- </dependency>
+ </dependency>
+ <dependency>
+ <groupId>httpcomponents-httpcore</groupId>
+ <artifactId>jakarta-httpcore-nio</artifactId>
+ <version>${jakarta.httpcore.nio.version}</version>
+ <properties>
+ <module>true</module>
+ </properties>
+ </dependency>
<!--added this to support to keep WSDL information in AxisService-->
- <dependency>
+ <dependency>
<groupId>org.apache.ws.commons.schema</groupId>
<artifactId>XmlSchema</artifactId>
<version>${XmlSchema.version}</version>
@@ -149,20 +158,20 @@
<module>true</module>
</properties>
</dependency>
-
- <dependency>
- <groupId>jaxen</groupId>
- <artifactId>jaxen</artifactId>
- <version>${jaxen.version}</version>
- <properties>
- <module>true</module>
- </properties>
- <url>http://www.ibiblio.org/maven/jaxen/jars/</url>
- </dependency>
-
- <!--for java2wsdl generation we use JAM , so there should be a dependency on the annogen jar or-->
+
+ <dependency>
+ <groupId>jaxen</groupId>
+ <artifactId>jaxen</artifactId>
+ <version>${jaxen.version}</version>
+ <properties>
+ <module>true</module>
+ </properties>
+ <url>http://www.ibiblio.org/maven/jaxen/jars/</url>
+ </dependency>
+
+ <!--for java2wsdl generation we use JAM , so there should be a dependency on the annogen jar or-->
<!--XML Beans-->
- <dependency>
+ <dependency>
<groupId>annogen</groupId>
<artifactId>annogen</artifactId>
<version>${annogen.version}</version>
@@ -187,39 +196,55 @@
<module>true</module>
</properties>
</dependency>
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>jakarta-httpcore-niossl</artifactId>
+ <version>4.0-alpha4</version>
+ </dependency>
</dependencies>
<build>
- <resources>
- <resource>
- <directory>conf</directory>
- <excludes>
- <exclude>**/*.properties</exclude>
- </excludes>
- </resource>
- <resource>
- <directory>src</directory>
- <includes>
- <include>**/*.properties</include>
- <include>**/*.xml</include>
- <include>**/*.xsl</include>
- </includes>
- </resource>
- <resource>
- <directory>../../</directory>
- <targetPath>META-INF</targetPath>
- <includes>
- <include>NOTICE.txt</include>
- <include>LICENSE.txt</include>
- </includes>
- </resource>
- </resources>
- <unitTest>
- <resources>
- <resource>
- <targetPath>../test-resources</targetPath>
- <directory>test-resources</directory>
- </resource>
- </resources>
- </unitTest>
+ <sourceModifications>
+ <sourceModification>
+ <className>Ignore.NIO.SSL</className>
+ <excludes>
+ <exclude>**/*NIOSSL*.java</exclude>
+ <exclude>**/SSLServerIOEventDispatch.java</exclude>
+ <exclude>**/SSLClientIOEventDispatch.java</exclude>
+ </excludes>
+ </sourceModification>
+ </sourceModifications>
+
+ <resources>
+ <resource>
+ <directory>conf</directory>
+ <excludes>
+ <exclude>**/*.properties</exclude>
+ </excludes>
+ </resource>
+ <resource>
+ <directory>src</directory>
+ <includes>
+ <include>**/*.properties</include>
+ <include>**/*.xml</include>
+ <include>**/*.xsl</include>
+ </includes>
+ </resource>
+ <resource>
+ <directory>../../</directory>
+ <targetPath>META-INF</targetPath>
+ <includes>
+ <include>NOTICE.txt</include>
+ <include>LICENSE.txt</include>
+ </includes>
+ </resource>
+ </resources>
+ <unitTest>
+ <resources>
+ <resource>
+ <targetPath>../test-resources</targetPath>
+ <directory>test-resources</directory>
+ </resource>
+ </resources>
+ </unitTest>
</build>
</project>
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/client/ServiceClient.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/client/ServiceClient.java?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/client/ServiceClient.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/client/ServiceClient.java Wed Jun 27 09:45:37 2007
@@ -44,6 +44,8 @@
import org.apache.axis2.engine.ListenerManager;
import org.apache.axis2.i18n.Messages;
import org.apache.axis2.wsdl.WSDLConstants;
+import org.apache.commons.logging.LogFactory;
+import org.apache.commons.logging.Log;
import javax.wsdl.Definition;
@@ -58,7 +60,8 @@
* configure various aspects of the service access.
*/
public class ServiceClient {
-
+ protected static final Log log = LogFactory.getLog(ServiceClient.class);
+
/**
* Base name used for a service created without an existing configuration.
*/
@@ -345,7 +348,11 @@
public void disengageModule(String moduleName) {
AxisModule module = axisConfig.getModule(moduleName);
if (module != null) {
- axisService.disengageModule(module);
+ try {
+ axisService.disengageModule(module);
+ } catch (AxisFault axisFault) {
+ log.error(axisFault);
+ }
}
}
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/clustering/ClusterManager.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/clustering/ClusterManager.java?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/clustering/ClusterManager.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/clustering/ClusterManager.java Wed Jun 27 09:45:37 2007
@@ -67,10 +67,4 @@
*/
void setConfigurationContext(ConfigurationContext configurationContext);
- /**
- * Get the total number of members in the cluster
- *
- * @return The total number of members in the cluster
- */
- int getMemberCount();
}
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/clustering/ClusteringConstants.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/clustering/ClusteringConstants.java?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/clustering/ClusteringConstants.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/clustering/ClusteringConstants.java Wed Jun 27 09:45:37 2007
@@ -25,4 +25,5 @@
public static final String AVOID_INITIATION_KEY = "AvoidInitiation";
public static final String DOMAIN = "domain";
public static final String CLUSTER_INITIALIZED = "local_cluster.initialized";
+ public static final String TIME_TO_SEND = "local_cluster.time.to.send";
}
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/clustering/MessageSender.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/clustering/MessageSender.java?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/clustering/MessageSender.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/clustering/MessageSender.java Wed Jun 27 09:45:37 2007
@@ -20,9 +20,9 @@
*/
public interface MessageSender {
- public void sendToGroup(ClusteringCommand msg) throws ClusteringFault;
+ public long sendToGroup(ClusteringCommand msg) throws ClusteringFault;
public void sendToSelf(ClusteringCommand msg) throws ClusteringFault;
- public void sendToGroup(Throwable throwable) throws ClusteringFault;
+ public long sendToGroup(Throwable throwable) throws ClusteringFault;
}
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/clustering/context/ContextManager.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/clustering/context/ContextManager.java?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/clustering/context/ContextManager.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/clustering/context/ContextManager.java Wed Jun 27 09:45:37 2007
@@ -49,6 +49,15 @@
String updateContexts(AbstractContext[] contexts) throws ClusteringFault;
/**
+ * This method is called when a new {@link AbstractContext} is removed from the system
+ *
+ * @param context
+ * @return The UUID of the message that was sent to the group communications framework
+ * @throws ClusteringFault
+ */
+ String removeContext(AbstractContext context) throws ClusteringFault;
+
+ /**
* @param context
* @return True - if the provided {@link AbstractContext} is clusterable
*/
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/clustering/context/Replicator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/clustering/context/Replicator.java?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/clustering/context/Replicator.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/clustering/context/Replicator.java Wed Jun 27 09:45:37 2007
@@ -18,6 +18,7 @@
import org.apache.axis2.clustering.ClusterManager;
import org.apache.axis2.clustering.ClusteringFault;
+import org.apache.axis2.clustering.ClusteringConstants;
import org.apache.axis2.context.AbstractContext;
import org.apache.axis2.context.ConfigurationContext;
import org.apache.axis2.context.MessageContext;
@@ -43,6 +44,7 @@
replicateState(msgContext);
} catch (Exception e) {
String message = "Could not replicate the state";
+ log.error(message, e);
throw new ClusteringFault(message, e);
}
}
@@ -56,6 +58,7 @@
replicateState(abstractContext);
} catch (Exception e) {
String message = "Could not replicate the state";
+ log.error(message, e);
throw new ClusteringFault(message, e);
}
}
@@ -72,8 +75,7 @@
ClusterManager clusterManager =
abstractContext.getRootContext().getAxisConfiguration().getClusterManager();
return clusterManager != null &&
- clusterManager.getContextManager() != null &&
- clusterManager.getMemberCount() != 0;
+ clusterManager.getContextManager() != null;
}
private static void replicateState(AbstractContext abstractContext) throws ClusteringFault {
@@ -88,7 +90,7 @@
}
if (!abstractContext.getPropertyDifferences().isEmpty()) {
String msgUUID = contextManager.updateContext(abstractContext);
- waitForACKs(contextManager, msgUUID);
+ waitForACKs(contextManager, msgUUID, abstractContext.getRootContext());
}
} else {
String msg = "Cannot replicate contexts since " +
@@ -132,10 +134,10 @@
// Do the actual replication here
if (!contexts.isEmpty()) {
- String msgUUID =
- contextManager.updateContexts((AbstractContext[]) contexts.
- toArray(new AbstractContext[contexts.size()]));
- waitForACKs(contextManager, msgUUID);
+ AbstractContext[] contextArray =
+ (AbstractContext[]) contexts.toArray(new AbstractContext[contexts.size()]);
+ String msgUUID = contextManager.updateContexts(contextArray);
+ waitForACKs(contextManager, msgUUID, msgContext.getRootContext());
}
} else {
@@ -146,7 +148,8 @@
}
private static void waitForACKs(ContextManager contextManager,
- String msgUUID) throws ClusteringFault {
+ String msgUUID,
+ ConfigurationContext configCtx) throws ClusteringFault {
long start = System.currentTimeMillis();
// Wait till all members have ACKed receipt & successful processing of
@@ -155,11 +158,17 @@
// Wait sometime before checking whether message is ACKed
try {
- Thread.sleep(50);
+ Long tts =
+ (Long) configCtx.getPropertyNonReplicable(ClusteringConstants.TIME_TO_SEND);
+ if (tts == null) {
+ Thread.sleep(5);
+ } else if (tts.longValue() >= 0) {
+ Thread.sleep(tts.longValue() + 5); // Time to recv ACK + time in queue & processing replication request
+ }
} catch (InterruptedException ignored) {
}
- if (System.currentTimeMillis() - start > 40000) {
- throw new ClusteringFault("ACKs not received from all members within 40 sec. " +
+ if (System.currentTimeMillis() - start > 15000) {
+ throw new ClusteringFault("ACKs not received from all members within 15 sec. " +
"Aborting wait.");
}
} while (!contextManager.isMessageAcknowledged(msgUUID));
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/AbstractContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/AbstractContext.java?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/AbstractContext.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/AbstractContext.java Wed Jun 27 09:45:37 2007
@@ -21,7 +21,6 @@
import org.apache.axis2.clustering.ClusterManager;
import org.apache.axis2.clustering.context.Replicator;
-import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
@@ -129,13 +128,12 @@
addPropertyDifference(key);
}
- private void addPropertyDifference(String key) {
+ private synchronized void addPropertyDifference(String key) {
// Add the property differences only if Context replication is enabled,
// and there are members in the cluster
ClusterManager clusterManager = getRootContext().getAxisConfiguration().getClusterManager();
if (clusterManager != null &&
- clusterManager.getContextManager() != null &&
- clusterManager.getMemberCount() != 0) {
+ clusterManager.getContextManager() != null) {
propertyDifferences.put(key, new PropertyDifference(key, false));
}
}
@@ -160,7 +158,7 @@
*
* @param key
*/
- public void removeProperty(String key) {
+ public synchronized void removeProperty(String key) {
if (properties != null) {
properties.remove(key);
}
@@ -174,7 +172,7 @@
*
* @param key
*/
- public void removePropertyNonReplicable(String key) {
+ public synchronized void removePropertyNonReplicable(String key) {
if (properties != null) {
properties.remove(key);
}
@@ -186,8 +184,8 @@
*
* @return The property differences
*/
- public Map getPropertyDifferences() {
- return Collections.unmodifiableMap(propertyDifferences);
+ public synchronized Map getPropertyDifferences() {
+ return propertyDifferences;
}
/**
@@ -195,7 +193,7 @@
* it should call this method to avoid retransmitting stuff that has already
* been sent.
*/
- public void clearPropertyDifferences() {
+ public synchronized void clearPropertyDifferences() {
propertyDifferences.clear();
}
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/ConfigurationContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/ConfigurationContext.java?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/ConfigurationContext.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/ConfigurationContext.java Wed Jun 27 09:45:37 2007
@@ -37,21 +37,26 @@
import java.io.File;
import java.net.URL;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
/**
- * <p>Axis2 states are held in two information models, called description hierarchy
- * and context hierarchy. Description hierarchy hold deployment configuration
- * and it's values does not change unless deployment configuration change occurs
- * where Context hierarchy hold run time information. Both hierarchies consists
- * four levels, Global, Service Group, Operation and Message. Please look at
+ * <p>Axis2 states are held in two information models, called description hierarchy
+ * and context hierarchy. Description hierarchy hold deployment configuration
+ * and it's values does not change unless deployment configuration change occurs
+ * where Context hierarchy hold run time information. Both hierarchies consists
+ * four levels, Global, Service Group, Operation and Message. Please look at
* "Information Model" section of "Axis2 Architecture Guide" for more information.</p>
- *
+ * <p/>
* <p>Configuration Context hold Global level run-time information. This allows
- * same configurations to be used by two Axis2 instances and most Axis2 wide
- * configurations can changed by setting name value pairs of the configurationContext.
- * This hold all OperationContexts, ServiceGroups, Sessions, and ListenerManager.</p>
-
+ * same configurations to be used by two Axis2 instances and most Axis2 wide
+ * configurations can changed by setting name value pairs of the configurationContext.
+ * This hold all OperationContexts, ServiceGroups, Sessions, and ListenerManager.
*/
public class ConfigurationContext extends AbstractContext {
@@ -75,6 +80,7 @@
private String servicePath;
private String cachedServicePath = null;
+ protected List contextListeners;
public ConfigurationContext(AxisConfiguration axisConfiguration) {
super(null);
@@ -116,6 +122,61 @@
return !(param != null && JavaUtils.isTrueExplicitly(param.getValue()));
}
+ /**
+ * Inform any listeners of a new context being created
+ *
+ * @param context the just-created subcontext
+ */
+ void contextCreated(AbstractContext context) {
+ if (contextListeners == null) {
+ return;
+ }
+ for (Iterator iter = contextListeners.iterator(); iter.hasNext();) {
+ ContextListener listener = (ContextListener) iter.next();
+ listener.contextCreated(context);
+ }
+ }
+
+ /**
+ * Inform any listeners of a context being removed
+ *
+ * @param context the just-created subcontext
+ */
+ void contextRemoved(AbstractContext context) {
+ if (contextListeners == null) {
+ return;
+ }
+ for (Iterator iter = contextListeners.iterator(); iter.hasNext();) {
+ ContextListener listener = (ContextListener) iter.next();
+ listener.contextRemoved(context);
+ }
+ }
+
+ /**
+ * Register a {@link ContextListener} to be notified of all sub-context events.
+ *
+ * @param contextListener A ContextListener
+ * @see #removeContextListener
+ */
+ public void addContextListener(ContextListener contextListener) {
+ if (contextListeners == null) {
+ contextListeners = new ArrayList();
+ }
+ contextListeners.add(contextListener);
+ }
+
+ /**
+ * Remove an already registered {@link ContextListener}
+ *
+ * @param contextListener A ContextListener
+ * @see #addContextListener
+ */
+ public void removeContextListener(ContextListener contextListener) {
+ if (contextListeners != null) {
+ contextListeners.remove(contextListener);
+ }
+ }
+
protected void finalize() throws Throwable {
super.finalize();
}
@@ -211,7 +272,7 @@
* If the given message id already has a registered operation context,
* no change is made and the methid resturns false.
*
- * @param messageID the message-id to register
+ * @param messageID the message-id to register
* @param mepContext the OperationContext for the specified message-id
* @return true if we added a new context, false if the messageID was already there and we did
* nothing
@@ -220,7 +281,7 @@
OperationContext mepContext) {
mepContext.setKey(messageID); // TODO: Doing this here seems dangerous....
synchronized (operationContextMap) {
- if (!operationContextMap.containsKey(messageID)) {
+ if (!operationContextMap.containsKey(messageID)) {
this.operationContextMap.put(messageID, mepContext);
return true;
}
@@ -235,11 +296,14 @@
*/
public void unregisterOperationContext(String key) {
synchronized (operationContextMap) {
+ OperationContext opCtx = (OperationContext)operationContextMap.get(key);
operationContextMap.remove(key);
+ contextRemoved(opCtx);
}
}
- public void addServiceGroupContextIntoSoapSessionTable(ServiceGroupContext serviceGroupContext) {
+ public void addServiceGroupContextIntoSoapSessionTable(
+ ServiceGroupContext serviceGroupContext) {
String id = serviceGroupContext.getId();
serviceGroupContextMap.put(id, serviceGroupContext);
serviceGroupContext.touch();
@@ -248,7 +312,8 @@
cleanupServiceGroupContexts();
}
- public void addServiceGroupContextIntoApplicationScopeTable(ServiceGroupContext serviceGroupContext) {
+ public void addServiceGroupContextIntoApplicationScopeTable
+ (ServiceGroupContext serviceGroupContext) {
if (applicationSessionServiceGroupContexts == null) {
applicationSessionServiceGroupContexts = new Hashtable();
}
@@ -256,6 +321,20 @@
serviceGroupContext.getDescription().getServiceGroupName(), serviceGroupContext);
}
+ /**
+ * Deploy a service to the embedded AxisConfiguration, and initialize it.
+ *
+ * @param service service to deploy
+ * @throws AxisFault if there's a problem
+ */
+ public void deployService(AxisService service) throws AxisFault {
+ axisConfiguration.addService(service);
+ if (Constants.SCOPE_APPLICATION.equals(service.getScope())) {
+ ServiceGroupContext sgc = createServiceGroupContext(service.getAxisServiceGroup());
+ DependencyManager.initService(sgc);
+ }
+ }
+
public AxisConfiguration getAxisConfiguration() {
return axisConfiguration;
}
@@ -337,7 +416,9 @@
* @return a new MessageContext
*/
public MessageContext createMessageContext() {
- return new MessageContext(this);
+ MessageContext msgCtx = new MessageContext(this);
+ contextCreated(msgCtx);
+ return msgCtx;
}
/**
@@ -348,7 +429,9 @@
* @return a new ServiceGroupContext
*/
public ServiceGroupContext createServiceGroupContext(AxisServiceGroup serviceGroup) {
- return new ServiceGroupContext(this, serviceGroup);
+ ServiceGroupContext sgCtx = new ServiceGroupContext(this, serviceGroup);
+ contextCreated(sgCtx);
+ return sgCtx;
}
/**
@@ -419,24 +502,24 @@
public String[] getServiceGroupContextIDs() {
String[] ids = new String[serviceGroupContextMap.size() +
applicationSessionServiceGroupContexts.size()];
- int index =0;
+ int index = 0;
for (Iterator iter = serviceGroupContextMap.keySet().iterator(); iter.hasNext();) {
- ids[index] = (String)iter.next();
+ ids[index] = (String) iter.next();
index ++;
}
for (Iterator iter = applicationSessionServiceGroupContexts.keySet().iterator();
iter.hasNext();) {
- ids[index] = (String)iter.next();
+ ids[index] = (String) iter.next();
index ++;
}
return ids;
}
/**
- * @deprecated Use {@link #getServiceGroupContextIDs} & {@link #getServiceGroupContext(String)}
* @return The ServiceGroupContexts
+ * @deprecated Use {@link #getServiceGroupContextIDs} & {@link #getServiceGroupContext(String)}
*/
- public Hashtable getServiceGroupContexts(){
+ public Hashtable getServiceGroupContexts() {
return serviceGroupContextMap;
}
@@ -478,8 +561,8 @@
return;
}
long currentTime = new Date().getTime();
- Iterator sgCtxtMapKeyIter = serviceGroupContextMap.keySet().iterator();
- while (sgCtxtMapKeyIter.hasNext()) {
+ for (Iterator sgCtxtMapKeyIter = serviceGroupContextMap.keySet().iterator();
+ sgCtxtMapKeyIter.hasNext();) {
String sgCtxtId = (String) sgCtxtMapKeyIter.next();
ServiceGroupContext serviceGroupContext =
(ServiceGroupContext) serviceGroupContextMap.get(sgCtxtId);
@@ -487,6 +570,7 @@
getServiceGroupContextTimoutInterval()) {
sgCtxtMapKeyIter.remove();
cleanupServiceContexts(serviceGroupContext);
+ contextRemoved(serviceGroupContext);
}
}
}
@@ -503,12 +587,12 @@
if (serviceGroupContext == null) {
return;
}
- Iterator serviceContecxtes = serviceGroupContext.getServiceContexts();
- if (serviceContecxtes == null) {
+ Iterator serviceContextIter = serviceGroupContext.getServiceContexts();
+ if (serviceContextIter == null) {
return;
}
- while (serviceContecxtes.hasNext()) {
- ServiceContext serviceContext = (ServiceContext) serviceContecxtes.next();
+ while (serviceContextIter.hasNext()) {
+ ServiceContext serviceContext = (ServiceContext) serviceContextIter.next();
DependencyManager.destroyServiceObject(serviceContext);
}
}
@@ -516,9 +600,9 @@
public void cleanupContexts() {
if ((applicationSessionServiceGroupContexts != null) &&
(applicationSessionServiceGroupContexts.size() > 0)) {
- Iterator applicationScopeSgs =
+ for (Iterator applicationScopeSgs =
applicationSessionServiceGroupContexts.values().iterator();
- while (applicationScopeSgs.hasNext()) {
+ applicationScopeSgs.hasNext();) {
ServiceGroupContext serviceGroupContext =
(ServiceGroupContext) applicationScopeSgs.next();
cleanupServiceContexts(serviceGroupContext);
@@ -526,10 +610,10 @@
applicationSessionServiceGroupContexts.clear();
}
if ((serviceGroupContextMap != null) && (serviceGroupContextMap.size() > 0)) {
- Iterator sopaSessionSgs = serviceGroupContextMap.values().iterator();
- while (sopaSessionSgs.hasNext()) {
+ for (Iterator soapSessionSgs = serviceGroupContextMap.values().iterator();
+ soapSessionSgs.hasNext();) {
ServiceGroupContext serviceGroupContext =
- (ServiceGroupContext) sopaSessionSgs.next();
+ (ServiceGroupContext) soapSessionSgs.next();
cleanupServiceContexts(serviceGroupContext);
}
serviceGroupContextMap.clear();
@@ -540,6 +624,7 @@
if (listenerManager != null) {
listenerManager.stop();
}
+ axisConfiguration.cleanup();
cleanupTemp();
}
@@ -548,10 +633,10 @@
* release to 1.3 release. This will include API changes , class
* deprecating etc etc.
*/
- private void cleanupTemp(){
- File tempFile = (File)axisConfiguration.getParameterValue(
+ private void cleanupTemp() {
+ File tempFile = (File) axisConfiguration.getParameterValue(
Constants.Configuration.ARTIFACTS_TEMP_DIR);
- if(tempFile==null){
+ if (tempFile == null) {
tempFile = new File(System.getProperty("java.io.tmpdir"), "_axis2");
}
deleteTempFiles(tempFile);
@@ -560,7 +645,7 @@
private void deleteTempFiles(File dir) {
if (dir.isDirectory()) {
String[] children = dir.list();
- for (int i=0; i<children.length; i++) {
+ for (int i = 0; i < children.length; i++) {
deleteTempFiles(new File(dir, children[i]));
}
}
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/ConfigurationContextFactory.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/ConfigurationContextFactory.java?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/ConfigurationContextFactory.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/ConfigurationContextFactory.java Wed Jun 27 09:45:37 2007
@@ -73,7 +73,7 @@
axisConfigurator.engageGlobalModules();
axisConfigurator.loadServices();
addModuleService(configContext);
- initApplicationScopeServices(configContext);
+// initApplicationScopeServices(configContext);
axisConfig.setStart(true);
return configContext;
}
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/MessageContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/MessageContext.java?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/MessageContext.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/MessageContext.java Wed Jun 27 09:45:37 2007
@@ -696,7 +696,7 @@
* </ol>
* <p/> and the way of specifying module configuration is as follows
* <moduleConfig name="addressing"> <parameter name="addressingPara"
- * locked="false">N/A</parameter> </moduleConfig>
+ * >N/A</parameter> </moduleConfig>
*
* @param key :
* Parameter Name
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/ServiceContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/ServiceContext.java?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/ServiceContext.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/ServiceContext.java Wed Jun 27 09:45:37 2007
@@ -157,6 +157,7 @@
public OperationContext createOperationContext(AxisOperation axisOp) {
OperationContext ctx = new OperationContext(axisOp, this);
+ configContext.contextCreated(ctx);
return ctx;
}
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/ServiceGroupContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/ServiceGroupContext.java?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/ServiceGroupContext.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/ServiceGroupContext.java Wed Jun 27 09:45:37 2007
@@ -142,6 +142,7 @@
ServiceContext serviceContext = (ServiceContext) serviceContextMap.get(service.getName());
if (serviceContext == null) {
serviceContext = new ServiceContext(service, this);
+ getRootContext().contextCreated(serviceContext);
serviceContextMap.put(service.getName(), serviceContext);
}
return serviceContext;
@@ -161,7 +162,6 @@
this.id = id;
}
-
/**
* Adds the specified service context object to the
* lists of service contexts for this service group
@@ -204,7 +204,6 @@
return null;
}
- // a map allows a null key
return (ServiceContext) serviceContextMap.get(name);
}
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/Deployer.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/Deployer.java?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/Deployer.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/Deployer.java Wed Jun 27 09:45:37 2007
@@ -23,7 +23,7 @@
/**
* This interface is used to provide the custom deployment mechanism , where you
- * can write your owm Deployer to process a particular type and make that to
+ * can write your own Deployer to process a particular type and make that to
* a service or a module.
*/
public interface Deployer {
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java Wed Jun 27 09:45:37 2007
@@ -53,6 +53,7 @@
//to keep the web resource location if any
protected static String webLocationString = null;
+ protected Scheduler scheduler;
public static void setWebLocationString(String webLocationString) {
DeploymentEngine.webLocationString = webLocationString;
@@ -450,7 +451,7 @@
ArrayList serviceList,
URL serviceLocation,
AxisConfiguration axisConfig) throws AxisFault {
- serviceGroup.setParent(axisConfig);
+// serviceGroup.setParent(axisConfig);
// module from services.xml at serviceGroup level
ArrayList groupModules = serviceGroup.getModuleRefs();
@@ -598,7 +599,7 @@
* @param listener : RepositoryListener
*/
protected void startSearch(RepositoryListener listener) {
- Scheduler scheduler = new Scheduler();
+ scheduler = new Scheduler();
scheduler.schedule(new SchedulerTask(listener), new DeploymentIterator());
}
@@ -1070,5 +1071,14 @@
public Deployer getDeployerForExtension(String extension) {
return (Deployer)extensionToDeployerMappingMap.get(extension);
+ }
+
+ /**
+ * Clean up the mess
+ */
+ public void cleanup() {
+ if(scheduler != null){
+ scheduler.cleanup();
+ }
}
}
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/FileSystemConfigurator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/FileSystemConfigurator.java?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/FileSystemConfigurator.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/FileSystemConfigurator.java Wed Jun 27 09:45:37 2007
@@ -13,6 +13,7 @@
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
+import java.io.IOException;
/*
* Copyright 2004,2005 The Apache Software Foundation.
@@ -103,7 +104,7 @@
* @throws AxisFault
*/
public synchronized AxisConfiguration getAxisConfiguration() throws AxisFault {
- InputStream configStream;
+ InputStream configStream = null;
try {
if (axis2xml != null && !"".equals(axis2xml)) {
configStream = new FileInputStream(axis2xml);
@@ -114,6 +115,14 @@
axisConfig = populateAxisConfiguration(configStream);
} catch (FileNotFoundException e) {
throw new AxisFault("System can not find the given axis2.xml " + axis2xml);
+ } finally {
+ if(configStream != null) {
+ try {
+ configStream.close();
+ } catch (IOException e) {
+ throw AxisFault.makeFault(e);
+ }
+ }
}
Parameter axis2repoPara = axisConfig.getParameter(DeploymentConstants.AXIS2_REPO);
if (axis2repoPara != null) {
@@ -124,6 +133,7 @@
} else {
loadFromClassPath();
}
+ axisConfig.setConfigurator(this);
return axisConfig;
}
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/ModuleBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/ModuleBuilder.java?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/ModuleBuilder.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/ModuleBuilder.java Wed Jun 27 09:45:37 2007
@@ -94,7 +94,17 @@
}
}
-// process service description
+ // Get our name and version. If this is NOT present, we'll try to figure it out
+ // from the file name (e.g. "addressing-1.0.mar"). If the attribute is there, we
+ // always respect it.
+ OMAttribute nameAtt = moduleElement.getAttribute(new QName("name"));
+ if (nameAtt != null) {
+ String moduleName = nameAtt.getAttributeValue();
+ if (moduleName != null && !"".equals(moduleName))
+ module.setName(moduleName);
+ }
+
+ // Process service description
OMElement descriptionElement =
moduleElement.getFirstChildWithName(new QName(TAG_DESCRIPTION));
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/RepositoryListener.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/RepositoryListener.java?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/RepositoryListener.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/RepositoryListener.java Wed Jun 27 09:45:37 2007
@@ -19,6 +19,7 @@
import org.apache.axis2.deployment.repository.util.DeploymentFileData;
import org.apache.axis2.deployment.repository.util.WSInfoList;
+import org.apache.axis2.deployment.repository.util.WSInfo;
import org.apache.axis2.util.Loader;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -29,8 +30,10 @@
import java.net.URL;
import java.net.URLClassLoader;
import java.net.URLDecoder;
+import java.net.URI;
import java.util.HashMap;
import java.util.Iterator;
+import java.util.Enumeration;
public class RepositoryListener implements DeploymentConstants {
protected static final Log log = LogFactory.getLog(RepositoryListener.class);
@@ -77,11 +80,11 @@
}
if (!file.isDirectory()) {
if (DeploymentFileData.isModuleArchiveFile(file.getName())) {
- addFileToDeploy(file, deploymentEngine.getModuleDeployer());
+ addFileToDeploy(file, deploymentEngine.getModuleDeployer() , WSInfo.TYPE_MODULE);
}
} else {
if (!"lib".equalsIgnoreCase(file.getName())) {
- addFileToDeploy(file, deploymentEngine.getModuleDeployer());
+ addFileToDeploy(file, deploymentEngine.getModuleDeployer() ,WSInfo.TYPE_MODULE);
}
}
}
@@ -102,11 +105,9 @@
protected void loadClassPathModules() {
ModuleDeployer deployer = deploymentEngine.getModuleDeployer();
- /* WORKING (Glen)
// Find Modules on the class path (i.e. if classpath includes "addressing.mar" then
// addressing will be available for engaging)
- // TODO: Confirm correct class loader
ClassLoader loader = Thread.currentThread().getContextClassLoader();
try {
Enumeration moduleURLs = loader.getResources("META-INF/module.xml");
@@ -114,18 +115,14 @@
URL url = (URL)moduleURLs.nextElement();
String fileName = url.toString();
fileName = fileName.substring(0, fileName.lastIndexOf("/META-INF/module.xml"));
- System.out.println(fileName);
File f = new File(new URI(fileName));
- System.out.println(f.getAbsolutePath());
- addFileToDeploy(f, deployer);
+ addFileToDeploy(f, deployer ,WSInfo.TYPE_MODULE);
}
} catch (Exception e) {
// Oh well, log the problem
- log.error(e);
+ log.info(e);
}
- */
-
String classPath = getLocation();
if (classPath == null) return;
@@ -144,7 +141,7 @@
if (!file.isDirectory()) {
if (DeploymentFileData.isModuleArchiveFile(file.getName())) {
//adding modules in the class path
- addFileToDeploy(file, deployer);
+ addFileToDeploy(file, deployer,WSInfo.TYPE_MODULE);
}
}
}
@@ -169,7 +166,7 @@
if (file.isFile()) {
if (DeploymentFileData.isModuleArchiveFile(file.getName())) {
//adding modules in the class path
- addFileToDeploy(file, deployer);
+ addFileToDeploy(file, deployer,WSInfo.TYPE_MODULE);
}
}
}
@@ -251,7 +248,7 @@
if (!file.isDirectory() && extension.equals(
DeploymentFileData.getFileExtension(file.getName()))) {
addFileToDeploy(file,
- deploymentEngine.getDeployerForExtension(extension));
+ deploymentEngine.getDeployerForExtension(extension),WSInfo.TYPE_CUSTOM);
}
}
}
@@ -274,19 +271,19 @@
}
if (!file.isDirectory()) {
if (DeploymentFileData.isServiceArchiveFile(file.getName())) {
- addFileToDeploy(file, deploymentEngine.getServiceDeployer());
+ addFileToDeploy(file, deploymentEngine.getServiceDeployer(),WSInfo.TYPE_SERVICE);
} else {
String ext = DeploymentFileData.getFileExtension(file.getName());
Deployer deployer = deploymentEngine.getDeployerForExtension(ext);
// If we found a deployer for this type of file, use it. Otherwise
// ignore the file.
if (deployer != null) {
- addFileToDeploy(file, deployer);
+ addFileToDeploy(file, deployer,WSInfo.TYPE_SERVICE);
}
}
} else {
if (!"lib".equalsIgnoreCase(file.getName())) {
- addFileToDeploy(file, deploymentEngine.getServiceDeployer());
+ addFileToDeploy(file, deploymentEngine.getServiceDeployer(),WSInfo.TYPE_CUSTOM);
}
}
}
@@ -296,7 +293,7 @@
/** Method invoked from the scheduler to start the listener. */
public void startListener() {
checkServices();
- update();
+// update();
}
/** Updates WSInfoList object. */
@@ -309,7 +306,7 @@
update();
}
- public void addFileToDeploy(File file, Deployer deployer) {
- wsInfoList.addWSInfoItem(file, deployer);
+ public void addFileToDeploy(File file, Deployer deployer , int type) {
+ wsInfoList.addWSInfoItem(file, deployer ,type);
}
}
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java Wed Jun 27 09:45:37 2007
@@ -309,7 +309,7 @@
for (int i = 0; i < ops.size(); i++) {
AxisOperation operationDesc = (AxisOperation) ops.get(i);
- ArrayList wsamappings = operationDesc.getWsamappingList();
+ ArrayList wsamappings = operationDesc.getWSAMappingList();
if (wsamappings == null) {
continue;
}
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/ServiceDeployer.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/ServiceDeployer.java?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/ServiceDeployer.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/ServiceDeployer.java Wed Jun 27 09:45:37 2007
@@ -73,14 +73,13 @@
}
}
}
- AxisServiceGroup sericeGroup = new AxisServiceGroup(axisConfig);
- sericeGroup.setServiceGroupClassLoader(
- deploymentFileData.getClassLoader());
+ AxisServiceGroup serviceGroup = new AxisServiceGroup(axisConfig);
+ serviceGroup.setServiceGroupClassLoader(deploymentFileData.getClassLoader());
ArrayList serviceList = archiveReader.processServiceGroup(
deploymentFileData.getAbsolutePath(), deploymentFileData,
- sericeGroup, isDirectory, wsdlservice,
+ serviceGroup, isDirectory, wsdlservice,
configCtx);
- DeploymentEngine.addServiceGroup(sericeGroup,
+ DeploymentEngine.addServiceGroup(serviceGroup,
serviceList,
deploymentFileData.getFile().toURL(),
deploymentFileData,
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/URLBasedAxisConfigurator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/URLBasedAxisConfigurator.java?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/URLBasedAxisConfigurator.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/URLBasedAxisConfigurator.java Wed Jun 27 09:45:37 2007
@@ -75,6 +75,7 @@
} catch (IOException e) {
throw new AxisFault(e.getMessage());
}
+ axisConfig.setConfigurator(this);
return axisConfig;
}
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/WarBasedAxisConfigurator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/WarBasedAxisConfigurator.java?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/WarBasedAxisConfigurator.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/WarBasedAxisConfigurator.java Wed Jun 27 09:45:37 2007
@@ -144,6 +144,9 @@
}
axisConfig = populateAxisConfiguration(axis2Stream);
+ if(axis2Stream != null){
+ axis2Stream.close();
+ }
Parameter param = new Parameter();
param.setName(Constants.Configuration.ARTIFACTS_TEMP_DIR);
param.setValue(config.getServletContext().getAttribute("javax.servlet.context.tempdir"));
@@ -233,6 +236,7 @@
log.error(ex + ": loading repository from classpath");
loadFromClassPath();
}
+ axisConfig.setConfigurator(this);
return axisConfig;
}
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/axis2_default.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/axis2_default.xml?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/axis2_default.xml (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/axis2_default.xml Wed Jun 27 09:45:37 2007
@@ -2,23 +2,23 @@
<!-- ================================================= -->
<!-- Parameters -->
<!-- ================================================= -->
- <parameter name="hotdeployment" locked="false">true</parameter>
- <parameter name="hotupdate" locked="false">false</parameter>
- <parameter name="enableMTOM" locked="false">false</parameter>
+ <parameter name="hotdeployment">true</parameter>
+ <parameter name="hotupdate">false</parameter>
+ <parameter name="enableMTOM">false</parameter>
<!--During a fault, stacktrace can be sent with the fault message. The following flag will control -->
<!--that behaviour.-->
- <parameter name="sendStacktraceDetailsWithFaults" locked="false">true</parameter>
+ <parameter name="sendStacktraceDetailsWithFaults">true</parameter>
<!--If there aren't any information available to find out the fault reason, we set the message of the exception-->
<!--as the faultreason/Reason. But when a fault is thrown from a service or some where, it will be -->
<!--wrapped by different levels. Due to this the initial exception message can be lost. If this flag-->
<!--is set then, Axis2 tries to get the first exception and set its message as the faultreason/Reason.-->
- <parameter name="DrillDownToRootCauseForFaultReason" locked="false">false</parameter>
+ <parameter name="DrillDownToRootCauseForFaultReason">false</parameter>
<!--This is the user name and password of admin console-->
- <parameter name="userName" locked="false">admin</parameter>
- <parameter name="password" locked="false">axis2</parameter>
+ <parameter name="userName">admin</parameter>
+ <parameter name="password">axis2</parameter>
<!--To override repository/services you need to uncomment following parameter and value SHOULD be absolute file path.-->
<!--ServicesDirectory only works on the following cases-->
@@ -29,15 +29,15 @@
<!--All the other scenarios it will be ignored.-->
<!--<parameter name="ServicesDirectory">service</parameter>-->
<!--To override repository/modules you need to uncomment following parameter and value SHOULD be absolute file path-->
- <!--<parameter name="ModulesDirectory" locked="false">modules</parameter>-->
+ <!--<parameter name="ModulesDirectory">modules</parameter>-->
<!--Following params will set the proper context paths for invocations. All the endpoints will have a commons context-->
<!--root which can configured using the following contextRoot parameter-->
- <!--<parameter name="contextRoot" locked="false">axis2</parameter>-->
+ <!--<parameter name="contextRoot">axis2</parameter>-->
<!--Our HTTP endpoints can handle both REST and SOAP. Following parameters can be used to distinguish those endpoints-->
- <!--<parameter name="servicePath" locked="false">services</parameter>-->
- <!--<parameter name="restPath" locked="false">rest</parameter>-->
+ <!--<parameter name="servicePath">services</parameter>-->
+ <!--<parameter name="restPath">rest</parameter>-->
<!-- Following parameter will completely disable REST handling in Axis2-->
<parameter name="disableREST" locked="true">false</parameter>
@@ -109,18 +109,18 @@
<!-- ================================================= -->
<transportReceiver name="http"
class="org.apache.axis2.transport.http.SimpleHTTPServer">
- <parameter name="port" locked="false">6060</parameter>
+ <parameter name="port">6060</parameter>
<!--If you want to give your own host address for EPR generation-->
<!--uncomment following parameter , and set as you required.-->
- <!--<parameter name="hostname" locked="false">http://myApp.com/ws</parameter>-->
+ <!--<parameter name="hostname">http://myApp.com/ws</parameter>-->
</transportReceiver>
<transportReceiver name="tcp"
class="org.apache.axis2.transport.tcp.TCPServer">
- <parameter name="port" locked="false">6061</parameter>
+ <parameter name="port">6061</parameter>
<!--If you want to give your own host address for EPR generation-->
<!--uncomment following parameter , and set as you required.-->
- <!--<parameter name="hostname" locked="false">tcp://myApp.com/ws</parameter>-->
+ <!--<parameter name="hostname">tcp://myApp.com/ws</parameter>-->
</transportReceiver>
<!-- ================================================= -->
@@ -135,13 +135,13 @@
class="org.apache.axis2.transport.local.LocalTransportSender"/>
<transportSender name="http"
class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
- <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter>
- <parameter name="Transfer-Encoding" locked="false">chunked</parameter>
+ <parameter name="PROTOCOL">HTTP/1.1</parameter>
+ <parameter name="Transfer-Encoding">chunked</parameter>
</transportSender>
<transportSender name="https"
class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
- <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter>
- <parameter name="Transfer-Encoding" locked="false">chunked</parameter>
+ <parameter name="PROTOCOL">HTTP/1.1</parameter>
+ <parameter name="Transfer-Encoding">chunked</parameter>
</transportSender>
<!-- ================================================= -->
@@ -151,11 +151,11 @@
<!-- System pre-defined phases -->
<phase name="Transport">
<handler name="RequestURIBasedDispatcher"
- class="org.apache.axis2.engine.RequestURIBasedDispatcher">
+ class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher">
<order phase="Transport"/>
</handler>
<handler name="SOAPActionBasedDispatcher"
- class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
+ class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher">
<order phase="Transport"/>
</handler>
</phase>
@@ -163,31 +163,31 @@
<phase name="PreDispatch"/>
<phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
<handler name="RequestURIBasedDispatcher"
- class="org.apache.axis2.engine.RequestURIBasedDispatcher">
+ class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher">
<order phase="Dispatch"/>
</handler>
<handler name="SOAPActionBasedDispatcher"
- class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
+ class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher">
<order phase="Dispatch"/>
</handler>
<handler name="AddressingBasedDispatcher"
- class="org.apache.axis2.engine.AddressingBasedDispatcher">
+ class="org.apache.axis2.dispatchers.AddressingBasedDispatcher">
<order phase="Dispatch"/>
</handler>
<handler name="RequestURIOperationDispatcher"
- class="org.apache.axis2.engine.RequestURIOperationDispatcher">
+ class="org.apache.axis2.dispatchers.RequestURIOperationDispatcher">
<order phase="Dispatch"/>
</handler>
<handler name="SOAPMessageBodyBasedDispatcher"
- class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher">
+ class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher">
<order phase="Dispatch"/>
</handler>
<handler name="HTTPLocationBasedDispatcher"
- class="org.apache.axis2.engine.HTTPLocationBasedDispatcher">
+ class="org.apache.axis2.dispatchers.HTTPLocationBasedDispatcher">
<order phase="Dispatch"/>
</handler>
</phase>
@@ -210,31 +210,31 @@
<phase name="PreDispatch"/>
<phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
<handler name="RequestURIBasedDispatcher"
- class="org.apache.axis2.engine.RequestURIBasedDispatcher">
+ class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher">
<order phase="Dispatch"/>
</handler>
<handler name="SOAPActionBasedDispatcher"
- class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
+ class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher">
<order phase="Dispatch"/>
</handler>
<handler name="AddressingBasedDispatcher"
- class="org.apache.axis2.engine.AddressingBasedDispatcher">
+ class="org.apache.axis2.dispatchers.AddressingBasedDispatcher">
<order phase="Dispatch"/>
</handler>
<handler name="RequestURIOperationDispatcher"
- class="org.apache.axis2.engine.RequestURIOperationDispatcher">
+ class="org.apache.axis2.dispatchers.RequestURIOperationDispatcher">
<order phase="Dispatch"/>
</handler>
<handler name="SOAPMessageBodyBasedDispatcher"
- class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher">
+ class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher">
<order phase="Dispatch"/>
</handler>
<handler name="HTTPLocationBasedDispatcher"
- class="org.apache.axis2.engine.HTTPLocationBasedDispatcher">
+ class="org.apache.axis2.dispatchers.HTTPLocationBasedDispatcher">
<order phase="Dispatch"/>
</handler>
</phase>
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java Wed Jun 27 09:45:37 2007
@@ -212,14 +212,14 @@
new AARBasedWSDLLocator(baseURI, serviceArchiveFile, in));
} else if (axisServiceBuilder instanceof WSDL20ToAllAxisServicesBuilder) {
// trying to use the jar scheme as the base URI. I think this can be used to handle
- // wsdl 1.1 as well without using a custome URI resolver. Need to look at it later.
+ // wsdl 1.1 as well without using a custom URI resolver. Need to look at it later.
axisServiceBuilder.setBaseUri(
"jar:file://" + serviceArchiveFile.toURI() + "!/" + baseURI);
}
} else {
if (serviceArchiveFile != null) {
axisServiceBuilder.setBaseUri(
- serviceArchiveFile.getParentFile().getAbsolutePath());
+ serviceArchiveFile.getParentFile().toURI().toString());
}
}
if(axisServiceBuilder instanceof WSDL11ToAllAxisServicesBuilder ) {
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfo.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfo.java?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfo.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfo.java Wed Jun 27 09:45:37 2007
@@ -26,34 +26,20 @@
public static final int TYPE_SERVICE = 0;
public static final int TYPE_MODULE = 1;
+ public static final int TYPE_CUSTOM = 2;
/**
- * To check whether the file is a module or a servise
+ * To check whether the file is a module or a service
*/
private int type = TYPE_SERVICE;
private Deployer deployer;
- public WSInfo(String filename, long lastmodifieddate) {
- this.fileName = filename;
- this.lastModifiedDate = lastmodifieddate;
- }
-
-
- public WSInfo(String fileName, long lastModifiedDate, int type) {
- this.fileName = fileName;
- this.lastModifiedDate = lastModifiedDate;
- this.type = type;
- }
-
- public WSInfo(String fileName, long lastModifiedDate, Deployer deployer) {
+ public WSInfo(String fileName, long lastModifiedDate, Deployer deployer ,int type) {
this.fileName = fileName;
this.lastModifiedDate = lastModifiedDate;
this.deployer = deployer;
- //TODO: This is a temporary fix for the hot update in custom deployers
-// if (!(deployer instanceof ServiceDeployer)) {
-// this.type=2;
-// }
+ this.type = type;
}
public String getFileName() {
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfoList.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfoList.java?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfoList.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfoList.java Wed Jun 27 09:45:37 2007
@@ -22,11 +22,7 @@
import org.apache.axis2.deployment.Deployer;
import java.io.File;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-import java.util.HashSet;
+import java.util.*;
public class WSInfoList implements DeploymentConstants {
@@ -38,14 +34,14 @@
/**
* All the currently updated jars
*/
- public Set currentJars = new HashSet();
+ public Map currentJars = new HashMap();
/**
* Reference to DeploymentEngine to make update
*/
- private final DeploymentEngine deploymentEngine;
- private boolean check;
+ private boolean locked = false;
+ private final DeploymentEngine deploymentEngine;
public WSInfoList(DeploymentEngine deploy_engine) {
deploymentEngine = deploy_engine;
@@ -64,20 +60,16 @@
*
* @param file actual jar files for either Module or service
*/
- public synchronized void addWSInfoItem(File file, Deployer deployer) {
- WSInfo info = getFileItem(file.getName());
- if (info == null) {
- info = new WSInfo(file.getName(), file.lastModified(), deployer);
- jarList.add(info);
- DeploymentFileData fileData = new DeploymentFileData(file, deployer);
- deploymentEngine.addWSToDeploy(fileData);
- } else if (deploymentEngine.isHotUpdate() && isModified(file, info)) {
+ public synchronized void addWSInfoItem(File file, Deployer deployer , int type) {
+ WSInfo info = getFileItem(file,deployer,type);
+ if (deploymentEngine.isHotUpdate() && isModified(file, info)) {
info.setLastModifiedDate(file.lastModified());
- WSInfo wsInfo = new WSInfo(info.getFileName(), info.getLastModifiedDate(), deployer);
+ WSInfo wsInfo = new WSInfo(info.getFileName(), info.getLastModifiedDate(), deployer,type);
deploymentEngine.addWSToUndeploy(wsInfo); // add entry to undeploy list
DeploymentFileData deploymentFileData = new DeploymentFileData(file, deployer);
deploymentEngine.addWSToDeploy(deploymentFileData); // add entry to deploylist
}
+ jarList.add(info.getFileName());
}
/**
@@ -87,33 +79,40 @@
* and that is hot undeployment.
*/
private synchronized void checkForUndeployedServices() {
- if (!check) {
+ if(!locked) {
+ locked = true;
+ } else{
return;
- } else {
- check = false;
}
-
- Iterator iter = jarList.listIterator();
- List tempvector = new ArrayList();
-
- while (iter.hasNext()) {
- WSInfo fileitem = (WSInfo) iter.next();
- if (fileitem.getType() == WSInfo.TYPE_MODULE) {
+ Iterator infoItems = currentJars.keySet().iterator();
+ List tobeRemoved = new ArrayList();
+ while (infoItems.hasNext()) {
+ String fileName = (String) infoItems.next();
+ WSInfo infoItem = (WSInfo) currentJars.get(fileName);
+ if (infoItem.getType() == WSInfo.TYPE_MODULE) {
continue;
}
- String itemName = fileitem.getFileName();
- if (!currentJars.contains(itemName)) {
- tempvector.add(fileitem);
- WSInfo wsInfo = new WSInfo(fileitem.getFileName(), fileitem.getLastModifiedDate());
- deploymentEngine.addWSToUndeploy(wsInfo);
+ //seems like someone has deleted the file , so need to undeploy
+ boolean found = false;
+ for (int i = 0; i < jarList.size(); i++) {
+ String s = (String) jarList.get(i);
+ if(fileName.equals(s)){
+ found = true;
+ }
+ }
+ if(!found){
+ tobeRemoved.add(fileName);
+ deploymentEngine.addWSToUndeploy(infoItem);
}
}
- for (int i = 0; i < tempvector.size(); i++) {
- WSInfo fileItem = (WSInfo) tempvector.get(i);
- jarList.remove(fileItem);
+
+ for (int i = 0; i < tobeRemoved.size(); i++) {
+ String fileName = (String) tobeRemoved.get(i);
+ currentJars.remove(fileName);
}
- tempvector.clear();
- currentJars.clear();
+ tobeRemoved.clear();
+ jarList.clear();
+ locked = false;
}
/**
@@ -137,18 +136,17 @@
/**
* Gets the WSInfo object related to a file if it exists, null otherwise.
*
- * @param filename
*/
- private WSInfo getFileItem(String filename) {
- int sise = jarList.size();
- for (int i = 0; i < sise; i++) {
- WSInfo wsInfo = (WSInfo) jarList.get(i);
-
- if (wsInfo.getFileName().equals(filename)) {
- return wsInfo;
- }
+ private WSInfo getFileItem(File file , Deployer deployer , int type) {
+ String fileName = file.getName();
+ WSInfo info = (WSInfo) currentJars.get(fileName);
+ if(info==null){
+ info = new WSInfo(file.getName(), file.lastModified(), deployer ,type);
+ currentJars.put(file.getName(),info);
+ DeploymentFileData fileData = new DeploymentFileData(file, deployer);
+ deploymentEngine.addWSToDeploy(fileData);
}
- return null;
+ return info;
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org