You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by gn...@apache.org on 2011/02/09 10:38:51 UTC

svn commit: r1068812 [2/2] - in /karaf/sandbox/website/src/main/webapp/index/documentation: ./ karaf-users-guide/ karaf-users-guide/2.-quick-start/ karaf-users-guide/4.-understanding-karaf/ karaf-users-guide/5.-using-karaf/ karaf-users-guide/6.-advance...

Added: karaf/sandbox/website/src/main/webapp/index/documentation/karaf-users-guide/5.-using-karaf/5.4.-writing-integration-tests.page
URL: http://svn.apache.org/viewvc/karaf/sandbox/website/src/main/webapp/index/documentation/karaf-users-guide/5.-using-karaf/5.4.-writing-integration-tests.page?rev=1068812&view=auto
==============================================================================
--- karaf/sandbox/website/src/main/webapp/index/documentation/karaf-users-guide/5.-using-karaf/5.4.-writing-integration-tests.page (added)
+++ karaf/sandbox/website/src/main/webapp/index/documentation/karaf-users-guide/5.-using-karaf/5.4.-writing-integration-tests.page Wed Feb  9 09:38:50 2011
@@ -0,0 +1,40 @@
+---
+title: 5.4. Writing integration tests
+page_version: 2
+page_creator: gnodet
+page_modifier: gnodet
+--- pipeline:conf
+{scrollbar}
+{anchor:top}
+
+h1. 5.4. Writing integration tests
+
+We recommend using [PAX Exam|http://wiki.ops4j.org/display/paxexam/Pax+Exam] to write integration tests when developping applications using Karaf.
+
+Since version 1.4.0, Karaf provides an helper library to help writing such integration tests.
+{code}
+   @Configuration
+   public static Option[] configuration() throws Exception{
+       return combine(
+           // Default karaf environment
+           Helper.getDefaultOptions(),
+           // Test on both equinox and felix
+           equinox(), felix()
+       );
+   }
+{code}
+
+If you need to provision a few features in addition to the default karaf environment, you can do so by adding the following code:
+
+{code}
+           scanFeatures(
+                  maven().groupId("org.apache.felix.karaf")
+                         .artifactId("apache-felix-karaf")
+                         .type("xml").classifier("features")
+                         .versionAsInProject(),
+                  "obr", "wrapper"
+           ),
+{code}
+
+[#top]
+{scrollbar}

Added: karaf/sandbox/website/src/main/webapp/index/documentation/karaf-users-guide/6.-advanced-uses.page
URL: http://svn.apache.org/viewvc/karaf/sandbox/website/src/main/webapp/index/documentation/karaf-users-guide/6.-advanced-uses.page?rev=1068812&view=auto
==============================================================================
--- karaf/sandbox/website/src/main/webapp/index/documentation/karaf-users-guide/6.-advanced-uses.page (added)
+++ karaf/sandbox/website/src/main/webapp/index/documentation/karaf-users-guide/6.-advanced-uses.page Wed Feb  9 09:38:50 2011
@@ -0,0 +1,15 @@
+---
+title: 6. Advanced uses
+page_version: 5
+page_creator: gnodet
+page_modifier: gnodet
+--- pipeline:conf
+{scrollbar}
+{anchor:top}
+
+h1. 6. Advanced uses
+
+{children:all}
+
+[#top]
+{scrollbar}
\ No newline at end of file

Added: karaf/sandbox/website/src/main/webapp/index/documentation/karaf-users-guide/6.-advanced-uses/6.1.-extending-the-console.page
URL: http://svn.apache.org/viewvc/karaf/sandbox/website/src/main/webapp/index/documentation/karaf-users-guide/6.-advanced-uses/6.1.-extending-the-console.page?rev=1068812&view=auto
==============================================================================
--- karaf/sandbox/website/src/main/webapp/index/documentation/karaf-users-guide/6.-advanced-uses/6.1.-extending-the-console.page (added)
+++ karaf/sandbox/website/src/main/webapp/index/documentation/karaf-users-guide/6.-advanced-uses/6.1.-extending-the-console.page Wed Feb  9 09:38:50 2011
@@ -0,0 +1,334 @@
+---
+title: 6.1. Extending the console
+page_version: 21
+page_creator: gnodet
+page_modifier: nanthrax
+--- pipeline:conf
+{scrollbar}
+{anchor:top}
+
+h1. 6.1. Extending the console
+
+This chapter will guide you through the steps needed to extend the console and create a new shell.  We will leverage Maven, Blueprint and OSGi, so you will need some knowledge of those products.
+
+You may also find some information about the console at [FELIX:RFC 147 Overview].
+
+h2. Create the project using maven
+
+We first need to create the project using maven.  Let's leverage maven archetypes for that.
+
+h3. Command line
+
+Using the command line, we can create our project:
+{code}
+mvn archetype:create \
+  -DarchetypeArtifactId=maven-archetype-quickstart \
+  -DgroupId=org.apache.karaf.shell.samples \
+  -DartifactId=shell-sample-commands \
+  -Dversion=1.0-SNAPSHOT
+{code}
+
+This generate the main {{pom.xml}} and some additional packages.
+
+h3. Interactive shell
+
+You can also use the interactive mode for creating the skeleton project:
+{code}
+mvn archetype:generate
+{code}
+Use the following values when prompted:
+{code}
+Choose a number:  (1/2/3/4/5/6/7/8/9/10/11/12/13/14/15/16/17/18/19/20/21/22/23/24/25/26/27/28/29/30/31/32/33/34/35/36) 15: : 15
+Define value for groupId: : org.apache.karaf.shell.samples
+Define value for artifactId: : shell-sample-commands
+Define value for version:  1.0-SNAPSHOT: : 
+Define value for package: : org.apache.karaf.shell.samples
+{code}
+
+h3. Manual creation
+
+Alternatively, you can simply create the directory {{shell-sample-commands}} and create the {{pom.xml}} file inside it:
+{code:title=pom.xml|lang=xml}
+<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.apache.karaf.shell.samples</groupId>
+  <artifactId>shell-sample-commands<artifactId>
+  <packaging>jar</packaging>
+  <version>1.0-SNAPSHOT</version>
+  <name>shell-sample-commmands</name>
+  <url>http://maven.apache.org</url>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+</project>
+{code}
+
+h2. Dependencies
+
+We need to tell maven which libraries our project depends on.  In the {{dependencies}} section of the pom, add the following one:
+
+{code:lang=xml}
+  <dependency>
+    <groupId>org.apache.karaf.shell</groupId>
+    <artifactId>org.apache.karaf.shell.console</artifactId>
+    <version>1.0.0</version>
+  </dependency>
+{code}
+
+This dependency is needed to have access to the base classes that are used to define commands.
+
+h2. Configuring for Java 5
+
+We are using annotations to define commands, so we need to ensure maven will actually use JDK 1.5 to compile the jar.
+Just add the following snippet after the {{dependencies}} section.
+
+{code:lang=xml}
+<build>
+  <plugins>
+    <plugin>
+      <groupId>org.apache.maven.plugins</groupId>
+      <artifactId>maven-compiler-plugin</artifactId>
+      <configuration>
+        <target>1.5</target>
+        <source>1.5</source>
+      </configuration>
+    </plugin>
+  </plugins>
+</build>
+{code}
+
+h2. Loading the project in your IDE
+
+We can use maven to generate the needed files for your IDE:
+
+Inside the project, run the following command
+{code}
+mvn eclipse:eclipse
+{code}
+or
+{code}
+mvn idea:idea
+{code}
+
+The project files for your IDE should now be created.  Just open the IDE and load the project.
+
+h2. Creating a basic command class
+
+We can now create the command class {{HelloShellCommand.java}}
+
+{code:title=HelloShellCommand.java|lang=java}
+package org.apache.karaf.shell.samples;
+
+import org.apache.felix.gogo.commands.Command;
+import org.apache.felix.gogo.commands.Option;
+import org.apache.felix.gogo.commands.Argument;
+import org.apache.karaf.shell.console.OsgiCommandSupport;
+
+@Command(scope = "test", name = "hello", description="Says hello")
+public class HelloShellCommand extends OsgiCommandSupport {
+
+    @Override
+    protected Object doExecute() throws Exception {
+        System.out.println("Executing Hello command");
+        return null;
+    }
+}
+{code}
+
+h2. Creating the associated blueprint configuration files
+
+The blueprint configuration file will be used to create the command and register it in the OSGi registry, which is the way to make the command available to Karaf console.  This blueprint file must be located in the {{OSGI-INF/blueprint/}} directory inside the bundle.
+
+If you don't have the {{src/main/resources}} directory yet, create it.
+
+{code}
+mkdir src/main/resources
+{code}
+
+Then, re-generate the IDE project files and reload it so that this folder is now recognized as a source folder.
+
+Inside this directory, create the {{OSGI-INF/blueprint/}} directory and put the following file inside (the name of this file has no impact at all):
+
+{code:title=shell-config.xml|lang=xml}
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
+
+    <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.0.0">
+        <command name="test/hello">
+            <action class="org.apache.karaf.shell.samples.HelloShellCommand"/>
+        </command>
+    </command-bundle>
+
+</blueprint>
+{code}
+
+h2. Compiling the jar
+
+Let's try to build the jar.  Remove the test classes and sample classes if you used the artifact, then from the command line, run:
+
+{code}
+mvn install
+{code}
+
+The end of the maven output should look like:
+{code}
+[SMX4KNL:INFO] ------------------------------------------------------------------------
+[SMX4KNL:INFO] BUILD SUCCESSFUL
+[SMX4KNL:INFO] ------------------------------------------------------------------------
+{code}
+
+h2. Turning the jar into an OSGi bundle
+
+OSGi bundles are jars but they require some manifest headers to be correctly recognized.  We will leverage Felix's maven plugin to easily generate those.  
+
+Lets turn it into a bundle: modify the line in the {{pom.xml}} to adjust the packaging:
+
+{code:lang=xml}
+  <packaging>bundle</packaging>
+{code}
+
+Add the following section at the bottom of the {{pom.xml}}, in the existing {{build/plugins}} section:
+
+{code:lang=xml}
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <version>2.1.0</version>
+        <extensions>true</extensions>
+        <configuration>
+            <instructions>
+                <Import-Package>org.osgi.service.command,*</Import-Package>
+            </instructions>
+        </configuration>
+      </plugin>
+{code}
+
+The {{Import-Package}} is required to make sure our bundle will import the {{org.osgi.service.command}} package so that the service will be correctly seen in Felix.
+
+Let's compiled it again using the {{mvn install}} command.
+
+h2. Test in Karaf
+
+Launch a Karaf instance and run the following command to install the newly created bundle:
+{code}
+karaf@root> osgi:install -s mvn:org.apache.karaf.shell.samples/shell-sample-commands/1.0-SNAPSHOT
+{code}
+
+Let's try running the command:
+
+{code}
+karaf@root> test:hello
+Executing Hello command
+{code}
+
+h1. Command completer
+
+A completer allow you to automatically complete a command argument using <tab>. A completer is simply a bean which is injected to a command.
+
+Of course to be able to complete it, the command should require an argument.
+
+h2. Command argument
+
+We add an argument to the HelloCommand:
+
+{code}
+package org.apache.karaf.shell.samples;
+
+import org.apache.felix.gogo.commands.Command;
+import org.apache.felix.gogo.commands.Option;
+import org.apache.felix.gogo.commands.Argument;
+import org.apache.karaf.shell.console.OsgiCommandSupport;
+
+@Command(scope = "test", name = "hello", description="Says hello")
+public class HelloShellCommand extends OsgiCommandSupport {
+
+    @Argument(index = 0, name = "arg", description = "The command argument", required = false, multiValued = false)
+    String arg = null;
+
+    @Override
+    protected Object doExecute() throws Exception {
+        System.out.println("Executing Hello command");
+        return null;
+    }
+}
+{code}
+
+The Blueprint configuration file is the same as previously.
+
+h2. Completer bean
+
+A completer is a bean which implements the Completer interface:
+
+{code}
+package org.apache.karaf.shell.samples;
+
+import org.apache.karaf.shell.console.completer.StringsCompleter;
+import org.apache.karaf.shell.console.Completer;
+
+/**
+ * <p>
+ * A very simple completer.
+ * </p>
+ */
+public class SimpleCompleter implements Completer {
+
+ /**
+  * @param buffer it's the beginning string typed by the user
+  * @param cursor it's the position of the cursor
+  * @param candidates the list of completions proposed to the user
+  */
+ public int complete(String buffer, int cursor, List candidates) {
+  StringsCompleter delegate = new StringsCompleter();
+  delegate.getStrings().add("one");
+  delegate.getStrings().add("two");
+  delegate.getStrings().add("three");
+  return delegate.complete(buffer, cursor, candidates);
+ }
+
+}
+{code}
+
+h2. Blueprint configuration file
+
+Using Blueprint, you can "inject" the completer linked to your command. The same completer could be used for several commands and a command can have several completers:
+
+{code:lang=xml}
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
+
+    <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.0.0">
+        <command name="test/hello">
+            <action class="org.apache.karaf.shell.samples.HelloShellCommand"/>
+        </command>
+        <completers>
+          <ref component-id="simpleCompleter"/>
+          <null/>
+        </completers>
+    </command-bundle>
+
+    <bean id="simpleCompleter" class="org.apache.karaf.shell.samples.SimpleCompleter"/>
+
+</blueprint>
+{code}
+
+h2. Test in Karaf
+
+
+Launch a Karaf instance and run the following command to install the newly created bundle:
+{code}
+karaf@root> osgi:install -s mvn:org.apache.karaf.shell.samples/shell-sample-commands/1.0-SNAPSHOT
+{code}
+
+Let's try running the command:
+
+{code}
+karaf@root> test:hello <tab>
+ one    two    three
+{code}
+
+[#top]
+{scrollbar}

Added: karaf/sandbox/website/src/main/webapp/index/documentation/karaf-users-guide/6.-advanced-uses/6.2.-building-custom-distributions.page
URL: http://svn.apache.org/viewvc/karaf/sandbox/website/src/main/webapp/index/documentation/karaf-users-guide/6.-advanced-uses/6.2.-building-custom-distributions.page?rev=1068812&view=auto
==============================================================================
--- karaf/sandbox/website/src/main/webapp/index/documentation/karaf-users-guide/6.-advanced-uses/6.2.-building-custom-distributions.page (added)
+++ karaf/sandbox/website/src/main/webapp/index/documentation/karaf-users-guide/6.-advanced-uses/6.2.-building-custom-distributions.page Wed Feb  9 09:38:50 2011
@@ -0,0 +1,15 @@
+---
+title: 6.2. Building custom distributions
+page_version: 5
+page_creator: gnodet
+page_modifier: gnodet
+--- pipeline:conf
+{scrollbar}
+{anchor:top}
+
+h1. 6.2. Building custom distributions
+
+TODO
+
+[#top]
+{scrollbar}

Added: karaf/sandbox/website/src/main/webapp/index/documentation/karaf-users-guide/6.-advanced-uses/6.3.-programmatically-connect-to-the-console.page
URL: http://svn.apache.org/viewvc/karaf/sandbox/website/src/main/webapp/index/documentation/karaf-users-guide/6.-advanced-uses/6.3.-programmatically-connect-to-the-console.page?rev=1068812&view=auto
==============================================================================
--- karaf/sandbox/website/src/main/webapp/index/documentation/karaf-users-guide/6.-advanced-uses/6.3.-programmatically-connect-to-the-console.page (added)
+++ karaf/sandbox/website/src/main/webapp/index/documentation/karaf-users-guide/6.-advanced-uses/6.3.-programmatically-connect-to-the-console.page Wed Feb  9 09:38:50 2011
@@ -0,0 +1,62 @@
+---
+title: 6.3. Programmatically connect to the console
+page_version: 6
+page_creator: gnodet
+page_modifier: gnodet
+--- pipeline:conf
+{scrollbar}
+{anchor:top}
+
+h1. 6.3. Programmatically connect to the console
+
+A connection to Karaf console can also be done programmatically.
+The following code is a simplified version of the code from the client library.
+
+{code:lang=java}
+import org.apache.sshd.ClientChannel;
+import org.apache.sshd.ClientSession;
+import org.apache.sshd.SshClient;
+import org.apache.sshd.client.future.ConnectFuture;
+
+public class Main {
+
+    public static void main(String[] args) throws Exception {
+        String host = "localhost";
+        int port = 8101;
+        String user = "karaf";
+        String password = "karaf";
+
+        SshClient client = null;
+        try {
+            client = SshClient.setUpDefaultClient();
+            client.start();
+            ConnectFuture future = client.connect(host, port);
+            future.await();
+            ClientSession session = future.getSession();
+            session.authPassword(user, password);
+            ClientChannel channel = session.createChannel("shell");
+            channel.setIn(System.in);
+            channel.setOut(System.out);
+            channel.setErr(System.err);
+            channel.open();
+            channel.waitFor(ClientChannel.CLOSED, 0);
+        } catch (Throwable t) {
+            t.printStackTrace();
+            System.exit(1);
+        } finally {
+            try {
+                client.stop();
+            } catch (Throwable t) { }
+        }
+        System.exit(0);
+    }
+
+}
+{code}
+
+You can find a more complete example at the [following location|http://svn.apache.org/repos/asf/felix/trunk/karaf/client/src/main/java/org/apache/felix/karaf/client/Main.java].
+
+
+
+[#top]
+{scrollbar}

Added: karaf/sandbox/website/src/main/webapp/index/documentation/karaf-users-guide/6.-advanced-uses/6.4.-embedding-karaf.page
URL: http://svn.apache.org/viewvc/karaf/sandbox/website/src/main/webapp/index/documentation/karaf-users-guide/6.-advanced-uses/6.4.-embedding-karaf.page?rev=1068812&view=auto
==============================================================================
--- karaf/sandbox/website/src/main/webapp/index/documentation/karaf-users-guide/6.-advanced-uses/6.4.-embedding-karaf.page (added)
+++ karaf/sandbox/website/src/main/webapp/index/documentation/karaf-users-guide/6.-advanced-uses/6.4.-embedding-karaf.page Wed Feb  9 09:38:50 2011
@@ -0,0 +1,15 @@
+---
+title: 6.4. Embedding Karaf
+page_version: 3
+page_creator: gnodet
+page_modifier: gnodet
+--- pipeline:conf
+{scrollbar}
+{anchor:top}
+
+h1. 6.4. Embedding Karaf
+
+TODO: an example of embedding Karaf inside a web application is provided in the distribution
+
+[#top]
+{scrollbar}
\ No newline at end of file

Added: karaf/sandbox/website/src/main/webapp/index/documentation/karaf-users-guide/6.-advanced-uses/6.5.-deploying-security-providers.page
URL: http://svn.apache.org/viewvc/karaf/sandbox/website/src/main/webapp/index/documentation/karaf-users-guide/6.-advanced-uses/6.5.-deploying-security-providers.page?rev=1068812&view=auto
==============================================================================
--- karaf/sandbox/website/src/main/webapp/index/documentation/karaf-users-guide/6.-advanced-uses/6.5.-deploying-security-providers.page (added)
+++ karaf/sandbox/website/src/main/webapp/index/documentation/karaf-users-guide/6.-advanced-uses/6.5.-deploying-security-providers.page Wed Feb  9 09:38:50 2011
@@ -0,0 +1,36 @@
+---
+title: 6.5. Deploying security providers
+page_version: 6
+page_creator: gnodet
+page_modifier: gnodet
+--- pipeline:conf
+{scrollbar}
+{anchor:top}
+
+h1. 6.5. Deploying security providers
+
+Some applications require specific security providers to be available, such as [BouncyCastle|http://www.bouncycastle.org].  The JVM impose some restrictions about the use of such jars: they have to be signed and be available on the boot classpath.  One way to deploy those providers is to put them in the JRE folder at {{$JAVA_HOME/jre/lib/ext}} and modify the security policy configuration ({{$JAVA_HOME/jre/lib/security/java.security}}) in order to register such providers.
+
+While this approach works fine, it has a global effect and require you to configure all your servers accordingly.
+
+Karaf offers a simple way to configure additional security providers:
+ * put your provider jar in {{\[FELIX:KARAF\]/lib}}
+ * modify the {{\[FELIX:KARAF\]/etc/config.properties}} configuration file to add the following property
+
+{code}
+org.apache.felix.karaf.security.providers = xxx,yyy
+{code}
+
+The value of this property is a comma separated list of the provider class names to register.
+For example:
+{code}
+org.apache.felix.karaf.security.providers = org.bouncycastle.jce.provider.BouncyCastleProvider
+{code}
+
+In addition, you may want to provide access to the classes from those providers from the system bundle so that all bundles can access those.  It can be done by modifying the {{org.osgi.framework.bootdelegation}} property in the same configuration file:
+{code}
+org.osgi.framework.bootdelegation = ...,org.bouncycastle*
+{code}
+
+[#top]
+{scrollbar}
\ No newline at end of file

Added: karaf/sandbox/website/src/main/webapp/index/documentation/karaf-users-guide/6.-advanced-uses/6.6.-installing-additional-features.page
URL: http://svn.apache.org/viewvc/karaf/sandbox/website/src/main/webapp/index/documentation/karaf-users-guide/6.-advanced-uses/6.6.-installing-additional-features.page?rev=1068812&view=auto
==============================================================================
--- karaf/sandbox/website/src/main/webapp/index/documentation/karaf-users-guide/6.-advanced-uses/6.6.-installing-additional-features.page (added)
+++ karaf/sandbox/website/src/main/webapp/index/documentation/karaf-users-guide/6.-advanced-uses/6.6.-installing-additional-features.page Wed Feb  9 09:38:50 2011
@@ -0,0 +1,118 @@
+---
+title: 6.6. Installing additional features
+page_version: 9
+page_creator: drwoods
+page_modifier: iocanel
+--- pipeline:conf
+{scrollbar}
+{anchor:top}
+
+
+h1. 6.6. Installing additional features
+
+This chapter will demonstrate how to add additional features from a remote maven repository to a default installation of Karaf.
+
+{info}Last updated September 3, 2010 using Karaf 2.0.0{info}
+
+h2. Adding additional maven repositories
+
+The following steps will add in the missing OPS4J and Apache Snapshot maven repositories. *Note* \- this has been fixed in the 1.1.0 of ServiceMix Kernel release and can be skipped.
+# Edit the following file -
+{noformat}
+etc/org.ops4j.pax.url.mvn.cfg
+{noformat}
+# Update _org.ops4j.pax.url.mvn.repositories_ to include the OPS4J and Apache Snapshot repos -
+{noformat}
+org.ops4j.pax.url.mvn.repositories=file:${user.home}/.m2/repository@snapshots,http://repo1.maven.org/maven2,http://repository.ops4j.org/maven2,http://people.apache.org/repo/m2-snapshot-repository@snapshots@noreleases
+{noformat}
+
+h2. Adding additional feature repositories
+
+The following steps will add in the URLs for the Camel & ActiveMQ and Features locations.
+# Start Karaf
+{noformat}
+cd bin
+./karaf or karaf.bat
+{noformat}
+# Add the following feature install locations
+{noformat}
+karaf@root> features:addUrl mvn:org.apache.activemq/activemq-karaf/5.4.0/xml/features
+karaf@root> features:addUrl mvn:org.apache.camel.karaf/features/2.0.0/xml/features
+
+{noformat}
+# Verify the feature URLs were added -
+{noformat}
+karaf@root> features:listUrl
+mvn:org.apache.camel.karaf/features/2.0.0/xml/features    valid
+mvn:org.apache.activemq/activemq-karaf/5.4.0/xml/features    valid
+mvn:org.apache.karaf/apache-karaf/2.0.1-SNAPSHOT/xml/features    valid
+{noformat}
+
+h2. Installing a new feature (war)
+
+The following steps will install the "war" feature (support for deploying WAR files with Servlet and JSPs into a Jetty server) into your Karaf instance.
+# List the available features -
+{noformat}
+karaf@root> features:list
+ State        Name
+. . .
+[uninstalled] [2.0.0] obr                      karaf-2.0.0
+[uninstalled] [2.0.0] config                   karaf-2.0.0
+[uninstalled] [2.0.0] http                     karaf-2.0.0
+[uninstalled] [2.0.0] war                      karaf-2.0.0
+[uninstalled] [2.0.0] webconsole               karaf-2.0.0
+[installed  ] [2.0.0] ssh                      karaf-2.0.0
+
+. . .
+{noformat}
+# Install the war feature (and the sub-features it requires) -
+{noformat}
+karaf@root> features:install war
+{noformat}
+# Verify the features were installed
+{noformat}
+karaf@root> features:list
+ State        Name
+. . .
+[installed  ] [2.0.0] http                     karaf-2.0.0
+[installed  ] [2.0.0] war                      karaf-2.0.0
+. . .
+{noformat}
+# Verify the installed bundles were started
+{noformat}
+karaf@root> osgi:list
+START LEVEL 100
+   ID   State         Blueprint      Level  Name
+. . .
+[  32] [Active     ] [            ] [   60] geronimo-servlet_2.5_spec (1.1.2)
+[  33] [Active     ] [            ] [   60] Apache ServiceMix :: Bundles :: jetty (6.1.22.2)
+[  34] [Active     ] [            ] [   60] OPS4J Pax Web - API (0.7.2)
+[  35] [Active     ] [            ] [   60] OPS4J Pax Web - Service SPI (0.7.2)
+[  36] [Active     ] [            ] [   60] OPS4J Pax Web - Runtime (0.7.2)
+[  37] [Active     ] [            ] [   60] OPS4J Pax Web - Jetty (0.7.2)
+[  38] [Active     ] [            ] [   60] OPS4J Pax Web - Jsp Support (0.7.2)
+[  39] [Active     ] [            ] [   60] OPS4J Pax Web - Extender - WAR (0.7.2)
+[  40] [Active     ] [            ] [   60] OPS4J Pax Web - Extender - Whiteboard (0.7.2)
+[  41] [Active     ] [            ] [   60] OPS4J Pax Url - war:, war-i: (1.1.3)
+[  42] [Active     ] [Created     ] [   60] Apache Karaf :: WAR Deployer (2.0.0)
+. . .
+{noformat}
+# The Jetty server should now be listening on [http://localhost:8181/], but with no published applications available.
+{noformat}
+HTTP ERROR: 404
+NOT_FOUND
+RequestURI=/
+Powered by jetty://
+{noformat}
+
+h2. Deploying a WAR to the installed web feature
+
+The following steps will describe how to install a simple WAR file (with JSPs or Servlets) to the just installed web feature.
+# To deploy a WAR (JSP or Servlet) to Jetty, update its MANIFEST.MF to include the required OSGi headers as described here -
+\\
+[http://wiki.ops4j.org/confluence/display/ops4j/Pax+Web+Extender+-+War+-+OSGi-fy]
+# Copy the updated WAR (archive or extracted files) to the _deploy_ directory.
+
+[#top]
+
+{scrollbar}
\ No newline at end of file

Added: karaf/sandbox/website/src/main/webapp/index/documentation/karaf-users-guide/6.-advanced-uses/6.7.-configuring-failover-deployments.page
URL: http://svn.apache.org/viewvc/karaf/sandbox/website/src/main/webapp/index/documentation/karaf-users-guide/6.-advanced-uses/6.7.-configuring-failover-deployments.page?rev=1068812&view=auto
==============================================================================
--- karaf/sandbox/website/src/main/webapp/index/documentation/karaf-users-guide/6.-advanced-uses/6.7.-configuring-failover-deployments.page (added)
+++ karaf/sandbox/website/src/main/webapp/index/documentation/karaf-users-guide/6.-advanced-uses/6.7.-configuring-failover-deployments.page Wed Feb  9 09:38:50 2011
@@ -0,0 +1,116 @@
+---
+title: 6.7. Configuring Failover Deployments
+page_version: 12
+page_creator: jgoodyear
+page_modifier: gnodet
+--- pipeline:conf
+{scrollbar}
+
+{anchor:top}
+
+h1. 6.7. Configuring Failover Deployments
+
+This chapter will demonstrate how to configure failover deployments.
+
+h2. Simple lock file
+
+The simple lock file mechanism is intended for failover configurations where instances reside on the same host machine.
+
+To use this feature, edit the {{$KARAF_HOME/etc/system.properties}} file as follows on each system in the master/slave setup:
+
+{noformat}
+karaf.lock=true
+karaf.lock.class=org.apache.felix.karaf.main.SimpleFileLock
+karaf.lock.dir=<PathToLockFileDirectory>
+karaf.lock.delay=10
+{noformat}
+
+*Note*: Ensure that the {{karaf.lock.dir}} property points to the same directory for both the master and slave instance, so that the slave can only acquire the lock when the master releases it.
+
+
+h2. JDBC locking
+
+The JDBC locking mechanism is intended for failover configurations where instances exist on separate machines. In this deployment, the master instance holds a lock on a Karaf locking table hosted on a database. If the master loses the lock, a waiting slave process gains access to the locking table and fully starts its container. 
+
+To use this feature, do the following on each system in the master/slave setup:
+
+* Update the classpath to include the JDBC driver
+* Update the {{$KARAF_HOME/bin/karaf}} script to have unique JMX remote port set if instances reside on the same host
+* Update the {{$KARAF_HOME/etc/system.properties}} file as follows:
+
+{noformat}
+karaf.lock=true
+karaf.lock.class=org.apache.felix.karaf.main.DefaultJDBCLock
+karaf.lock.level=50
+karaf.lock.delay=10
+karaf.lock.jdbc.url=jdbc:derby://dbserver:1527/sample
+karaf.lock.jdbc.driver=org.apache.derby.jdbc.ClientDriver
+karaf.lock.jdbc.user=user
+karaf.lock.jdbc.password=password
+karaf.lock.jdbc.table=KARAF_LOCK
+karaf.lock.jdbc.clustername=karaf
+karaf.lock.jdbc.timeout=30
+{noformat}
+
+*Note*:
+
+* Will fail if JDBC driver is not on classpath.
+* The database name "sample" will be created if it does not exist on the database.
+* The first Karaf instance to acquire the locking table is the master instance.
+* If the connection to the database is lost, the master instance tries to gracefully shutdown, allowing a slave instance to become master when the database service is restored. The former master will require manual restart.
+
+h3. JDBC locking on Oracle
+
+If you are using Oracle as your database in a JDBC locking scenario, the {{karaf.lock.class}} property in the {{$KARAF_HOME/etc/system.properties}} file must point to {{org.apache.felix.karaf.main.OracleJDBCLock}}.
+
+Otherwise, configure the system.properties file as normal for your setup, for example:
+
+{noformat}
+karaf.lock=true
+karaf.lock.class=org.apache.felix.karaf.main.OracleJDBCLock
+karaf.lock.jdbc.url=jdbc:oracle:thin:@hostname:1521:XE
+karaf.lock.jdbc.driver=oracle.jdbc.OracleDriver
+karaf.lock.jdbc.user=user
+karaf.lock.jdbc.password=password
+karaf.lock.jdbc.table=KARAF_LOCK
+karaf.lock.jdbc.clustername=karaf
+karaf.lock.jdbc.timeout=30
+{noformat}
+
+As with the default JDBC locking setup, the Oracle JDBC driver JAR file must be in your classpath. You can ensure this by copying the {{ojdbc14.jar}} into Karaf's {{lib}} folder before starting Karaf.
+
+*Note*: The {{karaf.lock.jdbc.url}} requires an active SID, which means you must manually create a database instance before using this particular lock.
+
+{anchor:locklevel}
+
+h2. Container-level locking
+
+Container-level locking allows bundles to be preloaded into the slave kernel instance in order to provide faster failover performance. Container-level locking is supported in both the simple file and JDBC locking mechanisms.
+
+To implement container-level locking, add the following to the {{$KARAF_HOME/etc/system.properties}} file on each system in the master/slave setup:
+
+{noformat}
+karaf.lock=true
+karaf.lock.level=50
+karaf.lock.delay=10
+{noformat}
+
+The {{karaf.log.level}} property tells the Karaf instance how far up the boot process to bring the OSGi container. Bundles assigned the same start level or lower will then also be started in that Karaf instance.
+
+Bundle start levels are specified in {{$KARAF_HOME/etc/startup.properties}}, in the format {{jar.name=level}}. The core system bundles have levels below 50, where as user bundles have levels greater than 50.
+
+|| Level || Behavior ||
+| 1 | A 'cold' standby instance. Core bundles are not loaded into container. Slaves will wait until lock acquired to start server. |
+| <50 | A 'hot' standby instance. Core bundles are loaded into the container. Slaves will wait until lock acquired to start user level bundles. The console will be accessible for each slave instance at this level. |
+| >50 | This setting is not recommended as user bundles will be started. |
+
+*Note*: When using a 'hot' spare on the same host you need to set the JMX remote port to a unique value to avoid bind conflicts. You can edit the Karaf start script to include the following:
+
+{noformat}
+DEFAULT_JAVA_OPTS="-server $DEFAULT_JAVA_OPTS -Dcom.sun.management.jmxremote.port=1100 -Dcom.sun.management.jmxremote.authenticate=false"
+{noformat}
+
+
+[#top]
+
+{scrollbar}
\ No newline at end of file

Added: karaf/sandbox/website/src/main/webapp/index/documentation/karaf-users-guide/7.-optional-features.page
URL: http://svn.apache.org/viewvc/karaf/sandbox/website/src/main/webapp/index/documentation/karaf-users-guide/7.-optional-features.page?rev=1068812&view=auto
==============================================================================
--- karaf/sandbox/website/src/main/webapp/index/documentation/karaf-users-guide/7.-optional-features.page (added)
+++ karaf/sandbox/website/src/main/webapp/index/documentation/karaf-users-guide/7.-optional-features.page Wed Feb  9 09:38:50 2011
@@ -0,0 +1,15 @@
+---
+title: 7. Optional Features
+page_version: 4
+page_creator: chirino
+page_modifier: chirino
+--- pipeline:conf
+{scrollbar}
+{anchor:top}
+
+h1. 7. Optional Features
+
+{children:all}
+
+[#top]
+{scrollbar}
\ No newline at end of file

Added: karaf/sandbox/website/src/main/webapp/index/documentation/karaf-users-guide/7.-optional-features/7.1.-enabling-colorized-console-output-on-windows.page
URL: http://svn.apache.org/viewvc/karaf/sandbox/website/src/main/webapp/index/documentation/karaf-users-guide/7.-optional-features/7.1.-enabling-colorized-console-output-on-windows.page?rev=1068812&view=auto
==============================================================================
--- karaf/sandbox/website/src/main/webapp/index/documentation/karaf-users-guide/7.-optional-features/7.1.-enabling-colorized-console-output-on-windows.page (added)
+++ karaf/sandbox/website/src/main/webapp/index/documentation/karaf-users-guide/7.-optional-features/7.1.-enabling-colorized-console-output-on-windows.page Wed Feb  9 09:38:50 2011
@@ -0,0 +1,33 @@
+---
+title: 7.1. Enabling Colorized Console Output On Windows
+page_version: 3
+page_creator: chirino
+page_modifier: gnodet
+--- pipeline:conf
+{scrollbar}
+{anchor:top}
+
+h1. 7.1. Enabling Colorized Console Output On Windows
+
+The default Karaf installation does not produce colorized console output on Windows like it does on Unix based systems.  To enable it, you must install LGPL licensed library [JNA|https://jna.dev.java.net/].  This can be done using a few simple commands in the Karaf console:
+
+You first need to install the JNA library:
+{code}
+osgi:install wrap:mvn:http://download.java.net/maven/2!net.java.dev.jna/jna/3.1.0
+{code}
+
+Next you need either restart karaf or you run the following Karaf commands to refresh the Karaf Console:
+
+{code}
+osgi:list | grep "Apache Felix Karaf :: Shell Console"
+{code}
+
+Take note of the ID of the bundle, in my case it was 14 and then run:
+
+{code}
+osgi:refresh 14
+{code}
+
+
+[#top]
+{scrollbar}
\ No newline at end of file