directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r209552 - in /directory/sandbox/trunk/osgi-core/trunk/apacheds: project.properties project.xml src/main/java/org/apache/ldap/server/Activator.java
Date Thu, 07 Jul 2005 00:50:11 GMT
Author: erodriguez
Date: Wed Jul  6 17:50:10 2005
New Revision: 209552

URL: http://svn.apache.org/viewcvs?rev=209552&view=rev
Log:
OSGi wrapper and Maven build files for ApacheDS core.

Added:
    directory/sandbox/trunk/osgi-core/trunk/apacheds/project.properties
    directory/sandbox/trunk/osgi-core/trunk/apacheds/project.xml
    directory/sandbox/trunk/osgi-core/trunk/apacheds/src/main/java/org/apache/ldap/server/Activator.java

Added: directory/sandbox/trunk/osgi-core/trunk/apacheds/project.properties
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/osgi-core/trunk/apacheds/project.properties?rev=209552&view=auto
==============================================================================
--- directory/sandbox/trunk/osgi-core/trunk/apacheds/project.properties (added)
+++ directory/sandbox/trunk/osgi-core/trunk/apacheds/project.properties Wed Jul  6 17:50:10
2005
@@ -0,0 +1 @@
+module.path=apache-osgi-directory

Added: directory/sandbox/trunk/osgi-core/trunk/apacheds/project.xml
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/osgi-core/trunk/apacheds/project.xml?rev=209552&view=auto
==============================================================================
--- directory/sandbox/trunk/osgi-core/trunk/apacheds/project.xml (added)
+++ directory/sandbox/trunk/osgi-core/trunk/apacheds/project.xml Wed Jul  6 17:50:10 2005
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+  <extend>${basedir}/../project.xml</extend>
+  <pomVersion>3</pomVersion>
+  <groupId>apache</groupId>
+  <artifactId>apache-store</artifactId>
+  <name>Apache Backing Store</name>
+  <currentVersion>0.1.1</currentVersion>
+  <properties>
+    <osgi.export.package>org.apache.ldap.common.util,org.apache.ldap.common.message.spi,org.apache.ldap.common,org.apache.ldap.common.message,org.apache.ldap.common.exception,org.apache.ldap.common.filter</osgi.export.package>
+    <osgi.import.package>org.apache.ldap.common.berlib.asn1,org.osgi.framework,org.apache.asn1.codec,org.apache.asn1.codec.stateful</osgi.import.package>
+  </properties>
+  <inceptionYear>2005</inceptionYear>
+  <package>org.apache.store</package>
+  <shortDescription>Apache Backing Store</shortDescription>
+  <description>Apache Backing Store</description>
+  <dependencies>
+    <dependency>
+      <groupId>regexp</groupId>
+      <artifactId>regexp</artifactId>
+      <version>1.2</version>
+      <url>http://jakarta.apache.org/regexp/index.html</url>
+      <properties>
+        <osgi.jar.bundle>true</osgi.jar.bundle>
+      </properties>
+    </dependency>
+    <dependency>
+      <groupId>oro</groupId>
+      <artifactId>oro</artifactId>
+      <version>2.0.7</version>
+      <url>http://jakarta.apache.org/oro</url>
+      <properties>
+        <osgi.jar.bundle>true</osgi.jar.bundle>
+      </properties>
+    </dependency>
+    <dependency>
+      <groupId>commons-lang</groupId>
+      <artifactId>commons-lang</artifactId>
+      <version>2.0</version>
+      <url>http://jakarta.apache.org/commons/lang/api</url>
+    </dependency>
+    <dependency>
+      <groupId>commons-logging</groupId>
+      <artifactId>commons-logging</artifactId>
+      <version>1.0</version>
+      <url>http://jakarta.apache.org/commons/logging</url>
+    </dependency>
+    <dependency>
+      <groupId>commons-collections</groupId>
+      <artifactId>commons-collections</artifactId>
+      <version>3.0</version>
+      <url>http://jakarta.apache.org/commons/collections</url>
+    </dependency>
+    <dependency>
+      <groupId>commons-primitives</groupId>
+      <artifactId>commons-primitives</artifactId>
+      <version>20041207.202534</version>
+      <url>http://jakarta.apache.org/commons/primitives</url>
+    </dependency>
+    <dependency>
+      <groupId>aspectj</groupId>
+      <artifactId>aspectjrt</artifactId>
+      <version>1.2</version>
+      <properties>
+        <osgi.jar.bundle>true</osgi.jar.bundle>
+      </properties>
+    </dependency>
+    <dependency>
+      <groupId>antlr</groupId>
+      <artifactId>antlr</artifactId>
+      <version>2.7.2</version>
+      <url>http://antlr.org/</url>
+      <properties>
+        <osgi.jar.bundle>true</osgi.jar.bundle>
+      </properties>
+    </dependency>
+    <dependency>
+      <groupId>jdbm</groupId>
+      <artifactId>jdbm</artifactId>
+      <version>0.20-dev</version>
+      <url>http://jdbm.sourceforge.net</url>
+      <properties>
+        <osgi.jar.bundle>true</osgi.jar.bundle>
+      </properties>
+    </dependency>
+    <dependency>
+      <groupId>directory-shared</groupId>
+      <artifactId>ldap-common</artifactId>
+      <version>0.9-SNAPSHOT</version>
+      <properties>
+        <osgi.jar.bundle>true</osgi.jar.bundle>
+      </properties>
+    </dependency>
+    <dependency>
+      <groupId>directory</groupId>
+      <artifactId>apacheds-core</artifactId>
+      <version>0.9-SNAPSHOT</version>
+      <properties>
+        <osgi.jar.bundle>true</osgi.jar.bundle>
+      </properties>
+    </dependency>
+    <dependency>
+      <groupId>directory</groupId>
+      <artifactId>apacheds-shared</artifactId>
+      <version>0.9-SNAPSHOT</version>
+      <properties>
+        <osgi.jar.bundle>true</osgi.jar.bundle>
+      </properties>
+    </dependency>
+  </dependencies>
+</project>
+

Added: directory/sandbox/trunk/osgi-core/trunk/apacheds/src/main/java/org/apache/ldap/server/Activator.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/osgi-core/trunk/apacheds/src/main/java/org/apache/ldap/server/Activator.java?rev=209552&view=auto
==============================================================================
--- directory/sandbox/trunk/osgi-core/trunk/apacheds/src/main/java/org/apache/ldap/server/Activator.java
(added)
+++ directory/sandbox/trunk/osgi-core/trunk/apacheds/src/main/java/org/apache/ldap/server/Activator.java
Wed Jul  6 17:50:10 2005
@@ -0,0 +1,121 @@
+/*
+ *   Copyright 2005 The Apache Software Foundation
+ *
+ *   Licensed 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.ldap.server;
+
+import java.util.Dictionary;
+import java.util.Hashtable;
+
+import javax.naming.NamingException;
+import javax.naming.spi.InitialContextFactory;
+
+import org.apache.ldap.server.jndi.CoreContextFactory;
+import org.apache.ldap.server.jndi.EnvKeys;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.ServiceRegistration;
+
+
+public class Activator implements BundleActivator
+{
+    private InitialContextFactory factory = null;
+    private ServiceRegistration registration = null;
+    
+    /**
+     * Implements BundleActivator.start().
+     * Logs that this service is starting and starts this service.
+     * @param context the framework context for the bundle.
+     */
+    public void start( BundleContext context ) throws BundleException
+    {
+        System.out.println( "Starting Apache Backing Store." );
+        
+        // Get absolute path
+        // File dataFile = context.getDataFile( "store" );
+        
+        factory = new CoreContextFactory();
+        
+        Hashtable env = new Hashtable();
+        loadEnvironment( env );
+        
+        try
+        {
+            factory.getInitialContext( env );
+            Dictionary parameters = new Hashtable();
+            registration = context.registerService( InitialContextFactory.class.getName(),
factory, parameters );
+        }
+        catch (NamingException ne)
+        {
+            ne.printStackTrace();
+            throw new BundleException( "Initial context load failed." );
+        }
+    }
+    
+    /**
+     * Implements BundleActivator.stop().
+     * Logs that this service has stopped.
+     * @param context the framework context for the bundle.
+     */
+    public void stop( BundleContext context ) throws BundleException
+    {
+        System.out.println( "Stopping Apache Backing Store." );
+        
+        Hashtable env = new Hashtable();
+        env.put( EnvKeys.SHUTDOWN, "true" );
+        
+        try
+        {
+            factory.getInitialContext( env );
+        }
+        catch (NamingException ne)
+        {
+            ne.printStackTrace();
+            throw new BundleException( "Initial context shutdown failed." );
+        }
+        
+        factory = null;
+        
+        registration.unregister();
+        registration = null;
+    }
+    
+    private void loadEnvironment( Hashtable env )
+    {
+        env.put( "java.naming.provider.url", "dc=example,dc=com" );
+        env.put( "java.naming.security.principal", "uid=admin,ou=system" );
+        env.put( "java.naming.security.authentication", "simple" );
+        env.put( "java.naming.security.credentials", "secret" );
+        env.put( "java.naming.factory.initial", "org.apache.ldap.server.jndi.CoreContextFactory"
);
+        
+        env.put( "server.db.partitions", "apache example" );
+        
+        env.put( "server.db.partition.suffix.apache", "dc=apache,dc=org" );
+        env.put( "server.db.partition.indices.apache", "objectClass ou uid" );
+        env.put( "server.db.partition.attributes.apache.objectClass", "top domain extensibleObject"
);
+        env.put( "server.db.partition.attributes.apache.dc", "apache" );
+        
+        env.put( "server.db.partition.suffix.example", "dc=example,dc=com" );
+        env.put( "server.db.partition.indices.example", "ou uid objectClass krb5PrincipalName"
);
+        env.put( "server.db.partition.attributes.example.dc", "example" );
+        env.put( "server.db.partition.attributes.example.objectClass", "top domain example"
);
+        
+        env.put( "server.wkdir", "./target/eve" );
+        env.put( "server.schemas", "org.apache.ldap.server.schema.bootstrap.SystemSchema
org.apache.ldap.server.schema.bootstrap.ApacheSchema org.apache.ldap.server.schema.bootstrap.CoreSchema
org.apache.ldap.server.schema.bootstrap.CosineSchema org.apache.ldap.server.schema.bootstrap.InetorgpersonSchema
org.apache.ldap.server.schema.bootstrap.Krb5kdcSchema" );
+    }
+}
+



Mime
View raw message