Author: jgoodyear
Date: Thu Jan 19 13:09:49 2012
New Revision: 1233351

URL: http://svn.apache.org/viewvc?rev=1233351&view=rev
Log:
[KARAF-1099] Update Web demo.

Refactoried web demo to new kar format.
Updated readme to reflect new pre-reqs and new console output format.


Added:
    karaf/trunk/demos/web/src/main/filtered-resources/
    karaf/trunk/demos/web/src/main/filtered-resources/resources/
    karaf/trunk/demos/web/src/main/filtered-resources/resources/demos/
    karaf/trunk/demos/web/src/main/filtered-resources/resources/demos/web/
    
karaf/trunk/demos/web/src/main/filtered-resources/resources/demos/web/README.txt
   (with props)
    karaf/trunk/demos/web/src/main/resources/
    karaf/trunk/demos/web/src/main/resources/resources/
    karaf/trunk/demos/web/src/main/resources/resources/demos/
    karaf/trunk/demos/web/src/main/resources/resources/demos/web/
    karaf/trunk/demos/web/src/main/resources/resources/demos/web/NOTICE
    karaf/trunk/demos/web/src/main/resources/resources/demos/web/pom.xml   
(with props)
    karaf/trunk/demos/web/src/main/resources/resources/demos/web/src/
    karaf/trunk/demos/web/src/main/resources/resources/demos/web/src/main/
    karaf/trunk/demos/web/src/main/resources/resources/demos/web/src/main/java/
    
karaf/trunk/demos/web/src/main/resources/resources/demos/web/src/main/java/org/
    
karaf/trunk/demos/web/src/main/resources/resources/demos/web/src/main/java/org/apache/
    
karaf/trunk/demos/web/src/main/resources/resources/demos/web/src/main/java/org/apache/karaf/
    
karaf/trunk/demos/web/src/main/resources/resources/demos/web/src/main/java/org/apache/karaf/web/
    
karaf/trunk/demos/web/src/main/resources/resources/demos/web/src/main/java/org/apache/karaf/web/WebAppListener.java
   (with props)
    
karaf/trunk/demos/web/src/main/resources/resources/demos/web/src/main/webapp/
    
karaf/trunk/demos/web/src/main/resources/resources/demos/web/src/main/webapp/WEB-INF/
    
karaf/trunk/demos/web/src/main/resources/resources/demos/web/src/main/webapp/WEB-INF/web.xml
   (with props)
    
karaf/trunk/demos/web/src/main/resources/resources/demos/web/src/main/webapp/index.jsp
   (with props)
Removed:
    karaf/trunk/assemblies/apache-karaf/src/main/filtered-resources/demos/
    karaf/trunk/demos/web/NOTICE
    karaf/trunk/demos/web/src/main/java/
    karaf/trunk/demos/web/src/main/webapp/
Modified:
    karaf/trunk/assemblies/apache-karaf/pom.xml
    karaf/trunk/demos/web/pom.xml

Modified: karaf/trunk/assemblies/apache-karaf/pom.xml
URL: 
http://svn.apache.org/viewvc/karaf/trunk/assemblies/apache-karaf/pom.xml?rev=1233351&r1=1233350&r2=1233351&view=diff
==============================================================================
--- karaf/trunk/assemblies/apache-karaf/pom.xml (original)
+++ karaf/trunk/assemblies/apache-karaf/pom.xml Thu Jan 19 13:09:49 2012
@@ -91,6 +91,13 @@
             <type>kar</type>
             <scope>runtime</scope>
         </dependency>
+        <dependency>
+            <groupId>org.apache.karaf.demos</groupId>
+            <artifactId>org.apache.karaf.demos.web</artifactId>
+            <version>${project.version}</version>
+            <type>kar</type>
+            <scope>runtime</scope>
+        </dependency>
     </dependencies>
 
     <build>

Modified: karaf/trunk/demos/web/pom.xml
URL: 
http://svn.apache.org/viewvc/karaf/trunk/demos/web/pom.xml?rev=1233351&r1=1233350&r2=1233351&view=diff
==============================================================================
--- karaf/trunk/demos/web/pom.xml (original)
+++ karaf/trunk/demos/web/pom.xml Thu Jan 19 13:09:49 2012
@@ -1,5 +1,8 @@
 <?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/xsd/maven-4.0.0.xsd";>
+<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";>
 
     <!--
 
@@ -25,134 +28,78 @@
         <groupId>org.apache.karaf.demos</groupId>
         <artifactId>demos</artifactId>
         <version>3.0.0-SNAPSHOT</version>
-        <relativePath>../pom.xml</relativePath>
     </parent>
 
-    <artifactId>web</artifactId>
-    <packaging>war</packaging>
+    <artifactId>org.apache.karaf.demos.web</artifactId>
+    <packaging>pom</packaging>
     <name>Apache Karaf :: Demos :: Web</name>
 
-    <properties>
-        <jetty.port>8080</jetty.port>
-        <maven-jetty-plugin.version>6.1.26</maven-jetty-plugin.version>
-        <geronimo.servlet.version>1.1.2</geronimo.servlet.version>
-
-        
<appendedResourcesDirectory>${basedir}/../../etc/appended-resources</appendedResourcesDirectory>
-    </properties>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.karaf</groupId>
-            <artifactId>org.apache.karaf.main</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.karaf.jaas</groupId>
-            <artifactId>org.apache.karaf.jaas.boot</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.karaf.assemblies</groupId>
-            <artifactId>apache-karaf</artifactId>
-            <type>zip</type>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-servlet_2.5_spec</artifactId>
-            <scope>provided</scope>
-        </dependency>
-    </dependencies>
-
+    <modules>
+        <module>src/main/resources/resources/demos/web</module>
+        <!--<module>branding-package</module>-->
+    </modules>
     <build>
+        <resources>
+            <resource>
+                <directory>src/main/resources</directory>
+                <filtering>false</filtering>
+                <excludes>
+                    <exclude>**/target/**</exclude>
+                </excludes>
+            </resource>
+            <resource>
+                <directory>src/main/filtered-resources</directory>
+                <filtering>true</filtering>
+                <includes>
+                    <include>**/*</include>
+                </includes>
+            </resource>
+        </resources>
         <plugins>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <configuration>
-                    <source>1.6</source>
-                    <target>1.6</target>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-war-plugin</artifactId>
-                <configuration>
-                    <warSourceDirectory>src/main/webapp/</warSourceDirectory>
-                    <webResources>
-                        <resource>
-                            <directory>target/karaf</directory>
-                        </resource>
-                    </webResources>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.mortbay.jetty</groupId>
-                <artifactId>maven-jetty-plugin</artifactId>
-                <version>${maven-jetty-plugin.version}</version>
-                <configuration>
-                    <connectors>
-                        <connector 
implementation="org.mortbay.jetty.nio.SelectChannelConnector">
-                            <port>${jetty.port}</port>
-                            <maxIdleTime>60000</maxIdleTime>
-                        </connector>
-                    </connectors>
-                    <systemProperties>
-                        <!-- enable easy connection to JConsole -->
-                        <systemProperty>
-                            <name>com.sun.management.jmxremote</name>
-                            <value/>
-                        </systemProperty>
-                    </systemProperties>
-                    <scanIntervalSeconds>10</scanIntervalSeconds>
-                    
<webAppSourceDirectory>${project.build.directory}/${project.build.finalName}</webAppSourceDirectory>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-dependency-plugin</artifactId>
+                <artifactId>maven-resources-plugin</artifactId>
+                <!--<configuration>-->
+                    <!--<resources>-->
+                        <!--<resource>src/main/resources</resource>-->
+                    <!--</resources>-->
+                <!--</configuration>-->
                 <executions>
                     <execution>
-                        <id>unpack-unix</id>
-                        <phase>generate-resources</phase>
+                        <id>process-resources</id>
+                        <phase>process-resources</phase>
                         <goals>
-                            <goal>unpack</goal>
+                            <goal>resources</goal>
                         </goals>
-                        <configuration>
-                            <artifactItems>
-                                <artifactItem>
-                                    
<groupId>org.apache.karaf.assemblies</groupId>
-                                    <artifactId>apache-karaf</artifactId>
-                                    <type>zip</type>
-                                    <overWrite>true</overWrite>
-                                    
<outputDirectory>${project.build.directory}/karaf/WEB-INF</outputDirectory>
-                                    
<excludes>**/lib/*,**/*.txt,**/bin/*,**/demos/**,**/lib,**/bin,**/demos</excludes>
-                                </artifactItem>
-                            </artifactItems>
-                        </configuration>
                     </execution>
                 </executions>
             </plugin>
             <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-antrun-plugin</artifactId>
+                <groupId>org.apache.karaf.tooling</groupId>
+                <artifactId>karaf-maven-plugin</artifactId>
+                <version>${project.version}</version>
+                <configuration>
+                    <startLevel>60</startLevel>
+                    <!--<checkDependencyChange>true</checkDependencyChange>-->
+                    
<!--<overwriteChangedDependencies>true</overwriteChangedDependencies>-->
+                    
<!--<warnOnDependencyChange>true</warnOnDependencyChange>-->
+                </configuration>
                 <executions>
                     <execution>
-                        <id>copy-karaf</id>
-                        <phase>process-resources</phase>
+                        <id>compile</id>
+                        <phase>compile</phase>
+                        <goals>
+                            <goal>features-generate-descriptor</goal>
+                        </goals>
+                    </execution>
+                    <execution>
+                        <id>package</id>
                         <goals>
-                            <goal>run</goal>
+                            <goal>features-create-kar</goal>
                         </goals>
-                        <configuration>
-                            <tasks>
-                                <move 
todir="${project.build.directory}/karaf/WEB-INF/karaf">
-                                    <fileset
-                                            
dir="${project.build.directory}/karaf/WEB-INF/apache-karaf-${project.version}"/>
-                                </move>
-                            </tasks>
-                        </configuration>
                     </execution>
                 </executions>
             </plugin>
         </plugins>
     </build>
-
 </project>

Added: 
karaf/trunk/demos/web/src/main/filtered-resources/resources/demos/web/README.txt
URL: 
http://svn.apache.org/viewvc/karaf/trunk/demos/web/src/main/filtered-resources/resources/demos/web/README.txt?rev=1233351&view=auto
==============================================================================
--- 
karaf/trunk/demos/web/src/main/filtered-resources/resources/demos/web/README.txt
 (added)
+++ 
karaf/trunk/demos/web/src/main/filtered-resources/resources/demos/web/README.txt
 Thu Jan 19 13:09:49 2012
@@ -0,0 +1,123 @@
+/*
+ * 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.
+ */
+
+EMBEDDING KARAF IN A WEB APPLICATION
+====================================
+
+Purpose
+-------
+To embed Karaf in a web application.
+
+
+Prerequisites for Running the Example
+-------------------------------------
+You must have the following installed on your machine:
+
+  - JDK 1.6 or higher
+
+  - Maven 3.0.3 or higher
+
+
+Building and Deploying
+----------------------
+You can build and deploy this example in two ways:
+
+- A. Using Jetty: Quick and Easy
+  This option is useful if you want to see the example up and
+  running quickly.
+   
+- B. Using Your Favorite Web Container
+  This option is useful if you want to see Karaf running
+  as a web application inside your favorite web container.
+
+
+A. Using Jetty: Quick and Easy
+------------------------------
+To build the example and deploy to Jetty, complete the
+following steps:
+
+1. In a command prompt/shell, change to the directory
+   that contains this README.txt file.
+
+2. Enter the following Maven command:
+
+     mvn package jetty:run
+
+This Maven command builds the example web application, starts
+Jetty and deploys the web application to Jetty. Once complete,
+you should see the following printed to the console:
+
+[INFO] Started Jetty Server
+[INFO] Starting scanner at interval of 10 seconds.
+
+Running a Client
+----------------
+To test the example, you can use the Apache Karaf client
+to connect to the server and issue a Karaf command. For example,
+try executing the "features:list" command as follows:
+
+1. In a command prompt/shell, change to your product
+   installation directory.
+
+2. Run the following commands:
+
+    Unix:
+        ${KARAF_HOME}/bin/client feature:list
+
+    Windows:
+        %KARAF_HOME%\bin\client.bat feature:list
+
+    Using JDK:
+        java -jar lib/bin/karaf-client.jar features:list
+
+In this case, you should see output similar to the following:
+
+(abbreviated output below)
+
+State         Version           Name              Repository                   
Description
+[uninstalled] [${version} ] wrapper           standard-${version}      Provide 
OS integration
+[uninstalled] [${version} ] obr               standard-${version}      Provide 
OSGi Bundle Repository (OBR) support
+[uninstalled] [${version} ] config            standard-${version}      Provide 
OSGi ConfigAdmin support
+[uninstalled] [${version} ] region            standard-${version}      Provide 
Region commands
+[uninstalled] [7.5.4.v20111024] jetty             standard-${version}      
Provide Jetty engine support
+[uninstalled] [${version} ] http              standard-${version}      
Implementation of the OSGI HTTP Service
+[uninstalled] [${version} ] http-whiteboard   standard-${version}      Provide 
HTTP Whiteboard pattern support
+[uninstalled] [${version} ] war               standard-${version}      Turn 
Karaf as a full WebContainer
+[uninstalled] [${version} ] deployers         standard-${version}      Provide 
Karaf deployer
+[uninstalled] [${version} ] kar               standard-${version}      Provide 
KAR (KARaf archive) support
+[uninstalled] [${version} ] webconsole-base   standard-${version}      Base 
support of the Karaf WebConsole
+[uninstalled] [${version} ] webconsole        standard-${version}      Karaf 
WebConsole for administration and monitoring
+[uninstalled] [${version} ] ssh               standard-${version}      Provide 
a SSHd server on Karaf
+
+
+B. Using Your Favorite Web Container
+------------------------------------
+You can deploy the web application to your favorite web
+container, by completing the following steps:
+
+1. In a command prompt/shell, change to the directory
+   that contains this README.txt file.
+   
+2. Enter the following command:
+
+     mvn package
+     
+Maven builds the web application, web-${version}.war, and
+saves it in the target directory of this example. Deploy this
+WAR file to your favorite web container. Once the application
+is running, you can test it using the Apache Karaf client
+as described in the "Running a Client" section above.

Propchange: 
karaf/trunk/demos/web/src/main/filtered-resources/resources/demos/web/README.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
karaf/trunk/demos/web/src/main/filtered-resources/resources/demos/web/README.txt
------------------------------------------------------------------------------
    svn:executable = *

Added: karaf/trunk/demos/web/src/main/resources/resources/demos/web/NOTICE
URL: 
http://svn.apache.org/viewvc/karaf/trunk/demos/web/src/main/resources/resources/demos/web/NOTICE?rev=1233351&view=auto
==============================================================================
--- karaf/trunk/demos/web/src/main/resources/resources/demos/web/NOTICE (added)
+++ karaf/trunk/demos/web/src/main/resources/resources/demos/web/NOTICE Thu Jan 
19 13:09:49 2012
@@ -0,0 +1,48 @@
+Apache Karaf
+Copyright 2010-2011 The Apache Software Foundation
+
+
+I. Included Software
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+Licensed under the Apache License 2.0.
+
+This product includes software written by
+Antony Lesuisse.
+Licensed under Public Domain.
+
+
+II. Used Software
+
+This product uses software developed at
+The OSGi Alliance (http://www.osgi.org/).
+Copyright (c) OSGi Alliance (2000, 2010).
+Licensed under the Apache License 2.0.
+
+This product uses software developed at
+OPS4J (http://www.ops4j.org/).
+Licensed under the Apache License 2.0.
+
+This product uses software developed at
+FUSE Source (http://www.fusesource.org/).
+Licensed under the Apache License 2.0.
+
+This product uses software developed at
+Tanuki Software (http://www.tanukisoftware.com/).
+Licensed under the Apache License 2.0.
+
+This product uses software developed at
+JLine (http://jline.sourceforge.net).
+Licensed under the BSD License.
+
+This product uses software developed at
+SLF4J (http://www.slf4j.org/).
+Licensed under the MIT License.
+
+This product includes software from http://www.json.org.
+Copyright (c) 2002 JSON.org
+
+
+III. License Summary
+- Apache License 2.0

Added: karaf/trunk/demos/web/src/main/resources/resources/demos/web/pom.xml
URL: 
http://svn.apache.org/viewvc/karaf/trunk/demos/web/src/main/resources/resources/demos/web/pom.xml?rev=1233351&view=auto
==============================================================================
--- karaf/trunk/demos/web/src/main/resources/resources/demos/web/pom.xml (added)
+++ karaf/trunk/demos/web/src/main/resources/resources/demos/web/pom.xml Thu 
Jan 19 13:09:49 2012
@@ -0,0 +1,161 @@
+<?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/xsd/maven-4.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.karaf.demos</groupId>
+        <artifactId>demos</artifactId>
+        <version>3.0.0-SNAPSHOT</version>
+        <relativePath>../../../../../../../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>web</artifactId>
+    <packaging>war</packaging>
+    <name>Apache Karaf :: Demos :: Web</name>
+
+    <properties>
+        <jetty.port>8080</jetty.port>
+        <maven-jetty-plugin.version>6.1.26</maven-jetty-plugin.version>
+        <geronimo.servlet.version>1.1.2</geronimo.servlet.version>
+
+        
<appendedResourcesDirectory>${basedir}/../../etc/appended-resources</appendedResourcesDirectory>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.karaf</groupId>
+            <artifactId>org.apache.karaf.main</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.karaf.jaas</groupId>
+            <artifactId>org.apache.karaf.jaas.boot</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.karaf.assemblies</groupId>
+            <artifactId>apache-karaf</artifactId>
+            <type>zip</type>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-servlet_2.5_spec</artifactId>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>1.6</source>
+                    <target>1.6</target>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-war-plugin</artifactId>
+                <configuration>
+                    <warSourceDirectory>src/main/webapp/</warSourceDirectory>
+                    <webResources>
+                        <resource>
+                            <directory>target/karaf</directory>
+                        </resource>
+                    </webResources>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.mortbay.jetty</groupId>
+                <artifactId>maven-jetty-plugin</artifactId>
+                <version>${maven-jetty-plugin.version}</version>
+                <configuration>
+                    <connectors>
+                        <connector 
implementation="org.mortbay.jetty.nio.SelectChannelConnector">
+                            <port>${jetty.port}</port>
+                            <maxIdleTime>60000</maxIdleTime>
+                        </connector>
+                    </connectors>
+                    <systemProperties>
+                        <!-- enable easy connection to JConsole -->
+                        <systemProperty>
+                            <name>com.sun.management.jmxremote</name>
+                            <value/>
+                        </systemProperty>
+                    </systemProperties>
+                    <scanIntervalSeconds>10</scanIntervalSeconds>
+                    
<webAppSourceDirectory>${project.build.directory}/${project.build.finalName}</webAppSourceDirectory>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-dependency-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>unpack-unix</id>
+                        <phase>generate-resources</phase>
+                        <goals>
+                            <goal>unpack</goal>
+                        </goals>
+                        <configuration>
+                            <artifactItems>
+                                <artifactItem>
+                                    
<groupId>org.apache.karaf.assemblies</groupId>
+                                    <artifactId>apache-karaf</artifactId>
+                                    <type>zip</type>
+                                    <overWrite>true</overWrite>
+                                    
<outputDirectory>${project.build.directory}/karaf/WEB-INF</outputDirectory>
+                                    
<excludes>**/lib/*,**/*.txt,**/bin/*,**/demos/**,**/lib,**/bin,**/demos</excludes>
+                                </artifactItem>
+                            </artifactItems>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-antrun-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>copy-karaf</id>
+                        <phase>process-resources</phase>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                        <configuration>
+                            <tasks>
+                                <move 
todir="${project.build.directory}/karaf/WEB-INF/karaf">
+                                    <fileset
+                                            
dir="${project.build.directory}/karaf/WEB-INF/apache-karaf-${project.version}"/>
+                                </move>
+                            </tasks>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

Propchange: karaf/trunk/demos/web/src/main/resources/resources/demos/web/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
karaf/trunk/demos/web/src/main/resources/resources/demos/web/src/main/java/org/apache/karaf/web/WebAppListener.java
URL: 
http://svn.apache.org/viewvc/karaf/trunk/demos/web/src/main/resources/resources/demos/web/src/main/java/org/apache/karaf/web/WebAppListener.java?rev=1233351&view=auto
==============================================================================
--- 
karaf/trunk/demos/web/src/main/resources/resources/demos/web/src/main/java/org/apache/karaf/web/WebAppListener.java
 (added)
+++ 
karaf/trunk/demos/web/src/main/resources/resources/demos/web/src/main/java/org/apache/karaf/web/WebAppListener.java
 Thu Jan 19 13:09:49 2012
@@ -0,0 +1,62 @@
+/*
+ * 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.karaf.web;
+
+import java.io.File;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+import org.apache.karaf.main.Main;
+
+public class WebAppListener implements ServletContextListener {
+
+       private Main main;
+
+       public void contextInitialized(ServletContextEvent sce) {
+               try {
+                       System.err.println("contextInitialized");
+                       String root = new 
File(sce.getServletContext().getRealPath("/") + 
"/WEB-INF/karaf").getAbsolutePath();
+                       System.err.println("Root: " + root);
+                       System.setProperty("karaf.home", root);
+            System.setProperty("karaf.base", root);
+            System.setProperty("karaf.data", root + "/data");
+            System.setProperty("karaf.history", root + "/data/history.txt");
+            System.setProperty("karaf.instances", root + "/instances");
+                       System.setProperty("karaf.startLocalConsole", "false");
+                       System.setProperty("karaf.startRemoteShell", "true");
+            System.setProperty("karaf.lock", "false");
+                       main = new Main(new String[0]);
+            main.launch();
+               } catch (Exception e) {
+                       main = null;
+                       e.printStackTrace();
+               }
+       }
+
+       public void contextDestroyed(ServletContextEvent sce) {
+               try {
+                       System.err.println("contextDestroyed");
+                       if (main != null) {
+                main.destroy();
+                       }
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
+       }
+
+}
\ No newline at end of file

Propchange: 
karaf/trunk/demos/web/src/main/resources/resources/demos/web/src/main/java/org/apache/karaf/web/WebAppListener.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
karaf/trunk/demos/web/src/main/resources/resources/demos/web/src/main/webapp/WEB-INF/web.xml
URL: 
http://svn.apache.org/viewvc/karaf/trunk/demos/web/src/main/resources/resources/demos/web/src/main/webapp/WEB-INF/web.xml?rev=1233351&view=auto
==============================================================================
--- 
karaf/trunk/demos/web/src/main/resources/resources/demos/web/src/main/webapp/WEB-INF/web.xml
 (added)
+++ 
karaf/trunk/demos/web/src/main/resources/resources/demos/web/src/main/webapp/WEB-INF/web.xml
 Thu Jan 19 13:09:49 2012
@@ -0,0 +1,36 @@
+<?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.
+-->
+
+<web-app version="2.4"
+         xmlns="http://java.sun.com/xml/ns/j2ee";
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
+                             http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";>
+
+  <description>Karaf Embedded Example</description>
+  <display-name>Karaf Embedded Example</display-name>
+
+  <listener>
+    <listener-class>org.apache.karaf.web.WebAppListener</listener-class>
+  </listener>
+
+  <welcome-file-list>
+    <welcome-file>index.jsp</welcome-file>
+  </welcome-file-list>
+               
+</web-app>

Propchange: 
karaf/trunk/demos/web/src/main/resources/resources/demos/web/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
karaf/trunk/demos/web/src/main/resources/resources/demos/web/src/main/webapp/index.jsp
URL: 
http://svn.apache.org/viewvc/karaf/trunk/demos/web/src/main/resources/resources/demos/web/src/main/webapp/index.jsp?rev=1233351&view=auto
==============================================================================
--- 
karaf/trunk/demos/web/src/main/resources/resources/demos/web/src/main/webapp/index.jsp
 (added)
+++ 
karaf/trunk/demos/web/src/main/resources/resources/demos/web/src/main/webapp/index.jsp
 Thu Jan 19 13:09:49 2012
@@ -0,0 +1,34 @@
+<%--
+    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.
+--%>
+<html>
+<head>
+<title>Apache Karaf</title>
+</head>
+<body>
+
+<h2>Welcome!</h2>
+
+<p>
+Welcome to Apache Karaf web application demo
+</p>
+
+<p>
+You can find more information about Karaf on the <a 
href="http://karaf.apache.org/";>Apache Karaf Site</a>
+</p>
+</body>
+</html>
+       

Propchange: 
karaf/trunk/demos/web/src/main/resources/resources/demos/web/src/main/webapp/index.jsp
------------------------------------------------------------------------------
    svn:eol-style = native


Reply via email to