-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit b9013dd
Showing
30 changed files
with
750 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>net.sheenobu.osgi.tutorial</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.m2e.core.maven2Builder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.m2e.core.maven2Nature</nature> | ||
</natures> | ||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#Sun May 29 00:50:36 EDT 2011 | ||
activeProfiles= | ||
eclipse.preferences.version=1 | ||
resolveWorkspaceProjects=true | ||
version=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Sample OSGI Application | ||
|
||
Tested Application/OSGI container(s): | ||
|
||
* Servicemix (karaf) | ||
|
||
|
||
Requirements: | ||
|
||
* Java | ||
* Maven 2.x or 3.x | ||
|
||
|
||
* Apache Servicemix tar.gz (if using the bootstrap script) | ||
* expect (if using the boostrap script) | ||
* ssh (if using the bootstrap script) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
|
||
# bootstraps a test version of this application using apache-servicemix | ||
|
||
if [ 2 != $# ] | ||
then | ||
echo "Usage $0 path-to-servicemix-tar.gz http-port" | ||
exit 1 | ||
fi | ||
|
||
TAR=$1 | ||
HTTP_PORT=$2 | ||
|
||
mvn clean install | ||
rm -rf running/ | ||
mkdir running | ||
cd running | ||
tar xfvz ../$TAR | ||
cd $(basename $(basename $1 .tar.gz) .tar.bzip2) | ||
./bin/start | ||
sleep 5 | ||
echo "org.osgi.service.http.port=$HTTP_PORT" > etc/org.ops4j.pax.web.cfg | ||
../../runcmd localhost smx smx "features:addUrl mvn:net.sheenobu/net.sheenobu.osgi.tutorial.modules.karaf.features/1.0/xml/features" | ||
../../runcmd localhost smx smx "features:install net.sheenobu.osgi.springmvc.example" | ||
touch etc/org.ops4j.pax.web.cfg | ||
|
||
echo "Navigate to http://localhost:$HTTP_PORT/example/ to see it running!" | ||
|
||
#./bin/stop | ||
|
||
#echo "run $PWD/bin/start or $PWD/bin/servicemix to run" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>net.sheenobu.osgi.tutorial.modules</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.m2e.core.maven2Builder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.m2e.core.maven2Nature</nature> | ||
</natures> | ||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#Sun May 29 00:50:36 EDT 2011 | ||
activeProfiles= | ||
eclipse.preferences.version=1 | ||
resolveWorkspaceProjects=true | ||
version=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<classpath> | ||
<classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/> | ||
<classpathentry kind="output" path="target/classes"/> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<projectDescription> | ||
<name>core.karaf.features</name> | ||
<comment>NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment> | ||
<projects/> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.maven.ide.eclipse.maven2Builder</name> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
<nature>org.maven.ide.eclipse.maven2Nature</nature> | ||
</natures> | ||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#Thu May 26 13:59:33 EDT 2011 | ||
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.problem.forbiddenReference=warning | ||
org.eclipse.jdt.core.compiler.source=1.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#Thu May 26 12:25:48 EDT 2011 | ||
activeProfiles= | ||
eclipse.preferences.version=1 | ||
fullBuildGoals=process-test-resources | ||
resolveWorkspaceProjects=true | ||
resourceFilterGoals=process-resources resources\:testResources | ||
skipCompilerPlugin=true | ||
version=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?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"> | ||
|
||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>net.sheenobu</groupId> | ||
<artifactId>net.sheenobu.osgi.tutorial.modules</artifactId> | ||
<version>1.0</version> | ||
</parent> | ||
|
||
<artifactId>net.sheenobu.osgi.tutorial.modules.karaf.features</artifactId> | ||
<packaging>jar</packaging> | ||
|
||
<build> | ||
<resources> | ||
<resource> | ||
<directory>src/main/resources</directory> | ||
<filtering>true</filtering> | ||
</resource> | ||
</resources> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-resources-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>filter</id> | ||
<phase>generate-resources</phase> | ||
<goals> | ||
<goal>resources</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>build-helper-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>attach-artifacts</id> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>attach-artifact</goal> | ||
</goals> | ||
<configuration> | ||
<artifacts> | ||
<artifact> | ||
<file>target/classes/features.xml</file> | ||
<type>xml</type> | ||
<classifier>features</classifier> | ||
</artifact> | ||
</artifacts> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<features> | ||
<feature name="net.sheenobu.osgi.springmvc.example" version="${project.version}"> | ||
<feature>http</feature> | ||
<bundle>mvn:org.springframework/org.springframework.web/3.0.5.RELEASE</bundle> | ||
<bundle>mvn:org.springframework/org.springframework.web.servlet/3.0.5.RELEASE</bundle> | ||
<bundle>mvn:org.springframework.osgi/org.springframework.osgi.web/1.2.0</bundle> | ||
|
||
|
||
<bundle>mvn:${project.groupId}/${project.groupId}.osgi.tutorial.modules.web.spring.support.osgi/${project.version}</bundle> | ||
<bundle>mvn:${project.groupId}/${project.groupId}.osgi.tutorial.modules.web.example/${project.version}</bundle> | ||
</feature> | ||
</features> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<project> | ||
<parent> | ||
<groupId>net.sheenobu</groupId> | ||
<artifactId>net.sheenobu.osgi.tutorial</artifactId> | ||
<version>1.0</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
<artifactId>net.sheenobu.osgi.tutorial.modules</artifactId> | ||
<version>1.0</version> | ||
<packaging>pom</packaging> | ||
<modules> | ||
|
||
<module>karaf.features</module> | ||
|
||
<module>web.spring.support.osgi</module> | ||
<module>web.example</module> | ||
</modules> | ||
</project> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="src" path="src/main/java"/> | ||
<classpathentry kind="src" path="src/main/resources"/> | ||
<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.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/> | ||
<classpathentry kind="output" path="target/classes"/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>net.sheenobu.osgi.tutorial.modules.web.example</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.m2e.core.maven2Builder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
<nature>org.eclipse.m2e.core.maven2Nature</nature> | ||
</natures> | ||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#Sun May 29 01:03:08 EDT 2011 | ||
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.problem.forbiddenReference=warning | ||
org.eclipse.jdt.core.compiler.source=1.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#Sun May 29 01:03:08 EDT 2011 | ||
activeProfiles= | ||
eclipse.preferences.version=1 | ||
resolveWorkspaceProjects=true | ||
version=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<project> | ||
<parent> | ||
<groupId>net.sheenobu</groupId> | ||
<artifactId>net.sheenobu.osgi.tutorial.modules</artifactId> | ||
<version>1.0</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
<artifactId>net.sheenobu.osgi.tutorial.modules.web.example</artifactId> | ||
<packaging>bundle</packaging> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.felix</groupId> | ||
<artifactId>maven-bundle-plugin</artifactId> | ||
<version>1.4.3</version> | ||
<extensions>true</extensions> | ||
<configuration> | ||
<instructions> | ||
<Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName> | ||
|
||
<Import-Package> | ||
org.springframework.beans.factory.config, | ||
org.springframework.web.servlet, | ||
org.springframework.osgi.web.context.support | ||
</Import-Package> | ||
<Export-Package>net.sheenobu.osgi.web.example.controllers</Export-Package> | ||
<DynamicImport-Package>*</DynamicImport-Package> | ||
</instructions> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<dependencies> | ||
|
||
<dependency> | ||
<groupId>net.sheenobu</groupId> | ||
<artifactId> | ||
net.sheenobu.osgi.tutorial.modules.web.spring.support.osgi | ||
</artifactId> | ||
<version>1.0</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.springframework.osgi</groupId> | ||
<artifactId>org.springframework.osgi.core</artifactId> | ||
<version>1.2.1</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework</groupId> | ||
<artifactId>org.springframework.web.servlet</artifactId> | ||
<version>3.0.5.RELEASE</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.osgi</groupId> | ||
<artifactId>org.springframework.osgi.web</artifactId> | ||
<version>1.2.1</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.felix</groupId> | ||
<artifactId>org.osgi.core</artifactId> | ||
<version>1.4.0</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.osgi</groupId> | ||
<artifactId>org.osgi.compendium</artifactId> | ||
<version>4.1.0</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>javax.servlet</groupId> | ||
<artifactId>com.springsource.javax.servlet</artifactId> | ||
<version>2.5.0</version> | ||
</dependency> | ||
</dependencies> | ||
</project> | ||
|
26 changes: 26 additions & 0 deletions
26
.../web.example/src/main/java/net/sheenobu/osgi/web/example/controllers/IndexController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package net.sheenobu.osgi.web.example.controllers; | ||
|
||
import java.io.IOException; | ||
import java.io.Writer; | ||
|
||
import org.springframework.stereotype.Controller; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestMethod; | ||
|
||
@Controller | ||
@RequestMapping("/") | ||
public class IndexController { | ||
|
||
@RequestMapping(method=RequestMethod.GET) | ||
public void index(Writer os) throws IOException | ||
{ | ||
os.write("Hello World From an OSGI managed controller called " + IndexController.class.getCanonicalName()); | ||
} | ||
|
||
@RequestMapping(value="/2", method=RequestMethod.GET) | ||
public void two(Writer os) throws IOException | ||
{ | ||
os.write("page two!"); | ||
} | ||
|
||
} |
Oops, something went wrong.