directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r209554 - in /directory/sandbox/trunk/osgi-core/trunk/network: project.properties project.xml src/main/java/org/apache/mina/Activator.java
Date Thu, 07 Jul 2005 00:52:34 GMT
Author: erodriguez
Date: Wed Jul  6 17:52:32 2005
New Revision: 209554

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

Added:
    directory/sandbox/trunk/osgi-core/trunk/network/project.properties
    directory/sandbox/trunk/osgi-core/trunk/network/project.xml
    directory/sandbox/trunk/osgi-core/trunk/network/src/main/java/org/apache/mina/Activator.java

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

Added: directory/sandbox/trunk/osgi-core/trunk/network/project.xml
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/osgi-core/trunk/network/project.xml?rev=209554&view=auto
==============================================================================
--- directory/sandbox/trunk/osgi-core/trunk/network/project.xml (added)
+++ directory/sandbox/trunk/osgi-core/trunk/network/project.xml Wed Jul  6 17:52:32 2005
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+  <extend>${basedir}/../project.xml</extend>
+  <pomVersion>3</pomVersion>
+  <groupId>apache</groupId>
+  <artifactId>apache-mina</artifactId>
+  <name>Apache MINA Network Service Registry</name>
+  <currentVersion>0.1.1</currentVersion>
+  <properties>
+    <osgi.import.package>org.osgi.framework,org.apache.asn1.codec,org.apache.asn1.codec.stateful,org.apache.ldap.common.message,org.apache.ldap.common.message.spi</osgi.import.package>
+    <osgi.export.package>org.apache.mina,org.apache.mina.registry,org.apache.mina.protocol,org.apache.mina.protocol.codec,org.apache.mina.common</osgi.export.package>
+  </properties>
+  <inceptionYear>2005</inceptionYear>
+  <package>org.apache.mina</package>
+  <shortDescription>Apache MINA Network Service Registry</shortDescription>
+  <description>Apache MINA Network Service Registry</description>
+  <dependencies>
+    <dependency>
+      <groupId>directory-network</groupId>
+      <artifactId>mina</artifactId>
+      <version>0.7-SNAPSHOT</version>
+      <properties>
+        <osgi.jar.bundle>true</osgi.jar.bundle>
+      </properties>
+    </dependency>
+  </dependencies>
+</project>
+

Added: directory/sandbox/trunk/osgi-core/trunk/network/src/main/java/org/apache/mina/Activator.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/osgi-core/trunk/network/src/main/java/org/apache/mina/Activator.java?rev=209554&view=auto
==============================================================================
--- directory/sandbox/trunk/osgi-core/trunk/network/src/main/java/org/apache/mina/Activator.java
(added)
+++ directory/sandbox/trunk/osgi-core/trunk/network/src/main/java/org/apache/mina/Activator.java
Wed Jul  6 17:52:32 2005
@@ -0,0 +1,74 @@
+/*
+ *   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.mina;
+
+import java.io.IOException;
+import java.util.Dictionary;
+import java.util.Hashtable;
+
+import org.apache.mina.registry.ServiceRegistry;
+import org.apache.mina.registry.SimpleServiceRegistry;
+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 ServiceRegistry registry;
+    private ServiceRegistration registration;
+    
+    /**
+     * 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 MINA Service Registry." );
+        
+        try
+        {
+            registry = new SimpleServiceRegistry();
+        }
+	    catch (IOException ioe)
+	    {
+	        throw new BundleException( "Failed to start MINA Service Registry." );
+	    }
+        
+        Dictionary parameters = new Hashtable();
+        registration = context.registerService( ServiceRegistry.class.getName(), registry,
parameters );
+    }
+    
+    /**
+     * Implements BundleActivator.stop().
+     * Logs that this service has stopped.
+     * @param context the framework context for the bundle.
+     */
+    public void stop( BundleContext context )
+    {
+        System.out.println( "Stopping Apache MINA Service Registry." );
+        
+        registration.unregister();
+        registration = null;
+        
+        registry = null;
+    }
+}
+



Mime
View raw message