You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by tr...@apache.org on 2015/04/08 22:27:20 UTC

svn commit: r1672164 [12/43] - in /jackrabbit/site/staging/jcr: ./ a-simple-ocm-project-with-maven-eclipse.data/ components/ concurrency-control.data/ css/ deployment-models.data/ how-jackrabbit-works.data/ how-to-map-associations-between-objects.data/...

Modified: jackrabbit/site/staging/jcr/embedded-repository.html
URL: http://svn.apache.org/viewvc/jackrabbit/site/staging/jcr/embedded-repository.html?rev=1672164&r1=1672163&r2=1672164&view=diff
==============================================================================
--- jackrabbit/site/staging/jcr/embedded-repository.html (original)
+++ jackrabbit/site/staging/jcr/embedded-repository.html Wed Apr  8 20:27:17 2015
@@ -1,146 +1,506 @@
-
-<!-- 
-  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. 
+<!DOCTYPE html>
+<!--
+ | Generated by Apache Maven Doxia at 2015-04-08 
+ | Rendered using Apache Maven Fluido Skin 1.3.1
 -->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+  <head>
+    <meta charset="UTF-8" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+    <meta name="Date-Revision-yyyymmdd" content="20150408" />
+    <meta http-equiv="Content-Language" content="en" />
+    <title>Apache Jackrabbit - Embedded Repository</title>
+    <link rel="stylesheet" href="./css/apache-maven-fluido-1.3.1.min.css" />
+    <link rel="stylesheet" href="./css/site.css" />
+    <link rel="stylesheet" href="./css/print.css" media="print" />
+
+      
+    <script type="text/javascript" src="./js/apache-maven-fluido-1.3.1.min.js"></script>
+
+    
+                  </head>
+        <body class="topBarEnabled">
+          
+    
+    
+            
+    
+    
+    <a href="http://github.com/apache/jackrabbit">
+      <img style="position: absolute; top: 0; right: 0; border: 0; z-index: 10000;"
+        src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png"
+        alt="Fork me on GitHub">
+    </a>
+  
+                
+                    
+                
+
+    <div id="topbar" class="navbar navbar-fixed-top ">
+      <div class="navbar-inner">
+                <div class="container-fluid">
+        <a data-target=".nav-collapse" data-toggle="collapse" class="btn btn-navbar">
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+        </a>
+                
+                                                                                <a class="brand" href="index.html"  title="Apache Jackrabbit">
+
+                                
+                                                                                                                    <img src="images/logos/jlogo.gif" alt="Apache Jackrabbit" />
+                
+                </a>
+                    
+                                <ul class="nav">
+                          <li class="dropdown">
+        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Apache Jackrabbit <b class="caret"></b></a>
+        <ul class="dropdown-menu">
+        
+                      <li>      <a href="index.html"  title="Welcome">Welcome</a>
+</li>
+                  
+                      <li>      <a href="downloads.html"  title="Downloads">Downloads</a>
+</li>
+                  
+                      <li>      <a href="articles.html"  title="Articles">Articles</a>
+</li>
+                  
+                      <li>      <a href="frequently-asked-questions.html"  title="FAQ">FAQ</a>
+</li>
+                  
+                      <li>      <a href="http://wiki.apache.org/jackrabbit/FrontPage"  title="Jackrabbit Wiki">Jackrabbit Wiki</a>
+</li>
+                  
+                      <li>      <a href="jackrabbit-history.html"  title="Jackrabbit History">Jackrabbit History</a>
+</li>
+                          </ul>
+      </li>
+                <li class="dropdown">
+        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Documentation <b class="caret"></b></a>
+        <ul class="dropdown-menu">
+        
+                      <li>      <a href="getting-started-with-apache-jackrabbit.html"  title="Getting Started">Getting Started</a>
+</li>
+                  
+                      <li>      <a href="standalone-server.html"  title="Standalone Server">Standalone Server</a>
+</li>
+                  
+                      <li>      <a href="jackrabbit-components.html"  title="Jackrabbit Components">Jackrabbit Components</a>
+</li>
+                  
+                      <li>      <a href="first-hops.html"  title="First Hops">First Hops</a>
+</li>
+                  
+                      <li>      <a href="jcr-api.html"  title="JCR & API">JCR & API</a>
+</li>
+                  
+                      <li>      <a href="jackrabbit-architecture.html"  title="Jackrabbit Architecture">Jackrabbit Architecture</a>
+</li>
+                  
+                      <li>      <a href="deployment-models.html"  title="Deployment Models">Deployment Models</a>
+</li>
+                  
+                      <li>      <a href="jackrabbit-configuration.html"  title="Jackrabbit Configuration">Jackrabbit Configuration</a>
+</li>
+                  
+                      <li>      <a href="node-types.html"  title="Node Types">Node Types</a>
+</li>
+                  
+                      <li>      <a href="object-content-mapping.html"  title="Object Content Mapping">Object Content Mapping</a>
+</li>
+                          </ul>
+      </li>
+                <li class="dropdown">
+        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Development <b class="caret"></b></a>
+        <ul class="dropdown-menu">
+        
+                      <li>      <a href="jackrabbit-team.html"  title="Jackrabbit Team">Jackrabbit Team</a>
+</li>
+                  
+                      <li>      <a href="jackrabbit-roadmap.html"  title="Jackrabbit Roadmap">Jackrabbit Roadmap</a>
+</li>
+                  
+                      <li>      <a href="building-jackrabbit.html"  title="Building Jackrabbit">Building Jackrabbit</a>
+</li>
+                  
+                      <li>      <a href="mailing-lists.html"  title="Mailing Lists">Mailing Lists</a>
+</li>
+                  
+                      <li>      <a href="issue-tracker.html"  title="Issue Tracker">Issue Tracker</a>
+</li>
+                  
+                      <li>      <a href="source-repository.html"  title="Source Repository">Source Repository</a>
+</li>
+                  
+                      <li>      <a href="continuous-integration.html"  title="Continuous Integration">Continuous Integration</a>
+</li>
+                  
+                      <li>      <a href="website.html"  title="Website">Website</a>
+</li>
+                  
+                      <li>      <a href="creating-releases.html"  title="Creating Releases">Creating Releases</a>
+</li>
+                  
+                      <li>      <a href="supporting-software-attribution.html"  title="Attribution">Attribution</a>
+</li>
+                  
+                      <li>      <a href="privacy-policy.html"  title="Privacy">Privacy</a>
+</li>
+                          </ul>
+      </li>
+                <li class="dropdown">
+        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Apache Software Foundation <b class="caret"></b></a>
+        <ul class="dropdown-menu">
+        
+                      <li>      <a href="http://www.apache.org/foundation/how-it-works.html"  title="Introduction">Introduction</a>
+</li>
+                  
+                      <li>      <a href="http://www.apache.org/foundation/sponsorship.html"  title="Sponsorship">Sponsorship</a>
+</li>
+                  
+                      <li>      <a href="http://www.apache.org/foundation/thanks.html"  title="Current Sponsors">Current Sponsors</a>
+</li>
+                          </ul>
+      </li>
+                  </ul>
+          
+          
+          
+                   
+                      </div>
+          
+        </div>
+      </div>
+    </div>
+    
+        <div class="container-fluid">
+          <div id="banner">
+        <div class="pull-left">
+                                <div id="bannerLeft">
+                <h2>Apache Jackrabbit Site</h2>
+                </div>
+                      </div>
+        <div class="pull-right">  </div>
+        <div class="clear"><hr/></div>
+      </div>
+
+      <div id="breadcrumbs">
+        <ul class="breadcrumb">
+                
+                    
+                  <li id="publishDate">Last Published: 2015-04-08
+                   </li>
+                      
+                
+                    
+      
+                            </ul>
+      </div>
+
+            
+      <div class="row-fluid">
+        <div id="leftColumn" class="span3">
+          <div class="well sidebar-nav">
+                
+                    
+                <ul class="nav nav-list">
+                    <li class="nav-header">Apache Jackrabbit</li>
+                              
+      <li>
+  
+                          <a href="index.html" title="Welcome">
+          <i class="none"></i>
+        Welcome</a>
+            </li>
+                
+      <li>
+  
+                          <a href="downloads.html" title="Downloads">
+          <i class="none"></i>
+        Downloads</a>
+            </li>
+                
+      <li>
+  
+                          <a href="articles.html" title="Articles">
+          <i class="none"></i>
+        Articles</a>
+            </li>
+                
+      <li>
+  
+                          <a href="frequently-asked-questions.html" title="FAQ">
+          <i class="none"></i>
+        FAQ</a>
+            </li>
+                
+      <li>
+  
+                          <a href="http://wiki.apache.org/jackrabbit/FrontPage" class="externalLink" title="Jackrabbit Wiki">
+          <i class="none"></i>
+        Jackrabbit Wiki</a>
+            </li>
+                
+      <li>
+  
+                          <a href="jackrabbit-history.html" title="Jackrabbit History">
+          <i class="none"></i>
+        Jackrabbit History</a>
+            </li>
+                              <li class="nav-header">Documentation</li>
+                              
+      <li>
+  
+                          <a href="getting-started-with-apache-jackrabbit.html" title="Getting Started">
+          <i class="none"></i>
+        Getting Started</a>
+            </li>
+                
+      <li>
+  
+                          <a href="standalone-server.html" title="Standalone Server">
+          <i class="none"></i>
+        Standalone Server</a>
+            </li>
+                
+      <li>
+  
+                          <a href="jackrabbit-components.html" title="Jackrabbit Components">
+          <i class="none"></i>
+        Jackrabbit Components</a>
+            </li>
+                
+      <li>
+  
+                          <a href="first-hops.html" title="First Hops">
+          <i class="none"></i>
+        First Hops</a>
+            </li>
+                
+      <li>
+  
+                          <a href="jcr-api.html" title="JCR & API">
+          <i class="none"></i>
+        JCR & API</a>
+            </li>
+                
+      <li>
+  
+                          <a href="jackrabbit-architecture.html" title="Jackrabbit Architecture">
+          <i class="none"></i>
+        Jackrabbit Architecture</a>
+            </li>
+                
+      <li>
+  
+                          <a href="deployment-models.html" title="Deployment Models">
+          <i class="none"></i>
+        Deployment Models</a>
+            </li>
+                
+      <li>
+  
+                          <a href="jackrabbit-configuration.html" title="Jackrabbit Configuration">
+          <i class="none"></i>
+        Jackrabbit Configuration</a>
+            </li>
+                
+      <li>
+  
+                          <a href="node-types.html" title="Node Types">
+          <i class="none"></i>
+        Node Types</a>
+            </li>
+                
+      <li>
+  
+                          <a href="object-content-mapping.html" title="Object Content Mapping">
+          <i class="none"></i>
+        Object Content Mapping</a>
+            </li>
+                              <li class="nav-header">Development</li>
+                              
+      <li>
+  
+                          <a href="jackrabbit-team.html" title="Jackrabbit Team">
+          <i class="none"></i>
+        Jackrabbit Team</a>
+            </li>
+                
+      <li>
+  
+                          <a href="jackrabbit-roadmap.html" title="Jackrabbit Roadmap">
+          <i class="none"></i>
+        Jackrabbit Roadmap</a>
+            </li>
+                
+      <li>
+  
+                          <a href="building-jackrabbit.html" title="Building Jackrabbit">
+          <i class="none"></i>
+        Building Jackrabbit</a>
+            </li>
+                
+      <li>
+  
+                          <a href="mailing-lists.html" title="Mailing Lists">
+          <i class="none"></i>
+        Mailing Lists</a>
+            </li>
+                
+      <li>
+  
+                          <a href="issue-tracker.html" title="Issue Tracker">
+          <i class="none"></i>
+        Issue Tracker</a>
+            </li>
+                
+      <li>
+  
+                          <a href="source-repository.html" title="Source Repository">
+          <i class="none"></i>
+        Source Repository</a>
+            </li>
+                
+      <li>
+  
+                          <a href="continuous-integration.html" title="Continuous Integration">
+          <i class="none"></i>
+        Continuous Integration</a>
+            </li>
+                
+      <li>
+  
+                          <a href="website.html" title="Website">
+          <i class="none"></i>
+        Website</a>
+            </li>
+                
+      <li>
+  
+                          <a href="creating-releases.html" title="Creating Releases">
+          <i class="none"></i>
+        Creating Releases</a>
+            </li>
+                
+      <li>
+  
+                          <a href="supporting-software-attribution.html" title="Attribution">
+          <i class="none"></i>
+        Attribution</a>
+            </li>
+                
+      <li>
+  
+                          <a href="privacy-policy.html" title="Privacy">
+          <i class="none"></i>
+        Privacy</a>
+            </li>
+                              <li class="nav-header">Apache Software Foundation</li>
+                              
+      <li>
+  
+                          <a href="http://www.apache.org/foundation/how-it-works.html" class="externalLink" title="Introduction">
+          <i class="none"></i>
+        Introduction</a>
+            </li>
+                
+      <li>
+  
+                          <a href="http://www.apache.org/foundation/sponsorship.html" class="externalLink" title="Sponsorship">
+          <i class="none"></i>
+        Sponsorship</a>
+            </li>
+                
+      <li>
+  
+                          <a href="http://www.apache.org/foundation/thanks.html" class="externalLink" title="Current Sponsors">
+          <i class="none"></i>
+        Current Sponsors</a>
+            </li>
+            </ul>
+                
+                    
+                
+          <hr />
+
+           <div id="poweredBy">
+                   
+    <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
+
+    
+    <div class="g-plusone" data-href="http://www.apache.org/jackrabbit-site/" data-size="tall" ></div>
+
+                   <div class="clear"></div>
+                            <div class="clear"></div>
+                            <div class="clear"></div>
+                            <div class="clear"></div>
+                             <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
+        <img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" />
+      </a>
+                  </div>
+          </div>
+        </div>
+        
+                
+        <div id="bodyColumn"  class="span9" >
+                                  
+            <!-- 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. --><h1>Embedded Repository</h1>
+<p>You can run Jackrabbit in embedded mode inside your application if you only (or mostly) access a repository from that one application. In this deployment model the Jackrabbit dependencies are included directly in your classpath and your application is in full control of the repository lifecycle. To use this deployment model you need to add the appropriate dependencies to your application and include a few lines of Jackrabbit-specific code to start and stop a repository. You can then use the standard JCR API to access and manage content inside the repository.</p>
+<p>This page describes how to embed Jackrabbit in your application.</p>
+<div class="section">
+<h2>Jackrabbit dependencies<a name="Jackrabbit_dependencies"></a></h2>
+<p>To use Jackrabbit in embedded mode you need to make sure that the JCR API and all required Jackrabbit libraries are included in your classpath. If you use <a class="externalLink" href="http://maven.apache.org/">Maven 2</a> , you can achieve this by specifying the following dependencies.</p>
+
+<div class="source">
+<pre>&lt;dependency&gt;
+  &lt;groupId&gt;javax.jcr&lt;/groupId&gt;
+  &lt;artifactId&gt;jcr&lt;/artifactId&gt;
+  &lt;version&gt;1.0&lt;/version&gt;
+&lt;/dependency&gt;
+&lt;dependency&gt;
+  &lt;groupId&gt;org.apache.jackrabbit&lt;/groupId&gt;
+  &lt;artifactId&gt;jackrabbit-core&lt;/artifactId&gt;
+  &lt;version&gt;1.5.0&lt;/version&gt;
+  &lt;exclusions&gt;
+    &lt;exclusion&gt;
+      &lt;groupId&gt;commons-logging&lt;/groupId&gt;
+      &lt;artifactId&gt;commons-logging&lt;/artifactId&gt;
+    &lt;/exclusion&gt;
+  &lt;/exclusions&gt;
+&lt;/dependency&gt;
+&lt;dependency&gt;
+  &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
+  &lt;artifactId&gt;jcl-over-slf4j&lt;/artifactId&gt;
+  &lt;version&gt;1.5.3&lt;/version&gt;
+&lt;/dependency&gt;
+&lt;dependency&gt;
+  &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
+  &lt;artifactId&gt;slf4j-log4j12&lt;/artifactId&gt;
+  &lt;version&gt;1.5.3&lt;/version&gt;
+&lt;/dependency&gt;
+</pre></div>
+<p>The jcr dependency includes the JCR 1.0 API in your classpath. You need to explicitly declare this dependency as in jackrabbit-core the JCR API dependency scope is <i>provided</i> to work better in deployment models where the JCR API is shared between multiple applications.</p>
+<p>The jackrabbit-core dependency pulls in the Jackrabbit content repository implementation and a set of transitive dependencies needed by Jackrabbit. See the <a href="downloads.html">Downloads</a>  page for the latest available version.</p>
+<p>Jackrabbit uses the <a class="externalLink" href="http://www.slf4j.org/">SLF4J</a>  for logging and leaves it up to the embedding application to decide which underlying logging library to use. In the example above we use the slf4j-log4j12 library which uses <a class="externalLink" href="http://logging.apache.org/log4j/1.2/">log4j 1.2</a>  for handling the log messages. Note that the commons-logging dependency (which is a transitive dependency from <a class="externalLink" href="http://poi.apache.org/">Apache POI</a> ) is explicitly replaced with the jcl-over-slf4j dependency that routes also all <a class="externalLink" href="http://commons.apache.org/logging/">Commons Logging</a>  log messages through the selected SLF4J implementation. Jackrabbit 1.5.x uses SLF4J version 1.5.3.</p>
+<p>The full set of compile-scope dependencies included by the above declaration is shown below. If you use a build tool like <a class="externalLink" href="http://ant.apache.org/">Ant</a>  where you need to explicitly include all dependencies, you can use this list to correctly configure your classpath.</p>
 
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<HTML>
-  <HEAD>
-    <TITLE>Embedded Repository</TITLE>
-    <LINK type="text/css" rel="stylesheet" href="http://jackrabbit.apache.org/style/site.css">
-  <META http-equiv="Content-Type" content="text/html;charset=UTF-8"></HEAD>
-  <BODY>
-    <DIV id="page">
-      <DIV id="header">
-        <P id="jcr"><A href="http://jackrabbit.apache.org/"><IMG src="http://jackrabbit.apache.org/style/jlogo.gif" alt="Apache Jackrabbit" height="100" width="336"></A></P>
-        <P id="asf"><A href="http://www.apache.org/"><IMG src="http://jackrabbit.apache.org/style/asf-logo.gif" alt="Apache Software Foundation" height="100" width="387"></A></P>
-      </DIV>
-      <DIV id="body">
-        <DIV id="navigation">
-  <UL>
-	<LI>Apache Jackrabbit
-	<UL>
-		<LI><A href="welcome-to-apache-jackrabbit.html" title="Welcome to Apache Jackrabbit">Welcome</A></LI>
-		<LI><A href="downloads.html" title="Downloads">Downloads</A></LI>
-		<LI><A href="frequently-asked-questions.html" title="Frequently Asked Questions">FAQ</A></LI>
-		<LI><A href="http://wiki.apache.org/jackrabbit/FrontPage" class="external-link">Jackrabbit Wiki</A></LI>
-		<LI><A href="jackrabbit-history.html" title="Jackrabbit History">Jackrabbit History</A></LI>
-	</UL>
-	</LI>
-	<LI>Documentation
-	<UL>
-		<LI><A href="getting-started-with-apache-jackrabbit.html" title="Getting Started with Apache Jackrabbit">Getting Started</A></LI>
-		<LI><A href="standalone-server.html" title="Standalone Server">Standalone Server</A></LI>
-		<LI><A href="jackrabbit-components.html" title="Jackrabbit Components">Jackrabbit Components</A></LI>
-		<LI><A href="first-hops.html" title="First Hops">First Hops</A></LI>
-		<LI><A href="jcr-api.html" title="JCR & API">JCR &amp; API</A></LI>
-		<LI><A href="jackrabbit-architecture.html" title="Jackrabbit Architecture">Jackrabbit Architecture</A></LI>
-		<LI><A href="deployment-models.html" title="Deployment Models">Deployment Models</A></LI>
-		<LI><A href="jackrabbit-configuration.html" title="Jackrabbit Configuration">Jackrabbit Configuration</A></LI>
-		<LI><A href="node-types.html" title="Node Types">Node Types</A></LI>
-		<LI><A href="object-content-mapping.html" title="Object Content Mapping">Object Content Mapping</A></LI>
-	</UL>
-	</LI>
-	<LI>Development
-	<UL>
-		<LI><A href="jackrabbit-team.html" title="Jackrabbit Team">Jackrabbit Team</A></LI>
-		<LI><A href="jackrabbit-roadmap.html" title="Jackrabbit Roadmap">Jackrabbit Roadmap</A></LI>
-		<LI><A href="building-jackrabbit.html" title="Building Jackrabbit">Building Jackrabbit</A></LI>
-		<LI><A href="mailing-lists.html" title="Mailing Lists">Mailing Lists</A></LI>
-		<LI><A href="issue-tracker.html" title="Issue Tracker">Issue Tracker</A></LI>
-		<LI><A href="source-repository.html" title="Source Repository">Source Repository</A></LI>
-		<LI><A href="continuous-integration.html" title="Continuous Integration">Continuous Integration</A></LI>
-		<LI><A href="website.html" title="Website">Website</A></LI>
-		<LI><A href="creating-releases.html" title="Creating Releases">Creating Releases</A></LI>
-		<LI><A href="supporting-software-attribution.html" title="Supporting software attribution">Attribution</A></LI>
-	</UL>
-	</LI>
-	<LI>Apache Software Foundation
-	<UL>
-		<LI><A href="http://www.apache.org/foundation/how-it-works.html" class="external-link">Introduction</A></LI>
-		<LI><A href="http://www.apache.org/foundation/sponsorship.html" class="external-link">Sponsorship</A></LI>
-		<LI><A href="http://www.apache.org/foundation/thanks.html" class="external-link">Current Sponsors</A></LI>
-	</UL>
-	</LI>
-</UL>
-        </DIV>
-        <DIV id="content">
-          <H1>Embedded Repository</H1>
-  <P>You can run Jackrabbit in embedded mode inside your application if you only (or mostly) access a repository from that one application. In this deployment model the Jackrabbit dependencies are included directly in your classpath and your application is in full control of the repository lifecycle. To use this deployment model you need to add the appropriate dependencies to your application and include a few lines of Jackrabbit-specific code to start and stop a repository. You can then use the standard JCR API to access and manage content inside the repository.</P>
-
-<P>This page describes how to embed Jackrabbit in your application.</P>
-
-<DIV>
-<UL>
-    <LI><A href="#EmbeddedRepository-Jackrabbitdependencies">Jackrabbit dependencies</A></LI>
-    <LI><A href="#EmbeddedRepository-Startingtherepository">Starting the repository</A></LI>
-    <LI><A href="#EmbeddedRepository-Shuttingdowntherepository">Shutting down the repository</A></LI>
-    <LI><A href="#EmbeddedRepository-TheTransientRepositoryclass">The TransientRepository class</A></LI>
-    <LI><A href="#EmbeddedRepository-Enablingremoteaccess">Enabling remote access</A></LI>
-    <LI><A href="#EmbeddedRepository-Embeddedrepositoryinawebapplication">Embedded repository in a web application</A></LI>
-</UL></DIV>
-
-<H2><A name="EmbeddedRepository-Jackrabbitdependencies"></A>Jackrabbit dependencies</H2>
-
-<P>To use Jackrabbit in embedded mode you need to make sure that the JCR API and all required Jackrabbit libraries are included in your classpath. If you use <A href="http://maven.apache.org/" class="external-link">Maven 2</A>, you can achieve this by specifying the following dependencies.</P>
-
-<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
-<PRE class="code-xml">
-<SPAN class="code-tag">&lt;dependency&gt;</SPAN>
-  <SPAN class="code-tag">&lt;groupId&gt;</SPAN>javax.jcr<SPAN class="code-tag">&lt;/groupId&gt;</SPAN>
-  <SPAN class="code-tag">&lt;artifactId&gt;</SPAN>jcr<SPAN class="code-tag">&lt;/artifactId&gt;</SPAN>
-  <SPAN class="code-tag">&lt;version&gt;</SPAN>1.0<SPAN class="code-tag">&lt;/version&gt;</SPAN>
-<SPAN class="code-tag">&lt;/dependency&gt;</SPAN>
-<SPAN class="code-tag">&lt;dependency&gt;</SPAN>
-  <SPAN class="code-tag">&lt;groupId&gt;</SPAN>org.apache.jackrabbit<SPAN class="code-tag">&lt;/groupId&gt;</SPAN>
-  <SPAN class="code-tag">&lt;artifactId&gt;</SPAN>jackrabbit-core<SPAN class="code-tag">&lt;/artifactId&gt;</SPAN>
-  <SPAN class="code-tag">&lt;version&gt;</SPAN>1.5.0<SPAN class="code-tag">&lt;/version&gt;</SPAN>
-  <SPAN class="code-tag">&lt;exclusions&gt;</SPAN>
-    <SPAN class="code-tag">&lt;exclusion&gt;</SPAN>
-      <SPAN class="code-tag">&lt;groupId&gt;</SPAN>commons-logging<SPAN class="code-tag">&lt;/groupId&gt;</SPAN>
-      <SPAN class="code-tag">&lt;artifactId&gt;</SPAN>commons-logging<SPAN class="code-tag">&lt;/artifactId&gt;</SPAN>
-    <SPAN class="code-tag">&lt;/exclusion&gt;</SPAN>
-  <SPAN class="code-tag">&lt;/exclusions&gt;</SPAN>
-<SPAN class="code-tag">&lt;/dependency&gt;</SPAN>
-<SPAN class="code-tag">&lt;dependency&gt;</SPAN>
-  <SPAN class="code-tag">&lt;groupId&gt;</SPAN>org.slf4j<SPAN class="code-tag">&lt;/groupId&gt;</SPAN>
-  <SPAN class="code-tag">&lt;artifactId&gt;</SPAN>jcl-over-slf4j<SPAN class="code-tag">&lt;/artifactId&gt;</SPAN>
-  <SPAN class="code-tag">&lt;version&gt;</SPAN>1.5.3<SPAN class="code-tag">&lt;/version&gt;</SPAN>
-<SPAN class="code-tag">&lt;/dependency&gt;</SPAN>
-<SPAN class="code-tag">&lt;dependency&gt;</SPAN>
-  <SPAN class="code-tag">&lt;groupId&gt;</SPAN>org.slf4j<SPAN class="code-tag">&lt;/groupId&gt;</SPAN>
-  <SPAN class="code-tag">&lt;artifactId&gt;</SPAN>slf4j-log4j12<SPAN class="code-tag">&lt;/artifactId&gt;</SPAN>
-  <SPAN class="code-tag">&lt;version&gt;</SPAN>1.5.3<SPAN class="code-tag">&lt;/version&gt;</SPAN>
-<SPAN class="code-tag">&lt;/dependency&gt;</SPAN>
-</PRE>
-</DIV></DIV>
-
-<P>The jcr dependency includes the JCR 1.0 API in your classpath. You need to explicitly declare this dependency as in jackrabbit-core the JCR API dependency scope is <EM>provided</EM> to work better in deployment models where the JCR API is shared between multiple applications.</P>
-
-<P>The jackrabbit-core dependency pulls in the Jackrabbit content repository implementation and a set of transitive dependencies needed by Jackrabbit. See the <A href="downloads.html" title="Downloads">Downloads</A> page for the latest available version.</P>
-
-<P>Jackrabbit uses the <A href="http://www.slf4j.org/" class="external-link">SLF4J</A> for logging and leaves it up to the embedding application to decide which underlying logging library to use. In the example above we use the slf4j-log4j12 library which uses <A href="http://logging.apache.org/log4j/1.2/" class="external-link">log4j 1.2</A> for handling the log messages. Note that the commons-logging dependency (which is a transitive dependency from <A href="http://poi.apache.org/" class="external-link">Apache POI</A>) is explicitly replaced with the jcl-over-slf4j dependency that routes also all <A href="http://commons.apache.org/logging/" class="external-link">Commons Logging</A> log messages through the selected SLF4J implementation. Jackrabbit 1.5.x uses SLF4J version 1.5.3.</P>
-
-<P>The full set of compile-scope dependencies included by the above declaration is shown below. If you use a build tool like <A href="http://ant.apache.org/" class="external-link">Ant</A> where you need to explicitly include all dependencies, you can use this list to correctly configure your classpath.</P>
-
-<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
-<PRE class="code-java">
-+- javax.jcr:jcr:jar:1.0:compile
+<div class="source">
+<pre>+- javax.jcr:jcr:jar:1.0:compile
 +- org.apache.jackrabbit:jackrabbit-core:jar:1.5.0:compile
 |  +- concurrent:concurrent:jar:1.3.4:compile
 |  +- commons-collections:commons-collections:jar:3.1:compile
@@ -164,179 +524,141 @@
 +- org.slf4j:jcl-over-slf4j:jar:1.5.3:compile
 \- org.slf4j:slf4j-log4j12:jar:1.5.3:compile
    \- log4j:log4j:jar:1.2.14:compile
-</PRE>
-</DIV></DIV>
-
-<P>Note that some of the transitive dependencies listed above may conflict with some other dependencies of our application. In such cases you may want to consider switching to a deployment model that uses separate class loaders for your application and the Jackrabbit content repository.</P>
-
-<H2><A name="EmbeddedRepository-Startingtherepository"></A>Starting the repository</H2>
+</pre></div>
+<p>Note that some of the transitive dependencies listed above may conflict with some other dependencies of our application. In such cases you may want to consider switching to a deployment model that uses separate class loaders for your application and the Jackrabbit content repository.</p></div>
+<div class="section">
+<h2>Starting the repository<a name="Starting_the_repository"></a></h2>
+<p>Once you have your classpath configured you can start the repository with the following piece of code.</p>
+
+<div class="source">
+<pre>import javax.jcr.Repository;
+import org.apache.jackrabbit.core.RepositoryImpl;
+import org.apache.jackrabbit.core.config.RepositoryConfig;
 
-<P>Once you have your classpath configured you can start the repository with the following piece of code.</P>
-
-<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
-<PRE class="code-java">
-<SPAN class="code-keyword">import</SPAN> javax.jcr.Repository;
-<SPAN class="code-keyword">import</SPAN> org.apache.jackrabbit.core.RepositoryImpl;
-<SPAN class="code-keyword">import</SPAN> org.apache.jackrabbit.core.config.RepositoryConfig;
-
-<SPAN class="code-object">String</SPAN> xml = <SPAN class="code-quote">&quot;/path/to/repository/configuration.xml&quot;</SPAN>;
-<SPAN class="code-object">String</SPAN> dir = <SPAN class="code-quote">&quot;/path/to/repository/directory&quot;</SPAN>;
+String xml = &quot;/path/to/repository/configuration.xml&quot;;
+String dir = &quot;/path/to/repository/directory&quot;;
 RepositoryConfig config = RepositoryConfig.create(xml, dir);
 Repository repository = RepositoryImpl.create(config);
-</PRE>
-</DIV></DIV>
-
-<P>See the <A href="jackrabbit-configuration.html" title="Jackrabbit Configuration">Jackrabbit Configuration</A> page for more information on repository configuration. See the <A href="http://jackrabbit.apache.org/api/1.5/org/apache/jackrabbit/core/config/RepositoryConfig.html" class="external-link">RepositoryConfig</A> and <A href="http://jackrabbit.apache.org/api/1.5/org/apache/jackrabbit/core/RepositoryImpl.html" class="external-link">RepositoryImpl</A> javadocs for more details on these classes.</P>
-
-<H2><A name="EmbeddedRepository-Shuttingdowntherepository"></A>Shutting down the repository</H2>
-
-<P>When your application no longer needs the content repository, you can shut it down with the following code.</P>
-
-<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
-<PRE class="code-java">
-((RepositoryImpl) repository).shutdown();
-</PRE>
-</DIV></DIV>
-
-<P>This will forcibly close all open sessions and make sure that all repository content is safely stored on disk.</P>
-
-<H2><A name="EmbeddedRepository-TheTransientRepositoryclass"></A>The TransientRepository class</H2>
-
-<P>Jackrabbit comes with a <A href="http://jackrabbit.apache.org/api/1.5/org/apache/jackrabbit/core/TransientRepository.html" class="external-link">TransientRepository</A> class that makes it even easier to get started with a content repository. This class is especially handy for quick prototyping, but using the RepositoryImpl class as described above gives you better control over the repository lifecycle and is typically a better alternative for production code.</P>
-
-<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
-<PRE class="code-java">
-<SPAN class="code-keyword">import</SPAN> javax.jcr.Repository;
-<SPAN class="code-keyword">import</SPAN> org.apache.jackrabbit.core.TransientRepository;
-
-Repository repository = <SPAN class="code-keyword">new</SPAN> TransientRepository();
-</PRE>
-</DIV></DIV>
-
-<P>This creates a repository instance that starts up when the first session is created and automatically shuts down when the last session is closed. By default the repository will be created in a &quot;jackrabbit&quot; subdirectory using a default configuration file in &quot;jackrabbit/repository.xml&quot;. See the TransientRepository javadocs for the ways to override these defaults.</P>
-
-<H2><A name="EmbeddedRepository-Enablingremoteaccess"></A>Enabling remote access</H2>
-
-<P>Even if you mostly use the content repository in embedded mode within your application, it may occasionally be useful to be able to access the repository for example from an external administration tool while your application is still running. You can use the jackrabbit-jcr-rmi library to make this possible. To do this, you first need to add the appropriate dependency.</P>
-
-<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
-<PRE class="code-xml">
-<SPAN class="code-tag">&lt;dependency&gt;</SPAN>
-  <SPAN class="code-tag">&lt;groupId&gt;</SPAN>org.apache.jackrabbit<SPAN class="code-tag">&lt;/groupId&gt;</SPAN>
-  <SPAN class="code-tag">&lt;artifactId&gt;</SPAN>jackrabbit-jcr-rmi<SPAN class="code-tag">&lt;/artifactId&gt;</SPAN>
-  <SPAN class="code-tag">&lt;version&gt;</SPAN>1.5.0<SPAN class="code-tag">&lt;/version&gt;</SPAN>
-<SPAN class="code-tag">&lt;/dependency&gt;</SPAN>
-</PRE>
-</DIV></DIV>
-
-<P>Make sure that you have <A href="http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/rmiregistry.html" class="external-link">rmiregistry</A> running, and use the following code to export the repository. Note that you need to include the JCR API and the jackrabbit-jcr-rmi libraries in the rmiregistry classpath for the binding to work without extra RMI codebase settings.</P>
-
-<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
-<PRE class="code-java">
-<SPAN class="code-keyword">import</SPAN> java.rmi.Naming;
-<SPAN class="code-keyword">import</SPAN> org.apache.jackrabbit.rmi.server.RemoteAdapterFactory;
-<SPAN class="code-keyword">import</SPAN> org.apache.jackrabbit.rmi.server.RemoteRepository;
-<SPAN class="code-keyword">import</SPAN> org.apache.jackrabbit.rmi.jackrabbit.JackrabbitRemoteAdapterFactory;
-
-<SPAN class="code-object">String</SPAN> url = <SPAN class="code-quote">&quot;<SPAN class="code-comment">//localhost/javax/jcr/Repository&quot;</SPAN>; // RMI URL of the repository
-</SPAN>RemoteAdapterFactory factory = <SPAN class="code-keyword">new</SPAN> JackrabbitRemoteAdapterFactory();
+</pre></div>
+<p>See the [Jackrabbit Configuration] page for more information on repository configuration. See the <a class="externalLink" href="http://jackrabbit.apache.org/api/1.5/org/apache/jackrabbit/core/config/RepositoryConfig.html">RepositoryConfig</a> and <a class="externalLink" href="http://jackrabbit.apache.org/api/1.5/org/apache/jackrabbit/core/RepositoryImpl.html">RepositoryImpl</a> javadocs for more details on these classes.</p></div>
+<div class="section">
+<h2>Shutting down the repository<a name="Shutting_down_the_repository"></a></h2>
+<p>When your application no longer needs the content repository, you can shut it down with the following code.</p>
+
+<div class="source">
+<pre>((RepositoryImpl) repository).shutdown();
+</pre></div>
+<p>This will forcibly close all open sessions and make sure that all repository content is safely stored on disk.</p></div>
+<div class="section">
+<h2>The TransientRepository class<a name="The_TransientRepository_class"></a></h2>
+<p>Jackrabbit comes with a <a class="externalLink" href="http://jackrabbit.apache.org/api/1.5/org/apache/jackrabbit/core/TransientRepository.html">TransientRepository</a>  class that makes it even easier to get started with a content repository. This class is especially handy for quick prototyping, but using the RepositoryImpl class as described above gives you better control over the repository lifecycle and is typically a better alternative for production code.</p>
+
+<div class="source">
+<pre>import javax.jcr.Repository;
+import org.apache.jackrabbit.core.TransientRepository;
+
+Repository repository = new TransientRepository();
+</pre></div>
+<p>This creates a repository instance that starts up when the first session is created and automatically shuts down when the last session is closed. By default the repository will be created in a &#x201c;jackrabbit&#x201d; subdirectory using a default configuration file in <tt>jackrabbit/repository.xml</tt>. See the TransientRepository javadocs for the ways to override these defaults.</p></div>
+<div class="section">
+<h2>Enabling remote access<a name="Enabling_remote_access"></a></h2>
+<p>Even if you mostly use the content repository in embedded mode within your application, it may occasionally be useful to be able to access the repository for example from an external administration tool while your application is still running. You can use the jackrabbit-jcr-rmi library to make this possible. To do this, you first need to add the appropriate dependency.</p>
+
+<div class="source">
+<pre>&lt;dependency&gt;
+  &lt;groupId&gt;org.apache.jackrabbit&lt;/groupId&gt;
+  &lt;artifactId&gt;jackrabbit-jcr-rmi&lt;/artifactId&gt;
+  &lt;version&gt;1.5.0&lt;/version&gt;
+&lt;/dependency&gt;
+</pre></div>
+<p>Make sure that you have <a class="externalLink" href="http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/rmiregistry.html">rmiregistry</a>  running, and use the following code to export the repository. Note that you need to include the JCR API and the jackrabbit-jcr-rmi libraries in the rmiregistry classpath for the binding to work without extra RMI codebase settings.</p>
+
+<div class="source">
+<pre>import java.rmi.Naming;
+import org.apache.jackrabbit.rmi.server.RemoteAdapterFactory;
+import org.apache.jackrabbit.rmi.server.RemoteRepository;
+import org.apache.jackrabbit.rmi.jackrabbit.JackrabbitRemoteAdapterFactory;
+
+String url = &quot;//localhost/javax/jcr/Repository&quot;; // RMI URL of the
+repository
+RemoteAdapterFactory factory = new JackrabbitRemoteAdapterFactory();
 RemoteRepository remote = factory.getRemoteRepository(repository);
 Naming.bind(url, remote);
-</PRE>
-</DIV></DIV>
-
-<P>Use the following code to remote the repository binding from the RMI registry before you shutdown the repository.</P>
+</pre></div>
+<p>Use the following code to remote the repository binding from the RMI registry before you shutdown the repository.</p>
 
-<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
-<PRE class="code-java">
-Naming.unbind(url);
-</PRE>
-</DIV></DIV>
-
-<P>You need to keep a direct reference to the RemoteRepository instance in your code until you call Naming.unbind as otherwise it could get garbage collected before a remote client connects to it.</P>
-
-<P>See the <A href="https://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=JCR&title=Repository%20Server&linkCreation=true&fromPageId=106665" class="createlink">Repository Server</A> page for instructions on how to access such a remote repository.</P>
-
-<H2><A name="EmbeddedRepository-Embeddedrepositoryinawebapplication"></A>Embedded repository in a web application</H2>
-
-<P>If your want to embed Jackrabbit in a web application, you can use the classes in the jackrabbit-jcr-servlet library to avoid the above startup and shutdown code. To do this, you first need to include jackrabbit-jcr-servlet as a dependency.</P>
-
-<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
-<PRE class="code-xml">
-<SPAN class="code-tag">&lt;dependency&gt;</SPAN>
-  <SPAN class="code-tag">&lt;groupId&gt;</SPAN>org.apache.jackrabbit<SPAN class="code-tag">&lt;/groupId&gt;</SPAN>
-  <SPAN class="code-tag">&lt;artifactId&gt;</SPAN>jackrabbit-jcr-servlet<SPAN class="code-tag">&lt;/artifactId&gt;</SPAN>
-  <SPAN class="code-tag">&lt;version&gt;</SPAN>1.5.0<SPAN class="code-tag">&lt;/version&gt;</SPAN>
-<SPAN class="code-tag">&lt;/dependency&gt;</SPAN>
-</PRE>
-</DIV></DIV>
-
-<P>Then you can instruct the servlet container to automatically start and stop the repository as a part of your webapp lifecycle by including the following servlet configuration in your web.xml file.</P>
-
-<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
-<PRE class="code-xml">
-<SPAN class="code-tag">&lt;servlet&gt;</SPAN>
-  <SPAN class="code-tag">&lt;servlet-name&gt;</SPAN>ContentRepository<SPAN class="code-tag">&lt;/servlet-name&gt;</SPAN>
-  <SPAN class="code-tag">&lt;servlet-class&gt;</SPAN>org.apache.jackrabbit.servlet.jackrabbit.JackrabbitRepositoryServlet<SPAN class="code-tag">&lt;/servlet-class&gt;</SPAN>
-  <SPAN class="code-tag">&lt;load-on-startup&gt;</SPAN>1<SPAN class="code-tag">&lt;/load-on-startup&gt;</SPAN>
-<SPAN class="code-tag">&lt;/servlet&gt;</SPAN>
-</PRE>
-</DIV></DIV>
-
-<P>See the <A href="http://jackrabbit.apache.org/api/1.5/org/apache/jackrabbit/servlet/jackrabbit/JackrabbitRepositoryServlet.html" class="external-link">JackrabbitRepositoryServlet</A> javadocs for the available configuration options.</P>
-
-<P>You can then access the repository in your own servlet classes using the following piece of code without worrying about the repository lifecycle.</P>
-
-<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
-<PRE class="code-java">
-<SPAN class="code-keyword">import</SPAN> javax.jcr.Repository;
-<SPAN class="code-keyword">import</SPAN> org.apache.jackrabbit.servlet.ServletRepository;
-
-Repository repository = <SPAN class="code-keyword">new</SPAN> ServletRepository(<SPAN class="code-keyword">this</SPAN>); <SPAN class="code-comment">// <SPAN class="code-quote">&quot;<SPAN class="code-keyword">this</SPAN>&quot;</SPAN> is the containing servlet</SPAN>
-</PRE>
-</DIV></DIV>
-
-<P>The benefit of this approach over directly using the RepositoryImpl or TransientRepository classes as described above is that you can later on switch to a different deployment model without any code changes simply by modifying the servlet configuration in your web.xml.</P>
-
-<P>With this approach it is also easier to make your repository remotely available. Add the following configuration to your web.xml and your repository is automatically made available as a remote repository at .../rmi in the URL space of your webapp.</P>
-
-<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
-<PRE class="code-xml">
-<SPAN class="code-tag">&lt;servlet&gt;</SPAN>
-  <SPAN class="code-tag">&lt;servlet-name&gt;</SPAN>RemoteRepository<SPAN class="code-tag">&lt;/servlet-name&gt;</SPAN>
-  <SPAN class="code-tag">&lt;servlet-class&gt;</SPAN>org.apache.jackrabbit.servlet.remote.RemoteBindingServlet<SPAN class="code-tag">&lt;/servlet-class&gt;</SPAN>
-<SPAN class="code-tag">&lt;/servlet&gt;</SPAN>
-<SPAN class="code-tag">&lt;servlet-mapping&gt;</SPAN>
-  <SPAN class="code-tag">&lt;servlet-name&gt;</SPAN>RemoteRepository<SPAN class="code-tag">&lt;/servlet-name&gt;</SPAN>
-  <SPAN class="code-tag">&lt;url-pattern&gt;</SPAN>/rmi<SPAN class="code-tag">&lt;/url-pattern&gt;</SPAN>
-<SPAN class="code-tag">&lt;/servlet-mapping&gt;</SPAN>
-</PRE>
-</DIV></DIV>
-
-<P>Note that you also need the jackrabbit-jcr-rmi dependency in your application for the above configuration to work.</P>
-        </DIV>
-        <DIV id="end"></DIV>
-      </DIV>
-      <DIV id="footer">
-        <P>
-          &copy; 2004-2010 The Apache Software Foundation.
-          - <A href="http://jackrabbit.apache.org/privacy-policy.html">Privacy Policy</A> -
-          [<A href="https://cwiki.apache.org/confluence/pages/editpage.action?pageId=106665">edit this page</A>]
-          <BR>
-          Apache Jackrabbit, Jackrabbit, Apache, the Apache feather logo, and the Apache
-          Jackrabbit project logo are trademarks of The Apache Software Foundation.
-        </P>
-      </DIV>
-    </DIV>
-<!-- JCR- 1315: Add Google Analytics to Jackrabbit web site -->
-<SCRIPT type="text/javascript">
-var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
-document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
-</SCRIPT>
-<SCRIPT type="text/javascript">
-var pageTracker = _gat._getTracker("UA-837900-2");
-pageTracker._initData();
-pageTracker._trackPageview();
-</SCRIPT>
-  </BODY>
-</HTML>
+<div class="source">
+<pre>Naming.unbind(url);
+</pre></div>
+<p>You need to keep a direct reference to the RemoteRepository instance in your code until you call Naming.unbind as otherwise it could get garbage collected before a remote client connects to it.</p>
+<p>See the <a href="repository-server.html">Repository Server</a> page for instructions on how to access such a remote repository.</p></div>
+<div class="section">
+<h2>Embedded repository in a web application<a name="Embedded_repository_in_a_web_application"></a></h2>
+<p>If your want to embed Jackrabbit in a web application, you can use the classes in the jackrabbit-jcr-servlet library to avoid the above startup and shutdown code. To do this, you first need to include jackrabbit-jcr-servlet as a dependency.</p>
+
+<div class="source">
+<pre>&lt;dependency&gt;
+  &lt;groupId&gt;org.apache.jackrabbit&lt;/groupId&gt;
+  &lt;artifactId&gt;jackrabbit-jcr-servlet&lt;/artifactId&gt;
+  &lt;version&gt;1.5.0&lt;/version&gt;
+&lt;/dependency&gt;
+</pre></div>
+<p>Then you can instruct the servlet container to automatically start and stop the repository as a part of your webapp lifecycle by including the following servlet configuration in your web.xml file.</p>
+
+<div class="source">
+<pre>&lt;servlet&gt;
+    &lt;servlet-name&gt;ContentRepository&lt;/servlet-name&gt;
+    &lt;servlet-class&gt;org.apache.jackrabbit.servlet.jackrabbit.JackrabbitRepositoryServlet&lt;/servlet-class&gt;
+    &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
+&lt;/servlet&gt;
+</pre></div>
+<p>See the <a class="externalLink" href="http://jackrabbit.apache.org/api/1.5/org/apache/jackrabbit/servlet/jackrabbit/JackrabbitRepositoryServlet.html">JackrabbitRepositoryServlet</a>  javadocs for the available configuration options.</p>
+<p>You can then access the repository in your own servlet classes using the following piece of code without worrying about the repository lifecycle.</p>
+
+<div class="source">
+<pre>import javax.jcr.Repository;
+import org.apache.jackrabbit.servlet.ServletRepository;
+</pre></div>
+<p>Repository repository = new ServletRepository(this); // &#x201c;this&#x201d; is the containing servlet</p>
+<p>The benefit of this approach over directly using the RepositoryImpl or TransientRepository classes as described above is that you can later on switch to a different deployment model without any code changes simply by modifying the servlet configuration in your web.xml.</p>
+<p>With this approach it is also easier to make your repository remotely available. Add the following configuration to your web.xml and your repository is automatically made available as a remote repository at &#x2026;/rmi in the URL space of your webapp.</p>
+
+<div class="source">
+<pre>&lt;servlet&gt;
+    &lt;servlet-name&gt;RemoteRepository&lt;/servlet-name&gt;
+    &lt;servlet-class&gt;org.apache.jackrabbit.servlet.remote.RemoteBindingServlet&lt;/servlet-class&gt;
+&lt;/servlet&gt;
+&lt;servlet-mapping&gt;
+    &lt;servlet-name&gt;RemoteRepository&lt;/servlet-name&gt;
+    &lt;url-pattern&gt;/rmi&lt;/url-pattern&gt;
+&lt;/servlet-mapping&gt;
+</pre></div>
+<p>Note that you also need the jackrabbit-jcr-rmi dependency in your application for the above configuration to work.</p></div>
+                  </div>
+            </div>
+          </div>
+
+    <hr/>
+
+    <footer>
+            <div class="container-fluid">
+                      <div class="row-fluid">
+                              <p >Copyright &copy;                    2015
+                        <a href="http://www.apache.org/">The Apache Software Foundation</a>.
+            All rights reserved.      
+                    
+      </p>
+        </div>
+
+        
+        
+          
+    
+    
+    <div id="ohloh" class="pull-right">
+      <script type="text/javascript" src="http://www.ohloh.net/p/jackrabbit/widgets/project_users_logo.js"></script>
+    </div>
+        </div>
+    </footer>
+        </body>
+</html>
\ No newline at end of file

Added: jackrabbit/site/staging/jcr/favicon.ico
URL: http://svn.apache.org/viewvc/jackrabbit/site/staging/jcr/favicon.ico?rev=1672164&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/site/staging/jcr/favicon.ico
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream