Repository: tomee Updated Branches: refs/heads/master ce4c7ce45 -> 624f8961f
no need of simple osgi now we dont have karafee anymore Project: http://git-wip-us.apache.org/repos/asf/tomee/repo Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/624f8961 Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/624f8961 Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/624f8961 Branch: refs/heads/master Commit: 624f8961fe0d323060b97da396bf54b43d840938 Parents: ce4c7ce Author: Romain Manni-Bucau <rmannibu...@apache.org> Authored: Tue Mar 24 08:55:39 2015 +0100 Committer: Romain Manni-Bucau <rmannibu...@apache.org> Committed: Tue Mar 24 08:55:39 2015 +0100 ---------------------------------------------------------------------- examples/pom.xml | 1 - examples/simple-osgi/pom.xml | 136 ------------------- examples/simple-osgi/simple-osgi-api/pom.xml | 59 -------- .../osgi/calculator/CalculatorLocal.java | 35 ----- .../osgi/calculator/CalculatorRemote.java | 35 ----- .../simple-osgi-camel-client/pom.xml | 75 ---------- .../META-INF/spring/calculator-camel-ctx.xml | 41 ------ examples/simple-osgi/simple-osgi-core/pom.xml | 86 ------------ .../osgi/calculator/impl/CalculatorBean.java | 51 ------- .../superbiz/osgi/moviefun/AddInterceptor.java | 32 ----- .../org/superbiz/osgi/moviefun/Bootstrap.java | 41 ------ .../osgi/moviefun/DeleteInterceptor.java | 32 ----- .../java/org/superbiz/osgi/moviefun/Movie.java | 70 ---------- .../java/org/superbiz/osgi/moviefun/Movies.java | 53 -------- .../src/main/resources/META-INF/persistence.xml | 29 ---- .../simple-osgi-local-lookup-client/pom.xml | 58 -------- .../lookupclient/SingletonCalculatorClient.java | 65 --------- .../simple-osgi-remote-client/pom.xml | 84 ------------ .../superbiz/calculator/client/ClientUtil.java | 41 ------ .../client/RemoteClientActivator.java | 43 ------ .../calculator/client/RemoteClientMain.java | 29 ---- .../simple-osgi-service-injection/pom.xml | 56 -------- .../osgi/injection/service/Injected.java | 43 ------ .../simple-osgi/standard-ejbd-server/pom.xml | 78 ----------- .../java/org/superbiz/StandardEjbdServer.java | 51 ------- 25 files changed, 1324 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tomee/blob/624f8961/examples/pom.xml ---------------------------------------------------------------------- diff --git a/examples/pom.xml b/examples/pom.xml index a301731..560ddfd 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -123,7 +123,6 @@ <module>simple-mdb-and-cdi</module> <module>simple-mdb</module> <module>simple-mdb-with-descriptor</module> - <module>simple-osgi</module> <module>simple-rest</module> <module>simple-singleton</module> <module>simple-stateful</module> http://git-wip-us.apache.org/repos/asf/tomee/blob/624f8961/examples/simple-osgi/pom.xml ---------------------------------------------------------------------- diff --git a/examples/simple-osgi/pom.xml b/examples/simple-osgi/pom.xml deleted file mode 100644 index 64dfc47..0000000 --- a/examples/simple-osgi/pom.xml +++ /dev/null @@ -1,136 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - - 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. ---> - - -<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"> - <modelVersion>4.0.0</modelVersion> - <groupId>org.superbiz</groupId> - <artifactId>simple-osgi</artifactId> - <packaging>pom</packaging> - <version>1.1.0-SNAPSHOT</version> - <modules> - <module>simple-osgi-api</module> - <module>simple-osgi-core</module> - <module>simple-osgi-camel-client</module> - <module>simple-osgi-remote-client</module> - <module>simple-osgi-local-lookup-client</module> - <module>simple-osgi-service-injection</module> - <module>standard-ejbd-server</module> - </modules> - <name>OpenEJB :: Examples :: Simple OSGi Stateless Pojo</name> - <properties> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - </properties> - <build> - <defaultGoal>install</defaultGoal> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-install-plugin</artifactId> - <version>2.4</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <version>3.1</version> - <configuration> - <source>1.7</source> - <target>1.7</target> - </configuration> - </plugin> - </plugins> - <pluginManagement> - <plugins> - <plugin> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - <version>2.3.7</version> - <extensions>true</extensions> - </plugin> - </plugins> - </pluginManagement> - </build> - <repositories> - <repository> - <id>apache-m2-snapshot</id> - <name>Apache Snapshot Repository</name> - <url>https://repository.apache.org/content/groups/snapshots</url> - </repository> - </repositories> - <pluginRepositories> - <pluginRepository> - <id>apache-m2-snapshot</id> - <name>Apache Snapshot Repository</name> - <url>https://repository.apache.org/content/groups/snapshots</url> - </pluginRepository> - </pluginRepositories> - - <dependencyManagement> - <dependencies> - <dependency> - <groupId>org.apache.openejb</groupId> - <artifactId>javaee-api</artifactId> - <version>7.0-SNAPSHOT</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.11</version> - <scope>test</scope> - </dependency> - - <!-- - The <scope>test</scope> guarantees that non of your runtime - code is dependent on any OpenEJB classes. - --> - <dependency> - <groupId>org.apache.openejb</groupId> - <artifactId>openejb-core</artifactId> - <version>5.0.0-SNAPSHOT</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.apache.felix</groupId> - <artifactId>org.osgi.core</artifactId> - <version>1.0.0</version> - <scope>provided</scope> - </dependency> - </dependencies> - </dependencyManagement> - - <!-- - This section allows you to configure where to publish libraries for sharing. - It is not required and may be deleted. For more information see: - http://maven.apache.org/plugins/maven-deploy-plugin/ - --> - <distributionManagement> - <repository> - <id>localhost</id> - <url>file://${basedir}/target/repo/</url> - </repository> - <snapshotRepository> - <id>localhost</id> - <url>file://${basedir}/target/snapshot-repo/</url> - </snapshotRepository> - </distributionManagement> - -</project> - http://git-wip-us.apache.org/repos/asf/tomee/blob/624f8961/examples/simple-osgi/simple-osgi-api/pom.xml ---------------------------------------------------------------------- diff --git a/examples/simple-osgi/simple-osgi-api/pom.xml b/examples/simple-osgi/simple-osgi-api/pom.xml deleted file mode 100644 index 61ec1bc..0000000 --- a/examples/simple-osgi/simple-osgi-api/pom.xml +++ /dev/null @@ -1,59 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - - 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. ---> - - -<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"> - <modelVersion>4.0.0</modelVersion> - <parent> - <artifactId>simple-osgi</artifactId> - <groupId>org.superbiz</groupId> - <version>1.1.0-SNAPSHOT</version> - </parent> - - <artifactId>simple-osgi-api</artifactId> - <packaging>bundle</packaging> - <name>OpenEJB :: Examples :: Simple OSGi :: API bundle</name> - - <build> - <plugins> - <plugin> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - <configuration> - <instructions> - <Export-Package> - org.superbiz.osgi.calculator - </Export-Package> - <Import-Package>*</Import-Package> - </instructions> - </configuration> - </plugin> - </plugins> - </build> - - <dependencies> - <dependency> - <groupId>org.apache.openejb</groupId> - <artifactId>javaee-api</artifactId> - </dependency> - </dependencies> - - -</project> http://git-wip-us.apache.org/repos/asf/tomee/blob/624f8961/examples/simple-osgi/simple-osgi-api/src/main/java/org/superbiz/osgi/calculator/CalculatorLocal.java ---------------------------------------------------------------------- diff --git a/examples/simple-osgi/simple-osgi-api/src/main/java/org/superbiz/osgi/calculator/CalculatorLocal.java b/examples/simple-osgi/simple-osgi-api/src/main/java/org/superbiz/osgi/calculator/CalculatorLocal.java deleted file mode 100644 index 69a13a5..0000000 --- a/examples/simple-osgi/simple-osgi-api/src/main/java/org/superbiz/osgi/calculator/CalculatorLocal.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * 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.superbiz.osgi.calculator; - -import javax.ejb.Local; - -@Local -public interface CalculatorLocal { - - int add(int a, int b); - - int subtract(int a, int b); - - int multiply(int a, int b); - - int divide(int a, int b); - - int remainder(int a, int b); - - String sayHello(); -} http://git-wip-us.apache.org/repos/asf/tomee/blob/624f8961/examples/simple-osgi/simple-osgi-api/src/main/java/org/superbiz/osgi/calculator/CalculatorRemote.java ---------------------------------------------------------------------- diff --git a/examples/simple-osgi/simple-osgi-api/src/main/java/org/superbiz/osgi/calculator/CalculatorRemote.java b/examples/simple-osgi/simple-osgi-api/src/main/java/org/superbiz/osgi/calculator/CalculatorRemote.java deleted file mode 100644 index 8482f8b..0000000 --- a/examples/simple-osgi/simple-osgi-api/src/main/java/org/superbiz/osgi/calculator/CalculatorRemote.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * 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.superbiz.osgi.calculator; - -import javax.ejb.Remote; - -@Remote -public interface CalculatorRemote { - - int add(int a, int b); - - int subtract(int a, int b); - - int multiply(int a, int b); - - int divide(int a, int b); - - int remainder(int a, int b); - - String sayHello(); -} http://git-wip-us.apache.org/repos/asf/tomee/blob/624f8961/examples/simple-osgi/simple-osgi-camel-client/pom.xml ---------------------------------------------------------------------- diff --git a/examples/simple-osgi/simple-osgi-camel-client/pom.xml b/examples/simple-osgi/simple-osgi-camel-client/pom.xml deleted file mode 100644 index 77211f6..0000000 --- a/examples/simple-osgi/simple-osgi-camel-client/pom.xml +++ /dev/null @@ -1,75 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - - 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. ---> - - -<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"> - <modelVersion>4.0.0</modelVersion> - <parent> - <artifactId>simple-osgi</artifactId> - <groupId>org.superbiz</groupId> - <version>1.1.0-SNAPSHOT</version> - </parent> - - <artifactId>simple-osgi-camel-client</artifactId> - <packaging>bundle</packaging> - <name>OpenEJB :: Examples :: Simple OSGi :: Camel Client</name> - - <build> - <plugins> - <plugin> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - <configuration> - <instructions> - <Import-Package> - javax.ejb, - org.superbiz.osgi.calculator, - org.apache.openejb.client;version="[4.0,5.0)" - </Import-Package> - <Include-Resource>${pom.basedir}/src/main/resources</Include-Resource> - </instructions> - </configuration> - </plugin> - </plugins> - </build> - - <dependencies> - <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>simple-osgi-api</artifactId> - <version>${project.version}</version> - </dependency> - - <!-- just to keep in mind camel and spring should be installed --> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-core</artifactId> - <version>2.8.3</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-core</artifactId> - <version>3.0.3.RELEASE</version> - <scope>provided</scope> - </dependency> - </dependencies> - -</project> http://git-wip-us.apache.org/repos/asf/tomee/blob/624f8961/examples/simple-osgi/simple-osgi-camel-client/src/main/resources/META-INF/spring/calculator-camel-ctx.xml ---------------------------------------------------------------------- diff --git a/examples/simple-osgi/simple-osgi-camel-client/src/main/resources/META-INF/spring/calculator-camel-ctx.xml b/examples/simple-osgi/simple-osgi-camel-client/src/main/resources/META-INF/spring/calculator-camel-ctx.xml deleted file mode 100644 index 0e082ea..0000000 --- a/examples/simple-osgi/simple-osgi-camel-client/src/main/resources/META-INF/spring/calculator-camel-ctx.xml +++ /dev/null @@ -1,41 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - - 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. ---> - -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:camel="http://camel.apache.org/schema/spring" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd - http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring-2.8.3.xsd"> - - <camel:camelContext id="helloContext"> - <camel:route id="TimerHelloRoute"> - <camel:from uri="timer://helloTimer?fixedRate=true&period=2000"/> - <camel:delay> - <camel:constant>1000</camel:constant> - </camel:delay> - <camel:log message="%%% Say Hello"/> - </camel:route> - </camel:camelContext> - - <camel:camelContext id="calcRoute"> - <camel:route id="TimerCalcRoute"> - <camel:from uri="timer://calcTimer?fixedRate=true&period=5000"/> - <camel:to uri="bean:org.superbiz.osgi.calculator.CalculatorRemote?method=sayHello"/> - <camel:log message=">>> Result : ${body}"/> - </camel:route> - </camel:camelContext> -</beans> http://git-wip-us.apache.org/repos/asf/tomee/blob/624f8961/examples/simple-osgi/simple-osgi-core/pom.xml ---------------------------------------------------------------------- diff --git a/examples/simple-osgi/simple-osgi-core/pom.xml b/examples/simple-osgi/simple-osgi-core/pom.xml deleted file mode 100644 index 24891b1..0000000 --- a/examples/simple-osgi/simple-osgi-core/pom.xml +++ /dev/null @@ -1,86 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - - 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. ---> - - -<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"> - <modelVersion>4.0.0</modelVersion> - <parent> - <artifactId>simple-osgi</artifactId> - <groupId>org.superbiz</groupId> - <version>1.1.0-SNAPSHOT</version> - </parent> - - <artifactId>simple-osgi-core</artifactId> - <packaging>bundle</packaging> - <name>OpenEJB :: Examples :: Simple OSGi Stateless Pojo :: Core bundle</name> - - <build> - <plugins> - <plugin> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - <configuration> - <instructions> - <Import-Package>*</Import-Package> - </instructions> - </configuration> - </plugin> - <plugin> <!-- needed otherwise it will not work at runtime --> - <groupId>org.apache.openjpa</groupId> - <artifactId>openjpa-maven-plugin</artifactId> - <version>2.3.0</version> - <configuration> - <includes>org/superbiz/osgi/moviefun/Movie.class</includes> - <addDefaultConstructor>true</addDefaultConstructor> - <enforcePropertyRestrictions>true</enforcePropertyRestrictions> - </configuration> - <executions> - <execution> - <id>enhancer</id> - <phase>process-classes</phase> - <goals> - <goal>enhance</goal> - </goals> - </execution> - </executions> - <dependencies> - <dependency> - <groupId>org.apache.openjpa</groupId> - <artifactId>openjpa</artifactId> - <version>2.3.0</version> - </dependency> - </dependencies> - </plugin> - </plugins> - </build> - - <dependencies> - <dependency> - <groupId>org.apache.openejb</groupId> - <artifactId>javaee-api</artifactId> - </dependency> - <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>simple-osgi-api</artifactId> - <version>${project.version}</version> - </dependency> - </dependencies> - -</project> http://git-wip-us.apache.org/repos/asf/tomee/blob/624f8961/examples/simple-osgi/simple-osgi-core/src/main/java/org/superbiz/osgi/calculator/impl/CalculatorBean.java ---------------------------------------------------------------------- diff --git a/examples/simple-osgi/simple-osgi-core/src/main/java/org/superbiz/osgi/calculator/impl/CalculatorBean.java b/examples/simple-osgi/simple-osgi-core/src/main/java/org/superbiz/osgi/calculator/impl/CalculatorBean.java deleted file mode 100644 index 4b5fefd..0000000 --- a/examples/simple-osgi/simple-osgi-core/src/main/java/org/superbiz/osgi/calculator/impl/CalculatorBean.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * 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.superbiz.osgi.calculator.impl; - -import org.superbiz.osgi.calculator.CalculatorLocal; -import org.superbiz.osgi.calculator.CalculatorRemote; - -import javax.ejb.Stateless; - -@Stateless -public class CalculatorBean implements CalculatorLocal, CalculatorRemote { - - public int add(int a, int b) { - return a + b; - } - - public int subtract(int a, int b) { - return a - b; - } - - public int multiply(int a, int b) { - return a * b; - } - - public int divide(int a, int b) { - return a / b; - } - - public int remainder(int a, int b) { - return a % b; - } - - public String sayHello() { - return "Hello World!"; - } - -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tomee/blob/624f8961/examples/simple-osgi/simple-osgi-core/src/main/java/org/superbiz/osgi/moviefun/AddInterceptor.java ---------------------------------------------------------------------- diff --git a/examples/simple-osgi/simple-osgi-core/src/main/java/org/superbiz/osgi/moviefun/AddInterceptor.java b/examples/simple-osgi/simple-osgi-core/src/main/java/org/superbiz/osgi/moviefun/AddInterceptor.java deleted file mode 100644 index a7d74e3..0000000 --- a/examples/simple-osgi/simple-osgi-core/src/main/java/org/superbiz/osgi/moviefun/AddInterceptor.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * 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.superbiz.osgi.moviefun; - -import javax.interceptor.AroundInvoke; -import javax.interceptor.InvocationContext; - -/** - * @version $Revision$ $Date$ - */ -public class AddInterceptor { - - @AroundInvoke - public Object invoke(InvocationContext context) throws Exception { - // Log Add - return context.proceed(); - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tomee/blob/624f8961/examples/simple-osgi/simple-osgi-core/src/main/java/org/superbiz/osgi/moviefun/Bootstrap.java ---------------------------------------------------------------------- diff --git a/examples/simple-osgi/simple-osgi-core/src/main/java/org/superbiz/osgi/moviefun/Bootstrap.java b/examples/simple-osgi/simple-osgi-core/src/main/java/org/superbiz/osgi/moviefun/Bootstrap.java deleted file mode 100644 index 5b16089..0000000 --- a/examples/simple-osgi/simple-osgi-core/src/main/java/org/superbiz/osgi/moviefun/Bootstrap.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * 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.superbiz.osgi.moviefun; - -import javax.annotation.PostConstruct; -import javax.ejb.EJB; -import javax.ejb.Singleton; -import javax.ejb.Startup; - -@Singleton -@Startup -public class Bootstrap { - - @EJB - private Movies movies; - - @PostConstruct - public void init() { - try { - movies.addMovie(new Movie("OpenEJB", "OpenEJB in OSGi", 2011)); - System.out.println("found " + movies.getMovies().size() + " movies."); - } catch (Exception e) { - System.out.println("exception: " + e.getMessage()); - } - } -} http://git-wip-us.apache.org/repos/asf/tomee/blob/624f8961/examples/simple-osgi/simple-osgi-core/src/main/java/org/superbiz/osgi/moviefun/DeleteInterceptor.java ---------------------------------------------------------------------- diff --git a/examples/simple-osgi/simple-osgi-core/src/main/java/org/superbiz/osgi/moviefun/DeleteInterceptor.java b/examples/simple-osgi/simple-osgi-core/src/main/java/org/superbiz/osgi/moviefun/DeleteInterceptor.java deleted file mode 100644 index 20e7e22..0000000 --- a/examples/simple-osgi/simple-osgi-core/src/main/java/org/superbiz/osgi/moviefun/DeleteInterceptor.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * 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.superbiz.osgi.moviefun; - -import javax.interceptor.AroundInvoke; -import javax.interceptor.InvocationContext; - -/** - * @version $Revision$ $Date$ - */ -public class DeleteInterceptor { - - @AroundInvoke - public Object invoke(InvocationContext context) throws Exception { - // Log Delete - return context.proceed(); - } -} http://git-wip-us.apache.org/repos/asf/tomee/blob/624f8961/examples/simple-osgi/simple-osgi-core/src/main/java/org/superbiz/osgi/moviefun/Movie.java ---------------------------------------------------------------------- diff --git a/examples/simple-osgi/simple-osgi-core/src/main/java/org/superbiz/osgi/moviefun/Movie.java b/examples/simple-osgi/simple-osgi-core/src/main/java/org/superbiz/osgi/moviefun/Movie.java deleted file mode 100644 index a94c918..0000000 --- a/examples/simple-osgi/simple-osgi-core/src/main/java/org/superbiz/osgi/moviefun/Movie.java +++ /dev/null @@ -1,70 +0,0 @@ -/** - * 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.superbiz.osgi.moviefun; - -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; - -@Entity -public class Movie { - - @Id - @GeneratedValue - private long id; - private String director; - private String title; - private int year; - - public Movie() { - } - - public Movie(String director, String title, int year) { - this.director = director; - this.title = title; - this.year = year; - } - - public long getId() { - return id; - } - - public String getDirector() { - return director; - } - - public void setDirector(String director) { - this.director = director; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public int getYear() { - return year; - } - - public void setYear(int year) { - this.year = year; - } - -} http://git-wip-us.apache.org/repos/asf/tomee/blob/624f8961/examples/simple-osgi/simple-osgi-core/src/main/java/org/superbiz/osgi/moviefun/Movies.java ---------------------------------------------------------------------- diff --git a/examples/simple-osgi/simple-osgi-core/src/main/java/org/superbiz/osgi/moviefun/Movies.java b/examples/simple-osgi/simple-osgi-core/src/main/java/org/superbiz/osgi/moviefun/Movies.java deleted file mode 100644 index b4f448a..0000000 --- a/examples/simple-osgi/simple-osgi-core/src/main/java/org/superbiz/osgi/moviefun/Movies.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * 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.superbiz.osgi.moviefun; - -import javax.annotation.security.PermitAll; -import javax.ejb.Stateless; -import javax.ejb.TransactionAttribute; -import javax.ejb.TransactionAttributeType; -import javax.interceptor.Interceptors; -import javax.persistence.EntityManager; -import javax.persistence.PersistenceContext; -import javax.persistence.Query; -import java.util.List; - -//START SNIPPET: code -@Stateless -public class Movies { - - @PersistenceContext(unitName = "movie-unit") - private EntityManager entityManager; - - @Interceptors(AddInterceptor.class) - public void addMovie(Movie movie) throws Exception { - entityManager.persist(movie); - } - - @Interceptors(DeleteInterceptor.class) - public void deleteMovie(Movie movie) throws Exception { - entityManager.remove(movie); - } - - @PermitAll - @TransactionAttribute(TransactionAttributeType.SUPPORTS) - public List<Movie> getMovies() throws Exception { - Query query = entityManager.createQuery("SELECT m from Movie as m"); - return query.getResultList(); - } -} -//END SNIPPET: code http://git-wip-us.apache.org/repos/asf/tomee/blob/624f8961/examples/simple-osgi/simple-osgi-core/src/main/resources/META-INF/persistence.xml ---------------------------------------------------------------------- diff --git a/examples/simple-osgi/simple-osgi-core/src/main/resources/META-INF/persistence.xml b/examples/simple-osgi/simple-osgi-core/src/main/resources/META-INF/persistence.xml deleted file mode 100644 index 4ca5ff7..0000000 --- a/examples/simple-osgi/simple-osgi-core/src/main/resources/META-INF/persistence.xml +++ /dev/null @@ -1,29 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - - 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. ---> -<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0"> - - <persistence-unit name="movie-unit"> - <jta-data-source>movieDatabase</jta-data-source> - <non-jta-data-source>movieDatabaseUnmanaged</non-jta-data-source> - <class>org.superbiz.osgi.moviefun.Movie</class> - <properties> - <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)"/> - </properties> - </persistence-unit> -</persistence> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tomee/blob/624f8961/examples/simple-osgi/simple-osgi-local-lookup-client/pom.xml ---------------------------------------------------------------------- diff --git a/examples/simple-osgi/simple-osgi-local-lookup-client/pom.xml b/examples/simple-osgi/simple-osgi-local-lookup-client/pom.xml deleted file mode 100644 index b71a6bc..0000000 --- a/examples/simple-osgi/simple-osgi-local-lookup-client/pom.xml +++ /dev/null @@ -1,58 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - - 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. ---> -<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/xsd/maven-4.0.0.xsd"> - <parent> - <artifactId>simple-osgi</artifactId> - <groupId>org.superbiz</groupId> - <version>1.1.0-SNAPSHOT</version> - </parent> - <modelVersion>4.0.0</modelVersion> - - <artifactId>simple-osgi-local-lookup-client</artifactId> - <name>OpenEJB :: Examples :: Simple OSGi :: Local Lookup Client</name> - <packaging>bundle</packaging> - - <dependencies> - <!-- using scope compile to simplify the exec plugin usage --> - <dependency> - <groupId>org.apache.openejb</groupId> - <artifactId>javaee-api</artifactId> - </dependency> - <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>simple-osgi-api</artifactId> - <version>${project.version}</version> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - <configuration> - <instructions> - <Import-Package>*</Import-Package> - </instructions> - </configuration> - </plugin> - </plugins> - </build> -</project> http://git-wip-us.apache.org/repos/asf/tomee/blob/624f8961/examples/simple-osgi/simple-osgi-local-lookup-client/src/main/java/org/superbiz/calculator/lookupclient/SingletonCalculatorClient.java ---------------------------------------------------------------------- diff --git a/examples/simple-osgi/simple-osgi-local-lookup-client/src/main/java/org/superbiz/calculator/lookupclient/SingletonCalculatorClient.java b/examples/simple-osgi/simple-osgi-local-lookup-client/src/main/java/org/superbiz/calculator/lookupclient/SingletonCalculatorClient.java deleted file mode 100644 index c319c48..0000000 --- a/examples/simple-osgi/simple-osgi-local-lookup-client/src/main/java/org/superbiz/calculator/lookupclient/SingletonCalculatorClient.java +++ /dev/null @@ -1,65 +0,0 @@ -/** - * 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.superbiz.calculator.lookupclient; - -import org.superbiz.osgi.calculator.CalculatorLocal; - -import javax.annotation.PostConstruct; -import javax.ejb.EJB; -import javax.ejb.Singleton; -import javax.ejb.Startup; -import javax.naming.Context; -import javax.naming.InitialContext; -import javax.naming.NamingException; -import java.util.Properties; - -@Singleton -@Startup -public class SingletonCalculatorClient { - - @EJB - private CalculatorLocal calculator; - - @PostConstruct - public void logInit() { - System.out.println(); - checkCalculator(); - tryLookup(); - System.out.println(); - } - - private void tryLookup() { - Properties p = new Properties(); - p.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory"); - try { - Context ctx = new InitialContext(p); - CalculatorLocal local = (CalculatorLocal) ctx.lookup("CalculatorBeanLocal"); - System.out.println("lookup OK: " + local.sayHello()); - } catch (NamingException e) { - System.out.println("can't lookup bean: " + e.getMessage()); - } - } - - private void checkCalculator() { - if (calculator == null) { - System.out.println(calculator + " is null -> FAILED!"); - } else { - System.out.println("calculator OK: " + calculator.sayHello()); - } - } -} http://git-wip-us.apache.org/repos/asf/tomee/blob/624f8961/examples/simple-osgi/simple-osgi-remote-client/pom.xml ---------------------------------------------------------------------- diff --git a/examples/simple-osgi/simple-osgi-remote-client/pom.xml b/examples/simple-osgi/simple-osgi-remote-client/pom.xml deleted file mode 100644 index 07e973c..0000000 --- a/examples/simple-osgi/simple-osgi-remote-client/pom.xml +++ /dev/null @@ -1,84 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - - 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. ---> -<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/xsd/maven-4.0.0.xsd"> - <parent> - <artifactId>simple-osgi</artifactId> - <groupId>org.superbiz</groupId> - <version>1.1.0-SNAPSHOT</version> - </parent> - <modelVersion>4.0.0</modelVersion> - - <artifactId>simple-osgi-remote-client</artifactId> - <name>OpenEJB :: Examples :: Simple OSGi :: Remote Client</name> - <packaging>bundle</packaging> - - <dependencies> - <!-- using scope compile to simplify the exec plugin usage --> - <dependency> - <groupId>org.apache.openejb</groupId> - <artifactId>javaee-api</artifactId> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>org.apache.openejb</groupId> - <artifactId>openejb-client</artifactId> - <version>5.0.0-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>simple-osgi-api</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.apache.felix</groupId> - <artifactId>org.osgi.core</artifactId> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>exec-maven-plugin</artifactId> - <version>1.2.1</version> - <executions> - <execution> - <goals> - <goal>java</goal> - </goals> - </execution> - </executions> - <configuration> - <mainClass>org.superbiz.calculator.client.RemoteClientMain</mainClass> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - <configuration> - <instructions> - <Import-Package>*</Import-Package> - <Bundle-Activator>org.superbiz.calculator.client.RemoteClientActivator</Bundle-Activator> - </instructions> - </configuration> - </plugin> - </plugins> - </build> -</project> http://git-wip-us.apache.org/repos/asf/tomee/blob/624f8961/examples/simple-osgi/simple-osgi-remote-client/src/main/java/org/superbiz/calculator/client/ClientUtil.java ---------------------------------------------------------------------- diff --git a/examples/simple-osgi/simple-osgi-remote-client/src/main/java/org/superbiz/calculator/client/ClientUtil.java b/examples/simple-osgi/simple-osgi-remote-client/src/main/java/org/superbiz/calculator/client/ClientUtil.java deleted file mode 100644 index 5dbc288..0000000 --- a/examples/simple-osgi/simple-osgi-remote-client/src/main/java/org/superbiz/calculator/client/ClientUtil.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * 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.superbiz.calculator.client; - -import org.apache.openejb.client.RemoteInitialContextFactory; -import org.superbiz.osgi.calculator.CalculatorRemote; - -import javax.naming.Context; -import javax.naming.InitialContext; -import java.util.Properties; - -public final class ClientUtil { - - private ClientUtil() { - // no-op - } - - public static void invoke() throws Exception { - final Properties properties = new Properties(); - properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, RemoteInitialContextFactory.class.getName()); - properties.setProperty(Context.PROVIDER_URL, "ejbd://localhost:4201"); - Context remoteContext = new InitialContext(properties); - CalculatorRemote calculator = (CalculatorRemote) remoteContext.lookup("CalculatorBeanRemote"); - System.out.println("Server answered: " + calculator.sayHello()); - } -} http://git-wip-us.apache.org/repos/asf/tomee/blob/624f8961/examples/simple-osgi/simple-osgi-remote-client/src/main/java/org/superbiz/calculator/client/RemoteClientActivator.java ---------------------------------------------------------------------- diff --git a/examples/simple-osgi/simple-osgi-remote-client/src/main/java/org/superbiz/calculator/client/RemoteClientActivator.java b/examples/simple-osgi/simple-osgi-remote-client/src/main/java/org/superbiz/calculator/client/RemoteClientActivator.java deleted file mode 100644 index 2edb1b2..0000000 --- a/examples/simple-osgi/simple-osgi-remote-client/src/main/java/org/superbiz/calculator/client/RemoteClientActivator.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * 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.superbiz.calculator.client; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - -public class RemoteClientActivator implements BundleActivator { - - @Override - public void start(BundleContext bundleContext) throws Exception { - final ClassLoader oldCl = Thread.currentThread().getContextClassLoader(); - // set the bundle classloader to avoid to go back to AppClassloader and not found imported classes - Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); - try { - ClientUtil.invoke(); - } catch (Exception e) { - System.out.println("error: " + e.getMessage()); - } finally { - Thread.currentThread().setContextClassLoader(oldCl); - } - } - - @Override - public void stop(BundleContext bundleContext) throws Exception { - // no-op - } -} http://git-wip-us.apache.org/repos/asf/tomee/blob/624f8961/examples/simple-osgi/simple-osgi-remote-client/src/main/java/org/superbiz/calculator/client/RemoteClientMain.java ---------------------------------------------------------------------- diff --git a/examples/simple-osgi/simple-osgi-remote-client/src/main/java/org/superbiz/calculator/client/RemoteClientMain.java b/examples/simple-osgi/simple-osgi-remote-client/src/main/java/org/superbiz/calculator/client/RemoteClientMain.java deleted file mode 100644 index 0fa148c..0000000 --- a/examples/simple-osgi/simple-osgi-remote-client/src/main/java/org/superbiz/calculator/client/RemoteClientMain.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * 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.superbiz.calculator.client; - -public final class RemoteClientMain { - - private RemoteClientMain() { - // no-op - } - - public static void main(String[] args) throws Exception { - ClientUtil.invoke(); - } -} http://git-wip-us.apache.org/repos/asf/tomee/blob/624f8961/examples/simple-osgi/simple-osgi-service-injection/pom.xml ---------------------------------------------------------------------- diff --git a/examples/simple-osgi/simple-osgi-service-injection/pom.xml b/examples/simple-osgi/simple-osgi-service-injection/pom.xml deleted file mode 100644 index 3491e13..0000000 --- a/examples/simple-osgi/simple-osgi-service-injection/pom.xml +++ /dev/null @@ -1,56 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - - 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. ---> -<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/xsd/maven-4.0.0.xsd"> - <parent> - <artifactId>simple-osgi</artifactId> - <groupId>org.superbiz</groupId> - <version>1.1.0-SNAPSHOT</version> - </parent> - <modelVersion>4.0.0</modelVersion> - - <artifactId>simple-osgi-service-injection</artifactId> - <name>OpenEJB :: Examples :: Simple OSGi :: OSGi Service Injection</name> - <packaging>bundle</packaging> - - <dependencies> - <dependency> - <groupId>org.apache.openejb</groupId> - <artifactId>javaee-api</artifactId> - </dependency> - <dependency> - <groupId>org.apache.felix</groupId> - <artifactId>org.osgi.core</artifactId> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - <configuration> - <instructions> - <Import-Package>*</Import-Package> - </instructions> - </configuration> - </plugin> - </plugins> - </build> -</project> http://git-wip-us.apache.org/repos/asf/tomee/blob/624f8961/examples/simple-osgi/simple-osgi-service-injection/src/main/java/org/superbiz/osgi/injection/service/Injected.java ---------------------------------------------------------------------- diff --git a/examples/simple-osgi/simple-osgi-service-injection/src/main/java/org/superbiz/osgi/injection/service/Injected.java b/examples/simple-osgi/simple-osgi-service-injection/src/main/java/org/superbiz/osgi/injection/service/Injected.java deleted file mode 100644 index 39233b3..0000000 --- a/examples/simple-osgi/simple-osgi-service-injection/src/main/java/org/superbiz/osgi/injection/service/Injected.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * 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.superbiz.osgi.injection.service; - -import org.osgi.service.startlevel.StartLevel; - -import javax.annotation.PostConstruct; -import javax.ejb.Singleton; -import javax.ejb.Startup; -import javax.inject.Inject; - -@Singleton -@Startup -public class Injected { - - @Inject - private StartLevel sl; - - @PostConstruct - public void init() { - System.out.println(); - if (sl != null) { - System.out.println("start level is " + sl.getStartLevel()); - } else { - System.out.println("start level is null -> FAILED"); - } - } -} http://git-wip-us.apache.org/repos/asf/tomee/blob/624f8961/examples/simple-osgi/standard-ejbd-server/pom.xml ---------------------------------------------------------------------- diff --git a/examples/simple-osgi/standard-ejbd-server/pom.xml b/examples/simple-osgi/standard-ejbd-server/pom.xml deleted file mode 100644 index b48cb62..0000000 --- a/examples/simple-osgi/standard-ejbd-server/pom.xml +++ /dev/null @@ -1,78 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - - 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. ---> -<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/xsd/maven-4.0.0.xsd"> - <parent> - <artifactId>simple-osgi</artifactId> - <groupId>org.superbiz</groupId> - <version>1.1.0-SNAPSHOT</version> - </parent> - <modelVersion>4.0.0</modelVersion> - - <artifactId>standard-ejbd-server</artifactId> - <name>OpenEJB :: Examples :: Simple OSGi :: Standard Server</name> - - <dependencies> - <dependency> - <groupId>org.apache.openejb</groupId> - <artifactId>javaee-api</artifactId> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>org.apache.openejb</groupId> - <artifactId>openejb-core</artifactId> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>org.apache.openejb</groupId> - <artifactId>openejb-ejbd</artifactId> - <version>5.0.0-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>simple-osgi-api</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>simple-osgi-core</artifactId> - <version>${project.version}</version> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>exec-maven-plugin</artifactId> - <version>1.2.1</version> - <executions> - <execution> - <goals> - <goal>java</goal> - </goals> - </execution> - </executions> - <configuration> - <mainClass>org.superbiz.StandardEjbdServer</mainClass> - </configuration> - </plugin> - </plugins> - </build> -</project> http://git-wip-us.apache.org/repos/asf/tomee/blob/624f8961/examples/simple-osgi/standard-ejbd-server/src/main/java/org/superbiz/StandardEjbdServer.java ---------------------------------------------------------------------- diff --git a/examples/simple-osgi/standard-ejbd-server/src/main/java/org/superbiz/StandardEjbdServer.java b/examples/simple-osgi/standard-ejbd-server/src/main/java/org/superbiz/StandardEjbdServer.java deleted file mode 100644 index 00b8c95..0000000 --- a/examples/simple-osgi/standard-ejbd-server/src/main/java/org/superbiz/StandardEjbdServer.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * 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.superbiz; - -import org.apache.openejb.OpenEjbContainer; -import org.apache.openejb.core.LocalInitialContextFactory; - -import javax.ejb.embeddable.EJBContainer; -import javax.naming.Context; -import java.util.Properties; -import java.util.concurrent.CountDownLatch; - -public final class StandardEjbdServer { - - private StandardEjbdServer() { - // no-op - } - - public static void main(String[] args) throws Exception { - final Properties properties = new Properties(); - properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, LocalInitialContextFactory.class.getName()); - properties.setProperty(OpenEjbContainer.OPENEJB_EMBEDDED_REMOTABLE, Boolean.TRUE.toString()); - final EJBContainer container = EJBContainer.createEJBContainer(properties); - final CountDownLatch latch = new CountDownLatch(1); - - Runtime.getRuntime().addShutdownHook(new Thread() { - @Override - public void run() { - latch.countDown(); - container.close(); - } - }); - - latch.await(); - } -}