jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1331880 - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/mk/client/ oak-core/src/main/java/org/apache/jackrabbit/mk/server/ oak-core/src/test/java/org/apache/jackrabbit/mk/server/ oak-core/src/test/resources/META-IN...
Date Sun, 29 Apr 2012 08:59:06 GMT
Author: jukka
Date: Sun Apr 29 08:59:04 2012
New Revision: 1331880

URL: http://svn.apache.org/viewvc?rev=1331880&view=rev
Log:
OAK-57: Cleanup o.a.j.mk from oak-core

Move .mk.client and .mk.server from oak-core to oak-mk

Added:
    jackrabbit/oak/trunk/oak-it/mk/src/test/java/org/apache/jackrabbit/mk/test/ClientServerFixture.java
      - copied, changed from r1331855, jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/server/ClientServerFixture.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/client/
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/client/Client.java
      - copied, changed from r1331855, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/client/Client.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/client/HttpExecutor.java
      - copied, changed from r1331855, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/client/HttpExecutor.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/client/Request.java
      - copied, changed from r1331855, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/client/Request.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/server/
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/server/BoundaryInputStream.java
      - copied, changed from r1331855, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/server/BoundaryInputStream.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/server/FileServlet.java
      - copied, changed from r1331855, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/server/FileServlet.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/server/HttpProcessor.java
      - copied, changed from r1331855, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/server/HttpProcessor.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/server/MicroKernelServlet.java
      - copied, changed from r1331855, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/server/MicroKernelServlet.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/server/Request.java
      - copied, changed from r1331855, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/server/Request.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/server/Response.java
      - copied, changed from r1331855, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/server/Response.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/server/Server.java
      - copied, changed from r1331855, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/server/Server.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/server/Servlet.java
      - copied, changed from r1331855, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/server/Servlet.java
    jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/server/
    jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/server/BoundaryInputStreamTest.java
      - copied, changed from r1331855, jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/server/BoundaryInputStreamTest.java
    jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/MicroKernelServer.java
Removed:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/client/Client.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/client/HttpExecutor.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/client/Request.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/server/BoundaryInputStream.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/server/FileServlet.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/server/HttpProcessor.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/server/MicroKernelServlet.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/server/Request.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/server/Response.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/server/Server.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/server/Servlet.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/server/BoundaryInputStreamTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/server/ClientServerFixture.java
Modified:
    jackrabbit/oak/trunk/oak-core/src/test/resources/META-INF/services/org.apache.jackrabbit.mk.test.MicroKernelFixture
    jackrabbit/oak/trunk/oak-it/mk/src/test/resources/META-INF/services/org.apache.jackrabbit.mk.test.MicroKernelFixture
    jackrabbit/oak/trunk/oak-mk/pom.xml
    jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java

Modified: jackrabbit/oak/trunk/oak-core/src/test/resources/META-INF/services/org.apache.jackrabbit.mk.test.MicroKernelFixture
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/resources/META-INF/services/org.apache.jackrabbit.mk.test.MicroKernelFixture?rev=1331880&r1=1331879&r2=1331880&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/resources/META-INF/services/org.apache.jackrabbit.mk.test.MicroKernelFixture
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/resources/META-INF/services/org.apache.jackrabbit.mk.test.MicroKernelFixture
Sun Apr 29 08:59:04 2012
@@ -13,5 +13,4 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-org.apache.jackrabbit.mk.server.ClientServerFixture
 #org.apache.jackrabbit.mk.simple.SimpleKernelImplFixture

Copied: jackrabbit/oak/trunk/oak-it/mk/src/test/java/org/apache/jackrabbit/mk/test/ClientServerFixture.java
(from r1331855, jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/server/ClientServerFixture.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-it/mk/src/test/java/org/apache/jackrabbit/mk/test/ClientServerFixture.java?p2=jackrabbit/oak/trunk/oak-it/mk/src/test/java/org/apache/jackrabbit/mk/test/ClientServerFixture.java&p1=jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/server/ClientServerFixture.java&r1=1331855&r2=1331880&rev=1331880&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/server/ClientServerFixture.java
(original)
+++ jackrabbit/oak/trunk/oak-it/mk/src/test/java/org/apache/jackrabbit/mk/test/ClientServerFixture.java
Sun Apr 29 08:59:04 2012
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jackrabbit.mk.server;
+package org.apache.jackrabbit.mk.test;
 
 import java.io.IOException;
 import java.net.InetSocketAddress;
@@ -22,6 +22,7 @@ import java.net.InetSocketAddress;
 import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.apache.jackrabbit.mk.client.Client;
 import org.apache.jackrabbit.mk.core.MicroKernelImpl;
+import org.apache.jackrabbit.mk.server.Server;
 import org.apache.jackrabbit.mk.test.MicroKernelFixture;
 
 public class ClientServerFixture implements MicroKernelFixture {

Modified: jackrabbit/oak/trunk/oak-it/mk/src/test/resources/META-INF/services/org.apache.jackrabbit.mk.test.MicroKernelFixture
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-it/mk/src/test/resources/META-INF/services/org.apache.jackrabbit.mk.test.MicroKernelFixture?rev=1331880&r1=1331879&r2=1331880&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-it/mk/src/test/resources/META-INF/services/org.apache.jackrabbit.mk.test.MicroKernelFixture
(original)
+++ jackrabbit/oak/trunk/oak-it/mk/src/test/resources/META-INF/services/org.apache.jackrabbit.mk.test.MicroKernelFixture
Sun Apr 29 08:59:04 2012
@@ -14,3 +14,4 @@
 #  limitations under the License.
 
 org.apache.jackrabbit.mk.test.MicroKernelImplFixture
+org.apache.jackrabbit.mk.test.ClientServerFixture

Modified: jackrabbit/oak/trunk/oak-mk/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/pom.xml?rev=1331880&r1=1331879&r2=1331880&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/pom.xml (original)
+++ jackrabbit/oak/trunk/oak-mk/pom.xml Sun Apr 29 08:59:04 2012
@@ -43,6 +43,7 @@
               org.apache.jackrabbit.mk.json,
               org.apache.jackrabbit.mk.util,
               org.apache.jackrabbit.mk.core,
+              org.apache.jackrabbit.mk.client,
               org.apache.jackrabbit.mk.blobs
             </Export-Package>
             <Bundle-Activator>

Copied: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/client/Client.java
(from r1331855, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/client/Client.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/client/Client.java?p2=jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/client/Client.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/client/Client.java&r1=1331855&r2=1331880&rev=1331880&view=diff
==============================================================================
    (empty)

Copied: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/client/HttpExecutor.java
(from r1331855, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/client/HttpExecutor.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/client/HttpExecutor.java?p2=jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/client/HttpExecutor.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/client/HttpExecutor.java&r1=1331855&r2=1331880&rev=1331880&view=diff
==============================================================================
    (empty)

Copied: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/client/Request.java
(from r1331855, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/client/Request.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/client/Request.java?p2=jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/client/Request.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/client/Request.java&r1=1331855&r2=1331880&rev=1331880&view=diff
==============================================================================
    (empty)

Copied: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/server/BoundaryInputStream.java
(from r1331855, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/server/BoundaryInputStream.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/server/BoundaryInputStream.java?p2=jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/server/BoundaryInputStream.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/server/BoundaryInputStream.java&r1=1331855&r2=1331880&rev=1331880&view=diff
==============================================================================
    (empty)

Copied: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/server/FileServlet.java
(from r1331855, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/server/FileServlet.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/server/FileServlet.java?p2=jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/server/FileServlet.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/server/FileServlet.java&r1=1331855&r2=1331880&rev=1331880&view=diff
==============================================================================
    (empty)

Copied: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/server/HttpProcessor.java
(from r1331855, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/server/HttpProcessor.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/server/HttpProcessor.java?p2=jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/server/HttpProcessor.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/server/HttpProcessor.java&r1=1331855&r2=1331880&rev=1331880&view=diff
==============================================================================
    (empty)

Copied: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/server/MicroKernelServlet.java
(from r1331855, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/server/MicroKernelServlet.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/server/MicroKernelServlet.java?p2=jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/server/MicroKernelServlet.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/server/MicroKernelServlet.java&r1=1331855&r2=1331880&rev=1331880&view=diff
==============================================================================
    (empty)

Copied: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/server/Request.java
(from r1331855, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/server/Request.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/server/Request.java?p2=jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/server/Request.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/server/Request.java&r1=1331855&r2=1331880&rev=1331880&view=diff
==============================================================================
    (empty)

Copied: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/server/Response.java
(from r1331855, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/server/Response.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/server/Response.java?p2=jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/server/Response.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/server/Response.java&r1=1331855&r2=1331880&rev=1331880&view=diff
==============================================================================
    (empty)

Copied: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/server/Server.java
(from r1331855, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/server/Server.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/server/Server.java?p2=jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/server/Server.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/server/Server.java&r1=1331855&r2=1331880&rev=1331880&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/server/Server.java
(original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/server/Server.java
Sun Apr 29 08:59:04 2012
@@ -32,7 +32,6 @@ import java.util.concurrent.atomic.Atomi
 
 import javax.net.ServerSocketFactory;
 
-import org.apache.jackrabbit.mk.MicroKernelFactory;
 import org.apache.jackrabbit.mk.api.MicroKernel;
 
 /**
@@ -242,31 +241,4 @@ public class Server {
         }
     }
 
-    public static void main(String[] args) throws Exception {
-        if (args.length == 0) {
-            System.out.println(String.format("usage: %s microkernel-url [port] [bindaddr]",
-                    Server.class.getName()));
-            return;
-        }
-
-        MicroKernel mk = MicroKernelFactory.getInstance(args[0]);
-
-        final Server server = new Server(mk);
-        if (args.length >= 2) {
-            server.setPort(Integer.parseInt(args[1]));
-        } else {
-            server.setPort(28080);
-        }
-        if (args.length >= 3) {
-            server.setBindAddress(InetAddress.getByName(args[2]));
-        }
-        server.start();
-
-        Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
-            @Override
-            public void run() {
-                server.stop();
-            }
-        }, "ShutdownHook"));
-    }
 }

Copied: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/server/Servlet.java
(from r1331855, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/server/Servlet.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/server/Servlet.java?p2=jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/server/Servlet.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/server/Servlet.java&r1=1331855&r2=1331880&rev=1331880&view=diff
==============================================================================
    (empty)

Copied: jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/server/BoundaryInputStreamTest.java
(from r1331855, jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/server/BoundaryInputStreamTest.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/server/BoundaryInputStreamTest.java?p2=jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/server/BoundaryInputStreamTest.java&p1=jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/server/BoundaryInputStreamTest.java&r1=1331855&r2=1331880&rev=1331880&view=diff
==============================================================================
    (empty)

Modified: 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=1331880&r1=1331879&r2=1331880&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java (original)
+++ jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java Sun
Apr 29 08:59:04 2012
@@ -33,8 +33,14 @@ public class Main {
     public static void main(String[] args) throws Exception {
         printProductInfo();
 
-        HttpServer httpServer = new HttpServer(URI, args);
-        httpServer.start();
+        if (args.length > 0 && "mk".equals(args[0])) {
+            String[] newArgs = new String[args.length - 1];
+            System.arraycopy(args, 1, newArgs, 0, newArgs.length);
+            MicroKernelServer.main(newArgs);
+        } else {
+            HttpServer httpServer = new HttpServer(URI, args);
+            httpServer.start();
+        }
     }
 
     private static void printProductInfo() {

Added: jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/MicroKernelServer.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/MicroKernelServer.java?rev=1331880&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/MicroKernelServer.java
(added)
+++ jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/MicroKernelServer.java
Sun Apr 29 08:59:04 2012
@@ -0,0 +1,55 @@
+/*
+ * 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.net.InetAddress;
+
+import org.apache.jackrabbit.mk.MicroKernelFactory;
+import org.apache.jackrabbit.mk.api.MicroKernel;
+import org.apache.jackrabbit.mk.server.Server;
+
+public class MicroKernelServer {
+
+    public static void main(String[] args) throws Exception {
+        if (args.length == 0) {
+            System.out.format("usage: %s microkernel-url [port] [bindaddr]%n",
+                    MicroKernelServer.class.getName());
+            return;
+        }
+
+        MicroKernel mk = MicroKernelFactory.getInstance(args[0]);
+
+        final Server server = new Server(mk);
+        if (args.length >= 2) {
+            server.setPort(Integer.parseInt(args[1]));
+        } else {
+            server.setPort(28080);
+        }
+        if (args.length >= 3) {
+            server.setBindAddress(InetAddress.getByName(args[2]));
+        }
+        server.start();
+
+        Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
+            @Override
+            public void run() {
+                server.stop();
+            }
+        }, "ShutdownHook"));
+    }
+
+}



Mime
View raw message