servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r596355 [2/3] - in /servicemix/branches/servicemix-4.0: ./ apache-servicemix/ apache-servicemix/src/main/descriptors/ apache-servicemix/src/main/release/conf/ apache-servicemix/src/main/release/etc/ examples/intermediary/ examples/intermedi...
Date Mon, 19 Nov 2007 16:23:04 GMT
Added: servicemix/branches/servicemix-4.0/itests/tests/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/branches/servicemix-4.0/itests/tests/pom.xml?rev=596355&view=auto
==============================================================================
--- servicemix/branches/servicemix-4.0/itests/tests/pom.xml (added)
+++ servicemix/branches/servicemix-4.0/itests/tests/pom.xml Mon Nov 19 08:22:57 2007
@@ -0,0 +1,544 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <!--
+
+        Licensed to the Apache Software Foundation (ASF) under one or more
+        contributor license agreements.  See the NOTICE file distributed with
+        this work for additional information regarding copyright ownership.
+        The ASF licenses this file to You 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.
+    -->
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.servicemix.itests</groupId>
+        <artifactId>itests</artifactId>
+        <version>4.0-SNAPSHOT</version>
+    </parent>
+
+    <groupId>org.apache.servicemix.itests</groupId>
+    <artifactId>org.apache.servicemix.itests.tests</artifactId>
+    <packaging>jar</packaging>
+    <version>4.0-SNAPSHOT</version>
+    <name>ServiceMix Integration Tests</name>
+
+    <properties>
+        <osgi.test.platform>org.springframework.osgi.test.platform.EquinoxPlatform</osgi.test.platform>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.servicemix.bundles</groupId>
+            <artifactId>org.apache.servicemix.bundles.aopalliance</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.servicemix.bundles</groupId>
+            <artifactId>org.apache.servicemix.bundles.cxf</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.servicemix.bundles</groupId>
+            <artifactId>org.apache.servicemix.bundles.httpcore</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.servicemix.bundles</groupId>
+            <artifactId>org.apache.servicemix.bundles.jaxb-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.servicemix.bundles</groupId>
+            <artifactId>org.apache.servicemix.bundles.jaxb-impl</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.servicemix.bundles</groupId>
+            <artifactId>org.apache.servicemix.bundles.jaxws-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.servicemix.bundles</groupId>
+            <artifactId>org.apache.servicemix.bundles.openejb</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.servicemix.bundles</groupId>
+            <artifactId>org.apache.servicemix.bundles.openjpa</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.servicemix.bundles</groupId>
+            <artifactId>org.apache.servicemix.bundles.wsdl4j</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.servicemix.nmr</groupId>
+            <artifactId>org.apache.servicemix.nmr.api</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.servicemix.nmr</groupId>
+            <artifactId>org.apache.servicemix.nmr.core</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.servicemix.nmr</groupId>
+            <artifactId>org.apache.servicemix.nmr.osgi</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.servicemix.nmr</groupId>
+            <artifactId>org.apache.servicemix.nmr.spring</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.servicemix.jbi</groupId>
+            <artifactId>org.apache.servicemix.jbi.api</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.servicemix</groupId>
+            <artifactId>org.apache.servicemix.camel</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.servicemix</groupId>
+            <artifactId>org.apache.servicemix.jaxws</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.servicemix.openejb</groupId>
+            <artifactId>org.apache.servicemix.openejb</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.servicemix.examples</groupId>
+            <artifactId>org.apache.servicemix.examples.intermediary</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.servicemix.examples</groupId>
+            <artifactId>org.apache.servicemix.examples.jaxws</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.servicemix.examples</groupId>
+            <artifactId>org.apache.servicemix.examples.jaxws</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.servicemix.itests</groupId>
+            <artifactId>org.apache.servicemix.itests.ejbjar</artifactId>
+            <version>4.0-SNAPSHOT</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-beans</artifactId>
+            <version>${spring.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-core</artifactId>
+            <version>${spring.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-context</artifactId>
+            <version>${spring.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-aop</artifactId>
+            <version>${spring.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>commons-pool</groupId>
+            <artifactId>commons-pool</artifactId>
+            <version>1.3</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-test</artifactId>
+            <version>${spring.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.osgi</groupId>
+            <artifactId>spring-osgi-core</artifactId>
+            <version>${spring.osgi.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.osgi</groupId>
+            <artifactId>spring-osgi-io</artifactId>
+            <version>${spring.osgi.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.osgi</groupId>
+            <artifactId>spring-osgi-extender</artifactId>
+            <version>${spring.osgi.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.osgi</groupId>
+            <artifactId>spring-osgi-test</artifactId>
+            <version>${spring.osgi.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.osgi</groupId>
+            <artifactId>spring-osgi-annotation</artifactId>
+            <version>${spring.osgi.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.osgi</groupId>
+            <artifactId>junit.osgi</artifactId>
+            <version>3.8.2-SNAPSHOT</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.osgi</groupId>
+            <artifactId>asm.osgi</artifactId>
+            <version>2.2.3-SNAPSHOT</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-spring</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-jms</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-osgi</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-jhc</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.osgi</groupId>
+            <artifactId>spring-osgi-test</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.osgi</groupId>
+            <artifactId>spring-osgi-extender</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.osgi</groupId>
+            <artifactId>spring-osgi-annotation</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-tx</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-jms</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>asm</groupId>
+            <artifactId>asm</artifactId>
+            <version>3.0</version>
+            <scope>provided</scope>
+        </dependency>
+<!--
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <version>1.4.3</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>jcl104-over-slf4j</artifactId>
+            <version>1.4.3</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <version>1.4.3</version>
+            <scope>provided</scope>
+        </dependency>
+-->
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-ejb_3.0_spec</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-j2ee-connector_1.5_spec</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-jacc_1.1_spec</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-jaxr_1.0_spec</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-interceptor_3.0_spec</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-javamail_1.4_spec</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-jpa_3.0_spec</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-jta_1.1_spec</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-jms_1.1_spec</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-jta_1.1_spec</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-j2ee-management_1.1_spec</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-saaj_1.1_spec</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-stax-api_1.0_spec</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-ws-metadata_2.0_spec</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-servlet_2.5_spec</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-activation_1.1_spec</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-annotation_1.0_spec</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>activemq-core</artifactId>
+            <version>5.0-SNAPSHOT</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.xbean</groupId>
+            <artifactId>xbean-finder</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.xbean</groupId>
+            <artifactId>xbean-naming</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.xbean</groupId>
+            <artifactId>xbean-reflect</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.servicemix</groupId>
+            <artifactId>org.apache.servicemix.activemq</artifactId>
+            <version>4.0-SNAPSHOT</version>
+            <scope>provided</scope>
+        </dependency>
+        <!--
+        <dependency>
+          <groupId>org.apache.felix</groupId>
+          <artifactId>org.apache.felix.servicemix</artifactId>
+          <version>${felix.version}</version>
+          <scope>provided</scope>
+        </dependency>
+        -->
+        <dependency>
+            <groupId>org.eclipse.osgi</groupId>
+            <artifactId>org.eclipse.osgi</artifactId>
+            <version>3.2.2</version>
+            <scope>provided</scope>
+        </dependency>
+        <!--
+      <dependency>
+        <groupId>knopflerfish</groupId>
+        <artifactId>framework</artifactId>
+        <version>2.0.1</version>
+        <scope>provided</scope>
+      </dependency>
+      -->
+        <dependency>
+            <groupId>org.springframework.osgi</groupId>
+            <artifactId>junit.osgi</artifactId>
+            <version>3.8.2-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.osgi</groupId>
+            <artifactId>asm.osgi</artifactId>
+            <version>2.2.3-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.osgi.compendium</artifactId>
+            <version>0.9.0-SNAPSHOT</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.apache.felix</groupId>
+                    <artifactId>org.osgi.core</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.apache.felix</groupId>
+                    <artifactId>org.osgi.foundation</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.apache.felix</groupId>
+                    <artifactId>javax.servlet</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.configadmin</artifactId>
+            <version>0.9.0-SNAPSHOT</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.apache.felix</groupId>
+                    <artifactId>org.osgi.core</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.logging</groupId>
+            <artifactId>pax-logging-api</artifactId>
+            <version>0.9.7-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.logging</groupId>
+            <artifactId>pax-logging-service</artifactId>
+            <version>0.9.7-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.confman</groupId>
+            <artifactId>pax-confman-propsloader</artifactId>
+            <version>0.3.0-SNAPSHOT</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <!-- generate dependencies versions -->
+            <plugin>
+                <groupId>org.apache.servicemix.tooling</groupId>
+                <artifactId>depends-maven-plugin</artifactId>
+                <version>4.0-SNAPSHOT</version>
+                <executions>
+                    <execution>
+                        <id>generate-depends-file</id>
+                        <goals>
+                            <goal>generate-depends-file</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <!-- run tests during the integration-test phase, not
+                 the normal test phase -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <skip>true</skip>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>default</id>
+                        <phase>test</phase>
+                        <goals></goals>
+                    </execution>
+                    <execution>
+                        <id>integration-test</id>
+                        <phase>integration-test</phase>
+                        <goals>
+                            <goal>test</goal>
+                        </goals>
+                        <configuration>
+                            <skip>false</skip>
+                            <forkMode>pertest</forkMode>
+                            <systemProperties>
+                                <property>
+                                    <name>org.springframework.osgi.test.framework</name>
+                                    <value>${osgi.test.platform}</value>
+                                </property>
+                            </systemProperties>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

Added: servicemix/branches/servicemix-4.0/itests/tests/src/test/conf/services/org.ops4j.pax.logging.properties
URL: http://svn.apache.org/viewvc/servicemix/branches/servicemix-4.0/itests/tests/src/test/conf/services/org.ops4j.pax.logging.properties?rev=596355&view=auto
==============================================================================
--- servicemix/branches/servicemix-4.0/itests/tests/src/test/conf/services/org.ops4j.pax.logging.properties (added)
+++ servicemix/branches/servicemix-4.0/itests/tests/src/test/conf/services/org.ops4j.pax.logging.properties Mon Nov 19 08:22:57 2007
@@ -0,0 +1,32 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+#
+#
+log4j.rootLogger=DEBUG, stdout
+
+# CONSOLE appender not used by default
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} | %-5.5p | %-16.16t | %-32.32c{1} | %-32.32C %4L | %m%n
+
+# File appender
+log4j.appender.out=org.apache.log4j.FileAppender
+log4j.appender.out.layout=org.apache.log4j.PatternLayout
+log4j.appender.out.layout.ConversionPattern=%d{ABSOLUTE} | %-5.5p | %-16.16t | %-32.32c{1} | %-32.32C %4L | %m%n
+log4j.appender.out.file=target/servicemix.log
+log4j.appender.out.append=true

Added: servicemix/branches/servicemix-4.0/itests/tests/src/test/java/org/apache/servicemix/AbstractIntegrationTest.java
URL: http://svn.apache.org/viewvc/servicemix/branches/servicemix-4.0/itests/tests/src/test/java/org/apache/servicemix/AbstractIntegrationTest.java?rev=596355&view=auto
==============================================================================
--- servicemix/branches/servicemix-4.0/itests/tests/src/test/java/org/apache/servicemix/AbstractIntegrationTest.java (added)
+++ servicemix/branches/servicemix-4.0/itests/tests/src/test/java/org/apache/servicemix/AbstractIntegrationTest.java Mon Nov 19 08:22:57 2007
@@ -0,0 +1,179 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.servicemix;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import org.apache.log4j.PropertyConfigurator;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.ServiceEvent;
+import org.osgi.framework.ServiceListener;
+import org.springframework.osgi.internal.util.concurrent.Counter;
+import org.springframework.osgi.test.AbstractConfigurableBundleCreatorTests;
+import org.springframework.osgi.util.OsgiFilterUtils;
+import org.springframework.osgi.util.OsgiListenerUtils;
+
+public class AbstractIntegrationTest extends AbstractConfigurableBundleCreatorTests {
+
+    static {
+        try {
+            System.setProperty("bundles.configuration.location", new File("src/test/conf").getAbsolutePath());
+            PropertyConfigurator.configure("target/test-classes/log4j.properties");
+        } catch (Throwable t) {}
+    }
+
+    private Properties dependencies;
+
+    protected String getBundle(String groupId, String artifactId) {
+        return groupId + "," + artifactId + "," + getBundleVersion(groupId, artifactId);
+    }
+
+    protected String getBundleVersion(String groupId, String artifactId) {
+        if (dependencies == null) {
+            try {
+                File f = new File(System.getProperty("basedir"), "target/classes/META-INF/maven/dependencies.properties");
+                Properties prop = new Properties();
+                prop.load(new FileInputStream(f));
+                dependencies = prop;
+            } catch (IOException e) {
+                throw new IllegalStateException("Unable to load dependencies informations", e);
+            }
+        }
+        String version = dependencies.getProperty(groupId + "/" + artifactId + "/version");
+        if (version == null) {
+            throw new IllegalStateException("Unable to find dependency information for: " + groupId + "/" + artifactId + "/version");
+        }
+        return version;
+    }
+
+    protected String[] getTestFrameworkBundlesNames() {
+        return new String[] {
+            getBundle("org.apache.geronimo.specs", "geronimo-servlet_2.5_spec"),
+            getBundle("org.apache.felix", "org.osgi.compendium"),
+            getBundle("org.apache.felix", "org.apache.felix.configadmin"),
+            getBundle("org.ops4j.pax.confman", "pax-confman-propsloader"),
+            getBundle("org.ops4j.pax.logging", "pax-logging-api"),
+            getBundle("org.ops4j.pax.logging", "pax-logging-service"),
+            getBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.aopalliance"),
+            getBundle("org.springframework", "spring-beans"),
+            getBundle("org.springframework", "spring-core"),
+            getBundle("org.springframework", "spring-context"),
+            getBundle("org.springframework", "spring-aop"),
+            getBundle("org.springframework", "spring-test"),
+            getBundle("org.springframework.osgi", "spring-osgi-core"),
+            getBundle("org.springframework.osgi", "spring-osgi-io"),
+            getBundle("org.springframework.osgi", "spring-osgi-extender"),
+            getBundle("org.springframework.osgi", "spring-osgi-test"),
+            getBundle("org.springframework.osgi", "spring-osgi-annotation"),
+            getBundle("org.springframework.osgi", "junit.osgi"),
+            getBundle("org.springframework.osgi", "asm.osgi"),
+		};
+    }
+
+    protected void installBundle(String groupId, String artifactId, String classifier, String type) throws Exception {
+        String version = getBundleVersion(groupId, artifactId);
+        File loc = localMavenBundle(groupId, artifactId, version, classifier, type);
+        Bundle bundle = bundleContext.installBundle(loc.toURI().toString());
+        bundle.start();
+    }
+
+    protected File localMavenBundle(String groupId, String artifact, String version, String classifier, String type) {
+        String defaultHome = new File(new File(System.getProperty("user.home")), ".m2/repository").getAbsolutePath();
+        File repositoryHome = new File(System.getProperty("localRepository", defaultHome));
+
+        StringBuffer location = new StringBuffer(groupId.replace('.', '/'));
+        location.append('/');
+        location.append(artifact);
+        location.append('/');
+        location.append(version);
+        location.append('/');
+        location.append(artifact);
+        location.append('-');
+        location.append(version);
+        if (classifier != null) {
+            location.append('-');
+            location.append(classifier);
+        }
+        location.append(".");
+        location.append(type);
+
+        return new File(repositoryHome, location.toString());
+    }
+
+    public <T> T getOsgiService(Class<T> type) {
+        return getOsgiService(type, DEFAULT_WAIT_TIME);
+    }
+
+    public <T> T getOsgiService(Class<T> type, long timeout) {
+        // translate from seconds to miliseconds
+        long time = timeout * 1000;
+
+        // use the counter to make sure the threads block
+        final Counter counter = new Counter("waitForOsgiService on bnd=" + type.getName());
+
+        counter.increment();
+
+        final List<T> services = new ArrayList<T>();
+
+        ServiceListener listener = new ServiceListener() {
+            public void serviceChanged(ServiceEvent event) {
+                if (event.getType() == ServiceEvent.REGISTERED) {
+                    services.add((T) bundleContext.getService(event.getServiceReference()));
+                    counter.decrement();
+                }
+            }
+        };
+
+        String filter = OsgiFilterUtils.unifyFilter(type.getName(), null);
+        OsgiListenerUtils.addServiceListener(bundleContext, listener, filter);
+
+        if (logger.isDebugEnabled())
+            logger.debug("start waiting for OSGi service=" + type.getName());
+
+        try {
+            if (counter.waitForZero(time)) {
+                logger.warn("waiting for OSGi service=" + type.getName() + " timed out");
+                throw new RuntimeException("Gave up waiting for OSGi service '" + type.getName() + "' to be created");
+            }
+            else if (logger.isDebugEnabled()) {
+                logger.debug("found OSGi service=" + type.getName());
+            }
+            return services.get(0);
+        }
+        finally {
+            // inform waiting thread
+            bundleContext.removeServiceListener(listener);
+        }
+    }
+
+    protected void checkBundleStarted(String name) {
+        assertNotNull(bundleContext);
+        for (int i = 0; i < bundleContext.getBundles().length; i++) {
+            Bundle b = bundleContext.getBundles()[i];
+            if (b.getSymbolicName().equals(name)) {
+                assertEquals("Bundle '" + name + "' is not active", Bundle.ACTIVE, b.getState());
+                return;
+            }
+        }
+        fail("Bundle '" + name + "' not found");
+    }
+}
\ No newline at end of file

Added: servicemix/branches/servicemix-4.0/itests/tests/src/test/java/org/apache/servicemix/EjbIntegrationTest.java
URL: http://svn.apache.org/viewvc/servicemix/branches/servicemix-4.0/itests/tests/src/test/java/org/apache/servicemix/EjbIntegrationTest.java?rev=596355&view=auto
==============================================================================
--- servicemix/branches/servicemix-4.0/itests/tests/src/test/java/org/apache/servicemix/EjbIntegrationTest.java (added)
+++ servicemix/branches/servicemix-4.0/itests/tests/src/test/java/org/apache/servicemix/EjbIntegrationTest.java Mon Nov 19 08:22:57 2007
@@ -0,0 +1,106 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.servicemix;
+
+import java.util.Properties;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+public class EjbIntegrationTest extends AbstractIntegrationTest {
+
+    private static final Log LOGGER = LogFactory.getLog(EjbIntegrationTest.class);
+
+    private Properties dependencies;
+
+    /**
+	 * The manifest to use for the "virtual bundle" created
+	 * out of the test classes and resources in this project
+	 *
+	 * This is actually the boilerplate manifest with one additional
+	 * import-package added. We should provide a simpler customization
+	 * point for such use cases that doesn't require duplication
+	 * of the entire manifest...
+	 */
+	protected String getManifestLocation() {
+		return "classpath:org/apache/servicemix/MANIFEST.MF";
+	}
+
+    /**
+     * The location of the packaged OSGi bundles to be installed
+     * for this test. Values are Spring resource paths. The bundles
+     * we want to use are part of the same multi-project maven
+     * build as this project is. Hence we use the localMavenArtifact
+     * helper method to find the bundles produced by the package
+     * phase of the maven build (these tests will run after the
+     * packaging phase, in the integration-test phase).
+     *
+     * JUnit, commons-logging, spring-core and the spring OSGi
+     * test bundle are automatically included so do not need
+     * to be specified here.
+     */
+    protected String[] getTestBundlesNames() {
+        return new String[] {
+            getBundle("org.apache.xbean", "xbean-finder"),
+            getBundle("org.apache.xbean", "xbean-naming"),
+            getBundle("org.apache.xbean", "xbean-reflect"),
+            getBundle("org.apache.geronimo.specs", "geronimo-activation_1.1_spec"),
+            getBundle("org.apache.geronimo.specs", "geronimo-annotation_1.0_spec"),
+            getBundle("org.apache.geronimo.specs", "geronimo-ejb_3.0_spec"),
+            getBundle("org.apache.geronimo.specs", "geronimo-interceptor_3.0_spec"),
+            getBundle("org.apache.geronimo.specs", "geronimo-j2ee-connector_1.5_spec"),
+            getBundle("org.apache.geronimo.specs", "geronimo-j2ee-management_1.1_spec"),
+            getBundle("org.apache.geronimo.specs", "geronimo-jacc_1.1_spec"),
+            getBundle("org.apache.geronimo.specs", "geronimo-javamail_1.4_spec"),
+            getBundle("org.apache.geronimo.specs", "geronimo-jaxr_1.0_spec"),
+            getBundle("org.apache.geronimo.specs", "geronimo-jms_1.1_spec"),
+            getBundle("org.apache.geronimo.specs", "geronimo-jpa_3.0_spec"),
+            getBundle("org.apache.geronimo.specs", "geronimo-jta_1.1_spec"),
+            getBundle("org.apache.geronimo.specs", "geronimo-saaj_1.1_spec"),
+            getBundle("org.apache.geronimo.specs", "geronimo-stax-api_1.0_spec"),
+            getBundle("org.apache.geronimo.specs", "geronimo-ws-metadata_2.0_spec"),
+            getBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.cxf"),
+            getBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.jaxb-api"),
+            getBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.jaxb-impl"),
+            getBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.jaxws-api"),
+            getBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.openejb"),
+            getBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.openjpa"),
+            getBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.wsdl4j"),
+            getBundle("org.apache.servicemix.jbi", "org.apache.servicemix.jbi.api"),
+            getBundle("org.apache.servicemix.nmr", "org.apache.servicemix.nmr.api"),
+            getBundle("org.apache.servicemix.nmr", "org.apache.servicemix.nmr.core"),
+            getBundle("org.apache.servicemix.nmr", "org.apache.servicemix.nmr.spring"),
+            getBundle("org.apache.servicemix.nmr", "org.apache.servicemix.nmr.osgi"),
+            getBundle("org.apache.servicemix.openejb", "org.apache.servicemix.openejb"),
+        };
+    }
+
+    /**
+	 * The superclass provides us access to the root bundle
+	 * context via the 'getBundleContext' operation
+	 */
+	public void testOSGiStartedOk() throws Exception {
+        System.out.println("Checking that EJB bundle is started");
+        checkBundleStarted("org.apache.servicemix.openejb");
+        Thread.sleep(1000);
+        System.out.println("Installing ejbjar bundle");
+        installBundle("org.apache.servicemix.itests", "org.apache.servicemix.itests.ejbjar", null, "jar");
+        System.out.println("ejbjar bundle installed");
+        Thread.sleep(1000);
+    }
+
+}
\ No newline at end of file

Added: servicemix/branches/servicemix-4.0/itests/tests/src/test/java/org/apache/servicemix/IntegrationTest.java
URL: http://svn.apache.org/viewvc/servicemix/branches/servicemix-4.0/itests/tests/src/test/java/org/apache/servicemix/IntegrationTest.java?rev=596355&view=auto
==============================================================================
--- servicemix/branches/servicemix-4.0/itests/tests/src/test/java/org/apache/servicemix/IntegrationTest.java (added)
+++ servicemix/branches/servicemix-4.0/itests/tests/src/test/java/org/apache/servicemix/IntegrationTest.java Mon Nov 19 08:22:57 2007
@@ -0,0 +1,136 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.servicemix;
+
+import java.io.IOException;
+import java.io.File;
+import java.io.FileInputStream;
+import java.util.Properties;
+
+import javax.jms.ConnectionFactory;
+
+import org.apache.servicemix.nmr.api.Endpoint;
+import org.apache.servicemix.nmr.api.NMR;
+import org.osgi.framework.ServiceReference;
+import org.springframework.osgi.test.AbstractConfigurableBundleCreatorTests;
+
+public class IntegrationTest extends AbstractIntegrationTest {
+
+    private Properties dependencies;
+
+    /**
+	 * The manifest to use for the "virtual bundle" created
+	 * out of the test classes and resources in this project
+	 * 
+	 * This is actually the boilerplate manifest with one additional
+	 * import-package added. We should provide a simpler customization
+	 * point for such use cases that doesn't require duplication
+	 * of the entire manifest...
+	 */
+	protected String getManifestLocation() { 
+		return "classpath:org/apache/servicemix/MANIFEST.MF";
+	}
+	
+    /**
+     * The location of the packaged OSGi bundles to be installed
+     * for this test. Values are Spring resource paths. The bundles
+     * we want to use are part of the same multi-project maven
+     * build as this project is. Hence we use the localMavenArtifact
+     * helper method to find the bundles produced by the package
+     * phase of the maven build (these tests will run after the
+     * packaging phase, in the integration-test phase).
+     *
+     * JUnit, commons-logging, spring-core and the spring OSGi
+     * test bundle are automatically included so do not need
+     * to be specified here.
+     */
+    protected String[] getTestBundlesNames() {
+        return new String[] {
+            getBundle("org.apache.geronimo.specs", "geronimo-interceptor_3.0_spec"),
+            getBundle("org.apache.geronimo.specs", "geronimo-jms_1.1_spec"),
+            getBundle("org.apache.geronimo.specs", "geronimo-j2ee-management_1.1_spec"),
+            getBundle("org.apache.geronimo.specs", "geronimo-stax-api_1.0_spec"),
+            getBundle("org.apache.geronimo.specs", "geronimo-activation_1.1_spec"),
+            getBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.jaxws-api"),
+            getBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.jaxb-api"),
+            getBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.jaxb-impl"),
+            getBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.httpcore"),
+            getBundle("org.apache.activemq", "activemq-core"),
+            getBundle("org.springframework", "spring-tx"),
+            getBundle("org.springframework", "spring-jms"),
+            getBundle("org.apache.camel", "camel-core"),
+            getBundle("org.apache.camel", "camel-spring"),
+            getBundle("org.apache.camel", "camel-osgi"),
+            getBundle("org.apache.camel", "camel-jms"),
+            getBundle("org.apache.camel", "camel-jhc"),
+            getBundle("org.apache.servicemix.jbi", "org.apache.servicemix.jbi.api"),
+            getBundle("org.apache.servicemix.nmr", "org.apache.servicemix.nmr.api"),
+            getBundle("org.apache.servicemix.nmr", "org.apache.servicemix.nmr.core"),
+            getBundle("org.apache.servicemix.nmr", "org.apache.servicemix.nmr.spring"),
+            getBundle("org.apache.servicemix.nmr", "org.apache.servicemix.nmr.osgi"),
+            getBundle("org.apache.servicemix", "org.apache.servicemix.camel"),
+            getBundle("org.apache.servicemix", "org.apache.servicemix.jaxws"),
+            getBundle("org.apache.servicemix.examples", "org.apache.servicemix.examples.intermediary"),
+            getBundle("org.apache.servicemix.examples", "org.apache.servicemix.examples.jaxws"),
+            getBundle("org.apache.felix","org.apache.felix.configadmin"),
+            getBundle("org.apache.geronimo.specs","geronimo-jta_1.1_spec"),
+            getBundle("org.apache.servicemix","org.apache.servicemix.activemq")
+		};
+	}
+
+    /**
+	 * The superclass provides us access to the root bundle
+	 * context via the 'getBundleContext' operation
+	 */
+	public void testOSGiStartedOk() {
+		assertNotNull(bundleContext);
+	}
+	
+	/**
+	 * The simple service should have been exported as an
+	 * OSGi service, which we can verify using the OSGi
+	 * service APIs.
+	 *
+	 * In a Spring bundle, using osgi:reference is a much
+	 * easier way to get a reference to a published service.
+	 * 
+	 */
+	public void testSimpleServiceExported() {
+		waitOnContextCreation("org.apache.servicemix.examples.intermediary");
+        ServiceReference ref = bundleContext.getServiceReference(NMR.class.getName());
+        ServiceReference endpointRef = bundleContext.getServiceReference(Endpoint.class.getName());
+        ServiceReference connectionFactoryRef = bundleContext.getServiceReference(ConnectionFactory.class.getName());
+        assertNotNull("Service Reference is null", ref);
+        assertNotNull("Endpoint Reference is null", endpointRef);
+        assertNotNull("ConnectionFacotory Reference is null", connectionFactoryRef);
+        try {
+            NMR nmr = (NMR) bundleContext.getService(ref);
+            assertNotNull("Cannot find the service", nmr);
+            Endpoint jaxwsProvider = (Endpoint) bundleContext.getService(endpointRef);
+            assertNotNull(jaxwsProvider);
+            assertEquals(jaxwsProvider.getClass().getName(), 
+            		"org.apache.servicemix.jaxws.JAXWSProvider");
+            
+            ConnectionFactory connFactory = (ConnectionFactory)bundleContext.getService(connectionFactoryRef);
+            assertNotNull(connFactory);
+            assertEquals(connFactory.getClass().getName(), "org.apache.activemq.pool.PooledConnectionFactory");
+        } finally {
+            bundleContext.ungetService(ref);
+        }
+	}
+
+}
\ No newline at end of file

Added: servicemix/branches/servicemix-4.0/itests/tests/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/servicemix/branches/servicemix-4.0/itests/tests/src/test/resources/log4j.properties?rev=596355&view=auto
==============================================================================
--- servicemix/branches/servicemix-4.0/itests/tests/src/test/resources/log4j.properties (added)
+++ servicemix/branches/servicemix-4.0/itests/tests/src/test/resources/log4j.properties Mon Nov 19 08:22:57 2007
@@ -0,0 +1,29 @@
+#
+#    Licensed to the Apache Software Foundation (ASF) under one or more
+#    contributor license agreements.  See the NOTICE file distributed with
+#    this work for additional information regarding copyright ownership.
+#    The ASF licenses this file to You 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.
+#
+################################################################################
+
+log4j.rootLogger=DEBUG, stdout
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - %m%n
+
+log4j.logger.org.springframework.osgi=DEBUG
+log4j.logger.org.apache.camel=DEBUG
+log4j.logger.org.apache.servicemix=DEBUG
+
+#log4j.debug=false
\ No newline at end of file

Added: servicemix/branches/servicemix-4.0/itests/tests/src/test/resources/org/apache/servicemix/MANIFEST.MF
URL: http://svn.apache.org/viewvc/servicemix/branches/servicemix-4.0/itests/tests/src/test/resources/org/apache/servicemix/MANIFEST.MF?rev=596355&view=auto
==============================================================================
--- servicemix/branches/servicemix-4.0/itests/tests/src/test/resources/org/apache/servicemix/MANIFEST.MF (added)
+++ servicemix/branches/servicemix-4.0/itests/tests/src/test/resources/org/apache/servicemix/MANIFEST.MF Mon Nov 19 08:22:57 2007
@@ -0,0 +1,31 @@
+Manifest-Version: 1.0
+License-00: 
+License-01: Licensed to the Apache Software Foundation (ASF) under one or more
+License-02: contributor license agreements.  See the NOTICE file distributed with
+License-03: this work for additional information regarding copyright ownership.
+License-04: The ASF licenses this file to You under the Apache License, Version 2.0
+License-05: (the "License"); you may not use this file except in compliance with
+License-06: the License.  You may obtain a copy of the License at
+License-07: 
+License-08:      http://www.apache.org/licenses/LICENSE-2.0
+License-09: 
+License-10: Unless required by applicable law or agreed to in writing, software
+License-11: distributed under the License is distributed on an "AS IS" BASIS,
+License-12: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+License-13: See the License for the specific language governing permissions and
+License-14: limitations under the License.
+License-15: 
+Bundle-Name: org.apache.servicemix.test
+Bundle-SymbolicName: org.apache.servicemix.test
+Bundle-Vendor: Spring Framework
+Bundle-Activator: org.springframework.osgi.test.JUnitTestActivator
+Import-Package: junit.framework,
+ org.osgi.framework;specification-version="1.3.0",
+ org.apache.commons.logging,
+ org.springframework.core.io,
+ org.springframework.osgi.test,
+ org.springframework.osgi.internal.util.concurrent,
+ org.apache.servicemix.nmr.api,
+ org.apache.servicemix.nmr.core,
+ javax.jms
+

Propchange: servicemix/branches/servicemix-4.0/jaxws/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Nov 19 08:22:57 2007
@@ -0,0 +1,4 @@
+target
+*.iml
+*.ipr
+*.iws

Added: servicemix/branches/servicemix-4.0/openejb/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/branches/servicemix-4.0/openejb/pom.xml?rev=596355&view=auto
==============================================================================
--- servicemix/branches/servicemix-4.0/openejb/pom.xml (added)
+++ servicemix/branches/servicemix-4.0/openejb/pom.xml Mon Nov 19 08:22:57 2007
@@ -0,0 +1,190 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <!--
+
+        Licensed to the Apache Software Foundation (ASF) under one or more
+        contributor license agreements.  See the NOTICE file distributed with
+        this work for additional information regarding copyright ownership.
+        The ASF licenses this file to You 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.
+    -->
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.servicemix</groupId>
+        <artifactId>servicemix</artifactId>
+        <version>4.0-SNAPSHOT</version>
+    </parent>
+
+    <groupId>org.apache.servicemix.openejb</groupId>
+    <artifactId>org.apache.servicemix.openejb</artifactId>
+    <packaging>bundle</packaging>
+    <version>4.0-SNAPSHOT</version>
+    <name>ServiceMix OpenEJB</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.servicemix.bundles</groupId>
+            <artifactId>org.apache.servicemix.bundles.openejb</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.servicemix.bundles</groupId>
+            <artifactId>org.apache.servicemix.bundles.openjpa</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.servicemix.bundles</groupId>
+            <artifactId>org.apache.servicemix.bundles.cxf</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-beans</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.osgi</groupId>
+            <artifactId>spring-osgi-core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.web</groupId>
+            <artifactId>pax-web-service</artifactId>
+            <version>0.3.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.logging</groupId>
+            <artifactId>pax-logging-api</artifactId>
+            <version>0.9.7-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.logging</groupId>
+            <artifactId>pax-logging-service</artifactId>
+            <version>0.9.7-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.osgi.core</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.osgi.compendium</artifactId>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-context</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-core</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-aop</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.osgi</groupId>
+            <artifactId>spring-osgi-io</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.osgi</groupId>
+            <artifactId>spring-osgi-extender</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.osgi</groupId>
+            <artifactId>spring-osgi-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.osgi</groupId>
+            <artifactId>spring-osgi-annotation</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.osgi</groupId>
+            <artifactId>junit.osgi</artifactId>
+            <version>3.8.2-SNAPSHOT</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.osgi</groupId>
+            <artifactId>asm.osgi</artifactId>
+            <version>2.2.3-SNAPSHOT</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+            <version>1.2.15</version>
+            <scope>test</scope>
+            <exclusions>
+                <exclusion>
+                    <groupId>com.sun.jdmk</groupId>
+                    <artifactId>jmxtools</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>com.sun.jmx</groupId>
+                    <artifactId>jmxri</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <!-- Bundle generation -->
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <configuration>
+                    <instructions>
+                        <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
+                        <Import-Package>
+                            javax.xml.rpc*;resolution:=optional,
+                            *
+                        </Import-Package>
+                        <Export-Package>${pom.artifactId}*</Export-Package>
+                        <Private-Package></Private-Package>
+                        <Spring-Context>*;publish-context:=false</Spring-Context>
+                    </instructions>
+                </configuration>
+            </plugin>
+            <!-- generate dependencies versions -->
+            <plugin>
+                <groupId>org.apache.servicemix.tooling</groupId>
+                <artifactId>depends-maven-plugin</artifactId>
+                <version>4.0-SNAPSHOT</version>
+                <executions>
+                    <execution>
+                        <id>generate-depends-file</id>
+                        <goals>
+                            <goal>generate-depends-file</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

Added: servicemix/branches/servicemix-4.0/openejb/src/main/java/org/apache/servicemix/openejb/Deployer.java
URL: http://svn.apache.org/viewvc/servicemix/branches/servicemix-4.0/openejb/src/main/java/org/apache/servicemix/openejb/Deployer.java?rev=596355&view=auto
==============================================================================
--- servicemix/branches/servicemix-4.0/openejb/src/main/java/org/apache/servicemix/openejb/Deployer.java (added)
+++ servicemix/branches/servicemix-4.0/openejb/src/main/java/org/apache/servicemix/openejb/Deployer.java Mon Nov 19 08:22:57 2007
@@ -0,0 +1,155 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.servicemix.openejb;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.openejb.OpenEJBException;
+import org.apache.openejb.loader.SystemInstance;
+import org.apache.openejb.assembler.classic.AppInfo;
+import org.apache.openejb.assembler.classic.Assembler;
+import org.apache.openejb.config.AppModule;
+import org.apache.openejb.config.EjbModule;
+import org.apache.openejb.config.ReadDescriptors;
+import org.apache.openejb.config.WsModule;
+import org.apache.openejb.config.ConfigurationFactory;
+import org.apache.openejb.jee.EjbJar;
+import org.apache.openejb.jee.JavaWsdlMapping;
+import org.apache.openejb.jee.WebserviceDescription;
+import org.apache.openejb.jee.Webservices;
+import org.apache.xbean.finder.ResourceFinder;
+
+/**
+ * The Deployer contains the code to deploy EJBs given a classloader and a url location.
+ *
+ */
+public class Deployer {
+
+    private static final Log LOGGER = LogFactory.getLog(Deployer.class);
+
+    public void deploy(ClassLoader classLoader, String location) throws Exception {
+        Map<String, URL> descriptors = new ResourceFinder(null, classLoader).getResourcesMap("META-INF/");
+
+        URL ejbJarXmlUrl = descriptors.get("ejb-jar.xml");
+        if (ejbJarXmlUrl == null) {
+            return;
+        }
+        EjbJar ejbJar = ReadDescriptors.readEjbJar(ejbJarXmlUrl);
+        // create the EJB Module
+        EjbModule ejbModule = new EjbModule(classLoader, location, ejbJar, null);
+        ejbModule.getAltDDs().putAll(descriptors);
+
+        // load webservices descriptor
+        addWebservices(ejbModule);
+
+        // wrap the EJB Module with an Application Module
+        AppModule appModule = new AppModule(classLoader, ejbModule.getJarLocation());
+        appModule.getEjbModules().add(ejbModule);
+        ejbModule.setJarLocation(location);
+
+        // Persistence Units
+        addPersistenceUnits(appModule, classLoader);
+
+        // Create application
+        ConfigurationFactory configurationFactory = new ConfigurationFactory();
+        Assembler assembler = (Assembler) SystemInstance.get().getComponent(org.apache.openejb.spi.Assembler.class);
+        AppInfo appInfo = configurationFactory.configureApplication(appModule);
+        assembler.createApplication(appInfo, classLoader);
+    }
+
+    private Map<String, URL> getDescriptors(URL moduleUrl) throws OpenEJBException {
+        try {
+            ResourceFinder finder = new ResourceFinder(moduleUrl);
+            return finder.getResourcesMap("META-INF/");
+
+        } catch (IOException e) {
+            throw new OpenEJBException("Unable to determine descriptors in jar.", e);
+        }
+    }
+
+    private void addWebservices(WsModule wsModule) throws OpenEJBException {
+        // get location of webservices.xml file
+        Object webservicesObject = wsModule.getAltDDs().get("webservices.xml");
+        if (!(webservicesObject instanceof URL)) {
+            return;
+        }
+        URL webservicesUrl = (URL) webservicesObject;
+
+        // determine the base url for this module (either file: or jar:)
+        URL moduleUrl = null;
+        try {
+            File jarFile = new File(wsModule.getJarLocation());
+            moduleUrl = jarFile.toURL();
+            if (jarFile.isFile()) {
+                moduleUrl = new URL("jar", "", -1, moduleUrl + "!/");
+            }
+        } catch (MalformedURLException e) {
+            LOGGER.warn("Invalid module location " + wsModule.getJarLocation());
+            return;
+        }
+
+        // parse the webservices.xml file
+        Map<URL,JavaWsdlMapping> jaxrpcMappingCache = new HashMap<URL,JavaWsdlMapping>();
+        Webservices webservices = ReadDescriptors.readWebservices(webservicesUrl);
+        wsModule.setWebservices(webservices);
+        if (webservicesUrl != null && "file".equals(webservicesUrl.getProtocol())) {
+            wsModule.getWatchedResources().add(webservicesUrl.getPath());
+        }
+
+        // parse any jaxrpc-mapping-files mentioned in the webservices.xml file
+        for (WebserviceDescription webserviceDescription : webservices.getWebserviceDescription()) {
+            String jaxrpcMappingFile = webserviceDescription.getJaxrpcMappingFile();
+            if (jaxrpcMappingFile != null) {
+                URL jaxrpcMappingUrl = null;
+                try {
+                    jaxrpcMappingUrl = new URL(moduleUrl, jaxrpcMappingFile);
+                    JavaWsdlMapping jaxrpcMapping = jaxrpcMappingCache.get(jaxrpcMappingUrl);
+                    if (jaxrpcMapping == null) {
+                        jaxrpcMapping = ReadDescriptors.readJaxrpcMapping(jaxrpcMappingUrl);
+                        jaxrpcMappingCache.put(jaxrpcMappingUrl, jaxrpcMapping);
+                    }
+                    webserviceDescription.setJaxrpcMapping(jaxrpcMapping);
+                    if (jaxrpcMappingUrl != null && "file".equals(jaxrpcMappingUrl.getProtocol())) {
+                        wsModule.getWatchedResources().add(jaxrpcMappingUrl.getPath());
+                    }
+                } catch (MalformedURLException e) {
+                    LOGGER.warn("Invalid jaxrpc-mapping-file location " + jaxrpcMappingFile);
+                }
+            }
+        }
+
+    }
+
+    private void addPersistenceUnits(AppModule appModule, ClassLoader classLoader, URL... urls) {
+        try {
+            ResourceFinder finder = new ResourceFinder("", classLoader, urls);
+            List<URL> persistenceUrls = finder.findAll("META-INF/persistence.xml");
+            appModule.getAltDDs().put("persistence.xml", persistenceUrls);
+        } catch (IOException e) {
+            LOGGER.warn("Cannot load persistence-units from 'META-INF/persistence.xml' : " + e.getMessage(), e);
+        }
+    }
+
+}

Added: servicemix/branches/servicemix-4.0/openejb/src/main/java/org/apache/servicemix/openejb/OpenEjbFactory.java
URL: http://svn.apache.org/viewvc/servicemix/branches/servicemix-4.0/openejb/src/main/java/org/apache/servicemix/openejb/OpenEjbFactory.java?rev=596355&view=auto
==============================================================================
--- servicemix/branches/servicemix-4.0/openejb/src/main/java/org/apache/servicemix/openejb/OpenEjbFactory.java (added)
+++ servicemix/branches/servicemix-4.0/openejb/src/main/java/org/apache/servicemix/openejb/OpenEjbFactory.java Mon Nov 19 08:22:57 2007
@@ -0,0 +1,130 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.servicemix.openejb;
+
+import java.util.Properties;
+
+import javax.transaction.TransactionManager;
+
+import org.apache.openejb.OpenEJB;
+import org.apache.openejb.OpenEJBException;
+import org.apache.openejb.assembler.classic.Assembler;
+import org.apache.openejb.assembler.classic.SecurityServiceInfo;
+import org.apache.openejb.assembler.classic.TransactionServiceInfo;
+import org.apache.openejb.assembler.dynamic.PassthroughFactory;
+import org.apache.openejb.core.ServerFederation;
+import org.apache.openejb.loader.SystemInstance;
+import org.apache.openejb.ri.sp.PseudoSecurityService;
+import org.apache.openejb.server.ServiceManager;
+import org.apache.openejb.server.webservices.WsRegistry;
+import org.apache.openejb.spi.ApplicationServer;
+import org.apache.openejb.spi.ContainerSystem;
+import org.apache.openejb.spi.SecurityService;
+import org.apache.openejb.util.LogCategory;
+import org.apache.openejb.util.Logger;
+import org.apache.openejb.util.Messages;
+
+/**
+ * Factory for OpenEJB to intitialize everything.
+ *
+ */
+public class OpenEjbFactory {
+
+    private static Messages messages = new Messages("org.apache.openejb.util.resources");
+
+    private Properties properties;
+    private TransactionManager transactionManager;
+    private WsRegistry wsRegistry;
+    private SecurityService securityService;
+
+    public void setProperties(Properties properties) {
+        this.properties = properties;
+    }
+
+    public void setTransactionManager(TransactionManager transactionManager) {
+        this.transactionManager = transactionManager;
+    }
+
+    public void setWsRegistry(WsRegistry wsRegistry) {
+        this.wsRegistry = wsRegistry;
+    }
+
+    public void setSecurityService(SecurityService securityService) {
+        this.securityService = securityService;
+    }
+
+    public void init() throws Exception {
+        Logger logger = Logger.getInstance(LogCategory.OPENEJB_STARTUP, "org.apache.openejb.util.resources");
+
+        if (properties == null) {
+            properties = new Properties();
+        }
+
+        try {
+            SystemInstance.init(properties);
+        } catch (Exception e) {
+            throw new OpenEJBException(e);
+        }
+        SystemInstance system = SystemInstance.get();
+
+        ApplicationServer appServer = new ServerFederation();
+        system.setComponent(ApplicationServer.class, appServer);
+
+        Assembler assembler = new Assembler();
+        SystemInstance.get().setComponent(org.apache.openejb.spi.Assembler.class, assembler);
+
+        ContainerSystem containerSystem = assembler.getContainerSystem();
+        if (containerSystem == null) {
+            String msg = messages.message("startup.assemblerReturnedNullContainer");
+            logger.fatal(msg);
+            throw new OpenEJBException(msg);
+        }
+        system.setComponent(ContainerSystem.class, containerSystem);
+
+        if (securityService == null) {
+            securityService = new PseudoSecurityService();
+        }
+        if (securityService != null) {
+            SecurityServiceInfo securityServiceInfo = new SecurityServiceInfo();
+            PassthroughFactory.add(securityServiceInfo, securityService);
+            securityServiceInfo.id = "Default Security Service";
+            securityServiceInfo.service = "SecurityService";
+            assembler.createSecurityService(securityServiceInfo);
+            system.setComponent(SecurityService.class, securityService);
+        }
+
+        if (transactionManager != null) {
+            TransactionServiceInfo transactionServiceInfo = new TransactionServiceInfo();
+            PassthroughFactory.add(transactionServiceInfo, transactionManager);
+            transactionServiceInfo.id = "Default Transaction Manager";
+            transactionServiceInfo.service = "TransactionManager";
+            assembler.createTransactionManager(transactionServiceInfo);
+        }
+
+        if (wsRegistry != null) {
+            SystemInstance.get().setComponent(WsRegistry.class, wsRegistry);
+        }
+
+        ServiceManager.getManager().init();
+        ServiceManager.getManager().start(false);
+    }
+
+    public void destroy() throws Exception {
+        ServiceManager.getManager().stop();
+        OpenEJB.destroy();
+    }
+}

Added: servicemix/branches/servicemix-4.0/openejb/src/main/java/org/apache/servicemix/openejb/OsgiDeployer.java
URL: http://svn.apache.org/viewvc/servicemix/branches/servicemix-4.0/openejb/src/main/java/org/apache/servicemix/openejb/OsgiDeployer.java?rev=596355&view=auto
==============================================================================
--- servicemix/branches/servicemix-4.0/openejb/src/main/java/org/apache/servicemix/openejb/OsgiDeployer.java (added)
+++ servicemix/branches/servicemix-4.0/openejb/src/main/java/org/apache/servicemix/openejb/OsgiDeployer.java Mon Nov 19 08:22:57 2007
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.servicemix.openejb;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleEvent;
+import org.osgi.framework.BundleListener;
+import org.springframework.beans.factory.DisposableBean;
+import org.springframework.beans.factory.InitializingBean;
+import org.springframework.osgi.context.BundleContextAware;
+import org.springframework.osgi.internal.context.support.BundleDelegatingClassLoader;
+
+/**
+ * 
+ */
+public class OsgiDeployer implements BundleListener, BundleContextAware, InitializingBean, DisposableBean {
+
+    private static final Log LOGGER = LogFactory.getLog(OsgiDeployer.class);
+
+    private BundleContext context;
+    private Deployer deployer = new Deployer();
+
+    public void setBundleContext(BundleContext context) {
+        this.context = context;
+    }
+
+    public void afterPropertiesSet() throws Exception {
+        System.out.println("Registering EJB deployer bundle listener");
+        this.context.addBundleListener(this);
+    }
+
+    public void destroy() throws Exception {
+        this.context.removeBundleListener(this);
+    }
+
+    public void bundleChanged(BundleEvent event) {
+        try {
+            if (event.getType() == BundleEvent.INSTALLED) {
+                System.out.println("Checking bundle: " + event.getBundle().getSymbolicName());
+
+                ClassLoader classLoader = BundleDelegatingClassLoader.createBundleClassLoaderFor(
+                                                event.getBundle(), BundleContext.class.getClassLoader());
+                deployer.deploy(classLoader, event.getBundle().getLocation());
+            }
+        } catch (Exception e) {
+            LOGGER.error("Error handling bundle event", e);
+        }
+    }
+
+}
\ No newline at end of file

Added: servicemix/branches/servicemix-4.0/openejb/src/main/java/org/apache/servicemix/openejb/OsgiWsRegistry.java
URL: http://svn.apache.org/viewvc/servicemix/branches/servicemix-4.0/openejb/src/main/java/org/apache/servicemix/openejb/OsgiWsRegistry.java?rev=596355&view=auto
==============================================================================
--- servicemix/branches/servicemix-4.0/openejb/src/main/java/org/apache/servicemix/openejb/OsgiWsRegistry.java (added)
+++ servicemix/branches/servicemix-4.0/openejb/src/main/java/org/apache/servicemix/openejb/OsgiWsRegistry.java Mon Nov 19 08:22:57 2007
@@ -0,0 +1,50 @@
+package org.apache.servicemix.openejb;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.openejb.server.httpd.HttpListener;
+import org.apache.openejb.server.webservices.WsRegistry;
+import org.osgi.service.http.HttpService;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: gnodet
+ * Date: Nov 14, 2007
+ * Time: 11:59:12 PM
+ * To change this template use File | Settings | File Templates.
+ */
+public class OsgiWsRegistry implements WsRegistry {
+
+    private HttpService httpService;
+
+    public void setHttpService(HttpService httpService) {
+        this.httpService = httpService;
+    }
+
+    public List<String> setWsContainer(String virtualHost, String contextRoot, String servletName, HttpListener wsContainer) throws Exception {
+        System.err.println("setWsContainer");
+        return null;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public void clearWsContainer(String virtualHost, String contextRoot, String servletName) {
+        System.err.println("clearWsContainer");
+        //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public List<String> addWsContainer(String path, HttpListener httpListener, String virtualHost, String realmName, String transportGuarantee, String authMethod, ClassLoader classLoader) throws Exception {
+        if (path == null) throw new NullPointerException("contextRoot is null");
+        if (httpListener == null) throw new NullPointerException("httpListener is null");
+
+        // assure context root with a leading slash
+        if (!path.startsWith("/")) path = "/" + path;
+
+        httpService.registerServlet(path, new WsServlet(httpListener), null, httpService.createDefaultHttpContext());
+
+        return Arrays.asList("http://localhost" + path);  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public void removeWsContainer(String path) {
+        httpService.unregister(path);
+    }
+}



Mime
View raw message