jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1304475 - in /jackrabbit/oak/trunk: oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ oak-run/ oak-run/src/ oak-run/src/main/ oak-run/src/main/java/ oak-run/src/main/java/org/ oak-run/src/main/java/org/apache/ oak-run/src/main/java/org/...
Date Fri, 23 Mar 2012 16:52:08 GMT
Author: jukka
Date: Fri Mar 23 16:52:07 2012
New Revision: 1304475

URL: http://svn.apache.org/viewvc?rev=1304475&view=rev
Log:
OAK-4: Runnable jar packaging

Initial Jetty-based runnable jar that starts a WebDAV server at http://localhost:8080/

Added:
    jackrabbit/oak/trunk/oak-run/src/
    jackrabbit/oak/trunk/oak-run/src/main/
    jackrabbit/oak/trunk/oak-run/src/main/java/
    jackrabbit/oak/trunk/oak-run/src/main/java/org/
    jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/
    jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/
    jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/
    jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/
    jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java   (with
props)
Modified:
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java
    jackrabbit/oak/trunk/oak-run/pom.xml

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java?rev=1304475&r1=1304474&r2=1304475&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java
Fri Mar 23 16:52:07 2012
@@ -29,6 +29,7 @@ import javax.jcr.NamespaceRegistry;
 import javax.jcr.Repository;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
+import javax.jcr.UnsupportedRepositoryOperationException;
 import javax.jcr.Workspace;
 import javax.jcr.lock.LockManager;
 import javax.jcr.nodetype.NodeTypeManager;
@@ -140,7 +141,7 @@ public class WorkspaceImpl implements Wo
         getOakSession().checkIsAlive();
 
         // TODO
-        return null;
+        throw new UnsupportedRepositoryOperationException();
     }
 
     @Override
@@ -149,7 +150,7 @@ public class WorkspaceImpl implements Wo
         getOakSession().checkIsAlive();
 
         // TODO
-        return null;
+        throw new UnsupportedRepositoryOperationException();
     }
 
     @Override
@@ -158,7 +159,7 @@ public class WorkspaceImpl implements Wo
         getOakSession().checkSupportedOption(Repository.OPTION_VERSIONING_SUPPORTED);
 
         // TODO
-        return null;
+        throw new UnsupportedRepositoryOperationException();
     }
 
     @Override

Modified: jackrabbit/oak/trunk/oak-run/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/pom.xml?rev=1304475&r1=1304474&r2=1304475&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-run/pom.xml (original)
+++ jackrabbit/oak/trunk/oak-run/pom.xml Fri Mar 23 16:52:07 2012
@@ -35,6 +35,77 @@
 
   <properties>
     <skip.deployment>true</skip.deployment>
+    <jackrabbit.version>2.4.0</jackrabbit.version>
+    <jetty.version>8.1.2.v20120308</jetty.version>
   </properties>
 
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-shade-plugin</artifactId>
+        <version>1.6</version>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>shade</goal>
+            </goals>
+            <configuration>
+              <artifactSet>
+                <includes>
+                  <include>*</include>
+                </includes>
+              </artifactSet>
+              <filters>
+                <filter>
+                  <artifact>*</artifact>
+                  <excludes>
+                    <exclude>META-INF/*.SF</exclude>
+                    <exclude>META-INF/*.DSA</exclude>
+                    <exclude>META-INF/*.RSA</exclude>
+                  </excludes>
+                </filter>
+              </filters>
+              <transformers>
+                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
+                  <mainClass>org.apache.jackrabbit.oak.run.Main</mainClass>
+                </transformer>
+              </transformers>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.jackrabbit</groupId>
+      <artifactId>oak-jcr</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.jackrabbit</groupId>
+      <artifactId>jackrabbit-jcr-server</artifactId>
+      <version>${jackrabbit.version}</version>
+      <exclusions>
+        <exclusion>
+          <groupId>junit</groupId>
+          <artifactId>junit</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>org.eclipse.jetty</groupId>
+      <artifactId>jetty-servlet</artifactId>
+      <version>${jetty.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>ch.qos.logback</groupId>
+      <artifactId>logback-classic</artifactId>
+      <version>1.0.1</version>
+    </dependency>
+  </dependencies>
+
 </project>

Added: jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java?rev=1304475&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java (added)
+++ jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java Fri
Mar 23 16:52:07 2012
@@ -0,0 +1,63 @@
+/*
+ * 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.jackrabbit.oak.run;
+
+import java.util.Collections;
+
+import javax.jcr.Repository;
+import javax.servlet.Servlet;
+
+import org.apache.jackrabbit.oak.jcr.GlobalContext;
+import org.apache.jackrabbit.oak.jcr.configuration.OakRepositoryConfiguration;
+import org.apache.jackrabbit.oak.jcr.configuration.RepositoryConfiguration;
+import org.apache.jackrabbit.webdav.jcr.JCRWebdavServerServlet;
+import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.servlet.ServletContextHandler;
+import org.eclipse.jetty.servlet.ServletHolder;
+
+public class Main {
+
+    public static void main(String[] args) throws Exception {
+        String url = "mem:oak";
+        if (args.length > 0) {
+            url = args[0];
+        }
+
+        RepositoryConfiguration configuration =
+                OakRepositoryConfiguration.create(Collections.singletonMap(
+                        RepositoryConfiguration.MICROKERNEL_URL, url));
+        final Repository repository =
+                new GlobalContext(configuration).getInstance(Repository.class);
+        Servlet servlet = new JCRWebdavServerServlet() {
+            @Override
+            protected Repository getRepository() {
+                return repository;
+            }
+        };
+
+        ServletContextHandler context =
+                new ServletContextHandler(ServletContextHandler.SECURITY);
+        context.setContextPath("/");
+        context.addServlet(new ServletHolder(servlet),"/*");
+ 
+        Server server = new Server(8080);
+        server.setHandler(context);
+        server.start();
+        server.join();
+    }
+
+}

Propchange: jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message