Author: deepal
Date: Thu Feb 21 00:44:16 2008
New Revision: 13943

Log:

removed unwanted jars from pom.xml
- moved RegistryServer in to test package rather than keeping that in the 
core/src

Added:
   
trunk/registry/modules/core/src/test/java/org/wso2/registry/app/RegistryServer.java
Removed:
   
trunk/registry/modules/core/src/main/java/org/wso2/registry/app/RegistryServer.java
   trunk/registry/modules/webapps/src/main/webapp/favicon.ico
Modified:
   trunk/registry/modules/core/pom.xml
   trunk/registry/pom.xml

Modified: trunk/registry/modules/core/pom.xml
==============================================================================
--- trunk/registry/modules/core/pom.xml (original)
+++ trunk/registry/modules/core/pom.xml Thu Feb 21 00:44:16 2008
@@ -148,7 +148,12 @@
         <dependency>
             <groupId>org.mortbay.jetty</groupId>
             <artifactId>jetty</artifactId>
-            <version>6.1.5</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.mortbay.jetty</groupId>
+            <artifactId>jetty-util</artifactId>
+            <scope>test</scope>
         </dependency>
     </dependencies>
 </project>

Added: 
trunk/registry/modules/core/src/test/java/org/wso2/registry/app/RegistryServer.java
==============================================================================
--- (empty file)
+++ 
trunk/registry/modules/core/src/test/java/org/wso2/registry/app/RegistryServer.java
 Thu Feb 21 00:44:16 2008
@@ -0,0 +1,92 @@
+package org.wso2.registry.app;
+
+import org.apache.abdera.protocol.server.impl.DefaultServiceContext;
+import org.apache.abdera.protocol.server.impl.AbstractSingletonProviderManager;
+import org.apache.abdera.protocol.server.servlet.AbderaServlet;
+import org.apache.abdera.protocol.server.ServiceContext;
+import org.mortbay.jetty.Server;
+import org.mortbay.jetty.servlet.Context;
+import org.mortbay.jetty.servlet.ServletHolder;
+import org.wso2.registry.servlet.RegistryServlet;
+
+/**
+ * A very simple embeddable Registry server - handles the Registry wire 
protocol (APP) but has no UI
+ * support built in.  Uses Jetty internally.
+ */
+public class RegistryServer {
+    DefaultServiceContext abderaServiceContext = new 
RegistryAPPServiceContext();
+    int port = 8081;
+    String baseURL = "/wso2registry";
+    //    Registry registry;
+    Server server;
+
+    public RegistryServer() {
+    }
+
+    public RegistryServer(int port) {
+        this.port = port;
+    }
+
+    public RegistryServer(int port, String baseURL) {
+        this.port = port;
+        this.baseURL = baseURL;
+    }
+
+    public static void main(String[] args) throws Exception {
+        RegistryServer server = new RegistryServer();
+        server.start();
+    }
+
+    public void start() throws Exception {
+        System.setProperty("in-memory", "true");
+        RegistryAPPTargetResolver resolver = new RegistryAPPTargetResolver();
+        abderaServiceContext.setTargetResolver(resolver);
+        AbstractSingletonProviderManager pm = new 
RegistryAtomProviderManager();
+        abderaServiceContext.setProviderManager(pm);
+
+        server = new Server(port);
+        Context root = new Context(server, baseURL, Context.SESSIONS);
+        root.addServlet(new ServletHolder(new RegistryServlet() {
+//            public void init() throws ServletException {
+//                super.init();
+//            }
+        }), "/resources/*");
+        root.addServlet(new ServletHolder(new AbderaServlet() {
+
+            @Override
+            protected ServiceContext createServiceContext() {
+                abderaServiceContext
+                        
.setDefaultProviderManager(RegistryAtomProviderManager.class.getName());
+                abderaServiceContext
+                        
.setDefaultTargetResolver(RegistryAPPTargetResolver.class.getName());
+                abderaServiceContext.init(getAbdera(), 
getProperties(getServletConfig()));
+                return abderaServiceContext;
+            }
+
+//            public void init() throws ServletException {
+//                super.init();
+//            }
+        }), "/atom/*");
+        server.start();
+    }
+
+    public void stop() throws Exception {
+        if (server != null) server.stop();
+    }
+
+    public int getPort() {
+        return port;
+    }
+
+    public void setPort(int port) {
+        this.port = port;
+    }
+
+    public String getBaseURL() {
+        return baseURL;
+    }
+
+    public void setBaseURL(String baseURL) {
+        this.baseURL = baseURL;
+    }
+}

Modified: trunk/registry/pom.xml
==============================================================================
--- trunk/registry/pom.xml      (original)
+++ trunk/registry/pom.xml      Thu Feb 21 00:44:16 2008
@@ -286,6 +286,11 @@
                 <artifactId>jetty</artifactId>
                 <version>${jetty.version}</version>
             </dependency>
+             <dependency>
+                <groupId>org.mortbay.jetty</groupId>
+                <artifactId>jetty-util</artifactId>
+                <version>${jetty.version}</version>
+            </dependency>
             <dependency>
                 <groupId>org.apache.ws.commons.schema</groupId>
                 <artifactId>XmlSchema</artifactId>

_______________________________________________
Registry-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/registry-dev

Reply via email to