Introduce Server OSGi
authorMathieu Baudier <mbaudier@argeo.org>
Fri, 18 Sep 2009 15:26:52 +0000 (15:26 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Fri, 18 Sep 2009 15:26:52 +0000 (15:26 +0000)
git-svn-id: https://svn.argeo.org/commons/trunk@2968 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

12 files changed:
server/demo/org.argeo.server.osgi.monitor/WEB-INF/applicationContext.xml [new file with mode: 0644]
server/demo/org.argeo.server.osgi.monitor/WEB-INF/osgi-servlet.xml [new file with mode: 0644]
server/demo/org.argeo.server.osgi.monitor/WEB-INF/osgi.xml [new file with mode: 0644]
server/demo/org.argeo.server.osgi.monitor/WEB-INF/web.xml [new file with mode: 0644]
server/runtime/org.argeo.server.osgi/.classpath [new file with mode: 0644]
server/runtime/org.argeo.server.osgi/.project [new file with mode: 0644]
server/runtime/org.argeo.server.osgi/.settings/org.eclipse.jdt.core.prefs [new file with mode: 0644]
server/runtime/org.argeo.server.osgi/.settings/org.maven.ide.eclipse.prefs [new file with mode: 0644]
server/runtime/org.argeo.server.osgi/pom.xml
server/runtime/org.argeo.server.osgi/src/main/java/org/argeo/server/osgi/mvc/ListBundlesController.java [new file with mode: 0644]
server/runtime/org.argeo.server.osgi/target/classes/META-INF/MANIFEST.MF [new file with mode: 0644]
server/runtime/org.argeo.server.osgi/target/classes/org/argeo/server/osgi/mvc/ListBundlesController.class [new file with mode: 0644]

diff --git a/server/demo/org.argeo.server.osgi.monitor/WEB-INF/applicationContext.xml b/server/demo/org.argeo.server.osgi.monitor/WEB-INF/applicationContext.xml
new file mode 100644 (file)
index 0000000..3d66217
--- /dev/null
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
+       xmlns:tx="http://www.springframework.org/schema/tx"
+       xsi:schemaLocation="
+       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+       http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
+       http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
+
+       <import resource="osgi.xml" />
+
+       <!--  Properties -->
+       <bean
+               class="org.springframework.web.context.support.ServletContextPropertyPlaceholderConfigurer"
+               lazy-init="false">
+               <property name="contextOverride" value="true" />
+               <property name="ignoreUnresolvablePlaceholders" value="true" />
+       </bean>
+</beans>
\ No newline at end of file
diff --git a/server/demo/org.argeo.server.osgi.monitor/WEB-INF/osgi-servlet.xml b/server/demo/org.argeo.server.osgi.monitor/WEB-INF/osgi-servlet.xml
new file mode 100644 (file)
index 0000000..0fcb08b
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xsi:schemaLocation="
+       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd 
+       http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
+       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">
+
+
+</beans>
\ No newline at end of file
diff --git a/server/demo/org.argeo.server.osgi.monitor/WEB-INF/osgi.xml b/server/demo/org.argeo.server.osgi.monitor/WEB-INF/osgi.xml
new file mode 100644 (file)
index 0000000..1b46c0e
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<beans:beans xmlns="http://www.springframework.org/schema/osgi"\r
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"\r
+       xsi:schemaLocation="http://www.springframework.org/schema/osgi  \r
+       http://www.springframework.org/schema/osgi/spring-osgi-1.1.xsd\r
+       http://www.springframework.org/schema/beans   \r
+       http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">\r
+\r
+</beans:beans>
\ No newline at end of file
diff --git a/server/demo/org.argeo.server.osgi.monitor/WEB-INF/web.xml b/server/demo/org.argeo.server.osgi.monitor/WEB-INF/web.xml
new file mode 100644 (file)
index 0000000..8308a4e
--- /dev/null
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+       version="2.5">
+
+       <display-name>Argeo Server OSGi Monitor</display-name>
+
+       <!-- OSGI servlet -->
+       <servlet>
+               <servlet-name>osgi</servlet-name>
+               <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
+               <init-param>
+                       <param-name>contextClass</param-name>
+                       <param-value>org.springframework.osgi.web.context.support.OsgiBundleXmlWebApplicationContext</param-value>
+               </init-param>
+               <load-on-startup>1</load-on-startup>
+       </servlet>
+       <servlet-mapping>
+               <servlet-name>osgi</servlet-name>
+               <url-pattern>*.osgi</url-pattern>
+       </servlet-mapping>
+
+       <!-- General -->
+       <context-param>
+               <param-name>contextConfigLocation</param-name>
+               <param-value>/WEB-INF/applicationContext.xml</param-value>
+       </context-param>
+
+       <listener>
+               <display-name>Spring Context</display-name>
+               <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
+       </listener>
+       <context-param>
+               <param-name>contextClass</param-name>
+               <param-value>org.springframework.osgi.web.context.support.OsgiBundleXmlWebApplicationContext</param-value>
+       </context-param>
+</web-app>
diff --git a/server/runtime/org.argeo.server.osgi/.classpath b/server/runtime/org.argeo.server.osgi/.classpath
new file mode 100644 (file)
index 0000000..16f01e2
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
diff --git a/server/runtime/org.argeo.server.osgi/.project b/server/runtime/org.argeo.server.osgi/.project
new file mode 100644 (file)
index 0000000..870b018
--- /dev/null
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.argeo.server.osgi</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.jdt.core.javabuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.maven.ide.eclipse.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.maven.ide.eclipse.maven2Nature</nature>
+               <nature>org.eclipse.jdt.core.javanature</nature>
+       </natures>
+</projectDescription>
diff --git a/server/runtime/org.argeo.server.osgi/.settings/org.eclipse.jdt.core.prefs b/server/runtime/org.argeo.server.osgi/.settings/org.eclipse.jdt.core.prefs
new file mode 100644 (file)
index 0000000..9b5500f
--- /dev/null
@@ -0,0 +1,5 @@
+#Fri Sep 18 17:19:37 CEST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/server/runtime/org.argeo.server.osgi/.settings/org.maven.ide.eclipse.prefs b/server/runtime/org.argeo.server.osgi/.settings/org.maven.ide.eclipse.prefs
new file mode 100644 (file)
index 0000000..60b2b57
--- /dev/null
@@ -0,0 +1,9 @@
+#Fri Sep 18 17:19:36 CEST 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1
index f9bc4319c05435047111ef2154d49434bd891ae1..d7f9bc1b252ba642fb538f5b0384e9bdfff6f548 100644 (file)
                        <groupId>org.springframework</groupId>
                        <artifactId>org.springframework.web.servlet</artifactId>
                </dependency>
+               <dependency>
+                       <groupId>org.springframework.osgi</groupId>
+                       <artifactId>org.springframework.osgi.core</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>org.eclipse.osgi</groupId>
+                       <artifactId>org.eclipse.osgi</artifactId>
+               </dependency>
 
                <!-- J2EE -->
                <dependency>
diff --git a/server/runtime/org.argeo.server.osgi/src/main/java/org/argeo/server/osgi/mvc/ListBundlesController.java b/server/runtime/org.argeo.server.osgi/src/main/java/org/argeo/server/osgi/mvc/ListBundlesController.java
new file mode 100644 (file)
index 0000000..37a6652
--- /dev/null
@@ -0,0 +1,26 @@
+package org.argeo.server.osgi.mvc;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.osgi.framework.BundleContext;
+import org.springframework.osgi.context.BundleContextAware;
+import org.springframework.web.servlet.ModelAndView;
+import org.springframework.web.servlet.mvc.AbstractController;
+
+public class ListBundlesController extends AbstractController implements
+               BundleContextAware {
+       private BundleContext bundleContext;
+
+       @Override
+       protected ModelAndView handleRequestInternal(HttpServletRequest request,
+                       HttpServletResponse response) throws Exception {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       public void setBundleContext(BundleContext bundleContext) {
+               this.bundleContext = bundleContext;
+       }
+
+}
diff --git a/server/runtime/org.argeo.server.osgi/target/classes/META-INF/MANIFEST.MF b/server/runtime/org.argeo.server.osgi/target/classes/META-INF/MANIFEST.MF
new file mode 100644 (file)
index 0000000..eee0848
--- /dev/null
@@ -0,0 +1,11 @@
+Manifest-Version: 1.0\r
+Bundle-Vendor: Argeo\r
+Bundle-Version: 0.1.1.SNAPSHOT-r2967\r
+Tool: Bnd-0.0.311\r
+Bundle-Name: Commons Server OSGi\r
+Created-By: 1.6.0_0 (Sun Microsystems Inc.)\r
+Bundle-ManifestVersion: 2\r
+Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt\r
+Bundle-DocURL: http://www.argeo.org\r
+Bundle-SymbolicName: org.argeo.server.osgi\r
+\r
diff --git a/server/runtime/org.argeo.server.osgi/target/classes/org/argeo/server/osgi/mvc/ListBundlesController.class b/server/runtime/org.argeo.server.osgi/target/classes/org/argeo/server/osgi/mvc/ListBundlesController.class
new file mode 100644 (file)
index 0000000..3ad73ac
Binary files /dev/null and b/server/runtime/org.argeo.server.osgi/target/classes/org/argeo/server/osgi/mvc/ListBundlesController.class differ