Author: norman
Date: Tue Dec 14 08:23:04 2010
New Revision: 1048976

URL: http://svn.apache.org/viewvc?rev=1048976&view=rev
Log:
XMLDomainList now work when deployed via osgi. See JAMES-910

Added:
    james/server/trunk/domainlist-xml/src/main/resources/
    james/server/trunk/domainlist-xml/src/main/resources/META-INF/
    james/server/trunk/domainlist-xml/src/main/resources/META-INF/spring/
    
james/server/trunk/domainlist-xml/src/main/resources/META-INF/spring/domainlist-context.xml
    
james/server/trunk/domainlist-xml/src/main/resources/META-INF/spring/domainlist-osgi.xml
Modified:
    james/server/trunk/domainlist-library/pom.xml
    james/server/trunk/domainlist-xml/pom.xml
    
james/server/trunk/domainlist-xml/src/main/java/org/apache/james/domainlist/xml/XMLDomainList.java

Modified: james/server/trunk/domainlist-library/pom.xml
URL: 
http://svn.apache.org/viewvc/james/server/trunk/domainlist-library/pom.xml?rev=1048976&r1=1048975&r2=1048976&view=diff
==============================================================================
--- james/server/trunk/domainlist-library/pom.xml (original)
+++ james/server/trunk/domainlist-library/pom.xml Tue Dec 14 08:23:04 2010
@@ -27,6 +27,41 @@
   <groupId>org.apache.james</groupId>
   <artifactId>james-server-domainlist-library</artifactId>
   <name>Apache James Server DomainList Library</name>
+  <properties>
+    <!-- OSGI stuff -->
+    <james.osgi.export>
+      org.apache.james.*
+    </james.osgi.export>
+    <james.osgi.import>
+      *
+    </james.osgi.import>
+  </properties>
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-jar-plugin</artifactId>
+         <configuration>       
+           <archive>
+            
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
 
+            <manifest>
+              
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
+              
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+            </manifest>
+          </archive>
+        </configuration>       
+        <executions>
+          <execution>
+            <goals>
+              <goal>jar</goal>
+              <goal>test-jar</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+  
+  
   <dependencies>
     <dependency>
       <groupId>org.apache.james</groupId>

Modified: james/server/trunk/domainlist-xml/pom.xml
URL: 
http://svn.apache.org/viewvc/james/server/trunk/domainlist-xml/pom.xml?rev=1048976&r1=1048975&r2=1048976&view=diff
==============================================================================
--- james/server/trunk/domainlist-xml/pom.xml (original)
+++ james/server/trunk/domainlist-xml/pom.xml Tue Dec 14 08:23:04 2010
@@ -27,8 +27,43 @@
   <groupId>org.apache.james</groupId>
   <artifactId>james-server-domainlist-xml</artifactId>
   <name>Apache James Server DomainList XML</name>
-  <dependencies>
+  <properties>
+    <!-- OSGI stuff -->
+    <james.osgi.export>
+      org.apache.james.*
+    </james.osgi.export>
+    <!-- export domainlist api as we register our services to the interfaces 
in the package -->
+    <james.osgi.import>
+    org.apache.james.domainlist.api,
+      *
+    </james.osgi.import>
+  </properties>
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-jar-plugin</artifactId>
+         <configuration>       
+           <archive>
+            
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
 
+            <manifest>
+              
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
+              
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+            </manifest>
+          </archive>
+        </configuration>       
+        <executions>
+          <execution>
+            <goals>
+              <goal>jar</goal>
+              <goal>test-jar</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
   
+  <dependencies>
     <dependency>
       <groupId>org.apache.james</groupId>
       <artifactId>james-server-core-api</artifactId>
@@ -38,10 +73,6 @@
       <artifactId>james-server-domainlist-library</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.apache.james</groupId>
-      <artifactId>james-server-util</artifactId>
-    </dependency>
-    <dependency>
       <groupId>commons-configuration</groupId>
       <artifactId>commons-configuration</artifactId>
     </dependency>
@@ -54,22 +85,8 @@
       <artifactId>jsr250-api</artifactId>
     </dependency>    
 
-    <dependency>
-      <groupId>org.apache.geronimo.specs</groupId>
-      <artifactId>geronimo-jpa_2.0_spec</artifactId>
-    </dependency> 
     <!-- Test dependencies -->
     <dependency>
-      <groupId>commons-dbcp</groupId>
-      <artifactId>commons-dbcp</artifactId>
-      <scope>runtime</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.derby</groupId>
-      <artifactId>derby</artifactId>
-      <scope>runtime</scope>
-    </dependency>
-    <dependency>
       <groupId>org.apache.james</groupId>
       <artifactId>james-server-dnsservice-api</artifactId>
       <scope>test</scope>
@@ -82,11 +99,6 @@
       <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>org.apache.openjpa</groupId>
-      <artifactId>openjpa</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
       <scope>test</scope>

Modified: 
james/server/trunk/domainlist-xml/src/main/java/org/apache/james/domainlist/xml/XMLDomainList.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/domainlist-xml/src/main/java/org/apache/james/domainlist/xml/XMLDomainList.java?rev=1048976&r1=1048975&r2=1048976&view=diff
==============================================================================
--- 
james/server/trunk/domainlist-xml/src/main/java/org/apache/james/domainlist/xml/XMLDomainList.java
 (original)
+++ 
james/server/trunk/domainlist-xml/src/main/java/org/apache/james/domainlist/xml/XMLDomainList.java
 Tue Dec 14 08:23:04 2010
@@ -44,9 +44,9 @@ public class XMLDomainList extends Abstr
      * (non-Javadoc)
      * @see 
org.apache.james.lifecycle.Configurable#configure(org.apache.commons.configuration.HierarchicalConfiguration)
      */
-       @SuppressWarnings("unchecked")
+    @SuppressWarnings("unchecked")
     public void configure(HierarchicalConfiguration config) throws 
ConfigurationException {
-               List<String> serverNameConfs = config.getList( 
"domainnames.domainname" );
+        List<String> serverNameConfs = config.getList( 
"domainnames.domainname" );
         for ( int i = 0; i < serverNameConfs.size(); i++ ) {
             addDomainInternal( serverNameConfs.get(i));
         }

Added: 
james/server/trunk/domainlist-xml/src/main/resources/META-INF/spring/domainlist-context.xml
URL: 
http://svn.apache.org/viewvc/james/server/trunk/domainlist-xml/src/main/resources/META-INF/spring/domainlist-context.xml?rev=1048976&view=auto
==============================================================================
--- 
james/server/trunk/domainlist-xml/src/main/resources/META-INF/spring/domainlist-context.xml
 (added)
+++ 
james/server/trunk/domainlist-xml/src/main/resources/META-INF/spring/domainlist-context.xml
 Tue Dec 14 08:23:04 2010
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+    <!--
+        ! 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. !
+    -->
+
+
+<beans xmlns="http://www.springframework.org/schema/beans"; 
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+       xmlns:camel="http://camel.apache.org/schema/spring";
+       xsi:schemaLocation="http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd";>
+  
+    
+    <bean id="domainlist" 
class="org.apache.james.domainlist.xml.XMLDomainList" />
+    <bean id="domainlistmanagement" 
class="org.apache.james.domainlist.lib.DomainListManagement" />
+
+</beans>

Added: 
james/server/trunk/domainlist-xml/src/main/resources/META-INF/spring/domainlist-osgi.xml
URL: 
http://svn.apache.org/viewvc/james/server/trunk/domainlist-xml/src/main/resources/META-INF/spring/domainlist-osgi.xml?rev=1048976&view=auto
==============================================================================
--- 
james/server/trunk/domainlist-xml/src/main/resources/META-INF/spring/domainlist-osgi.xml
 (added)
+++ 
james/server/trunk/domainlist-xml/src/main/resources/META-INF/spring/domainlist-osgi.xml
 Tue Dec 14 08:23:04 2010
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans:beans                                                                   
         
+   xmlns="http://www.springframework.org/schema/osgi";                          
         
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+   xmlns:beans="http://www.springframework.org/schema/beans";             
+   xmlns:osgi="http://www.springframework.org/schema/osgi";                     
         
+   xsi:schemaLocation="http://www.springframework.org/schema/osgi  
+       http://www.springframework.org/schema/osgi/spring-osgi-1.2.xsd
+       http://www.springframework.org/schema/beans   
+       http://www.springframework.org/schema/beans/spring-beans-3.0.xsd";>      
             
+
+    <!--  export the dnsserver as osgi service -->
+    <osgi:service ref="domainlist">
+      <osgi:interfaces>
+       <beans:value>org.apache.james.domainlist.api.DomainList</beans:value>
+      </osgi:interfaces>
+    </osgi:service>
+    <osgi:service ref="domainlistmanagement">
+      <osgi:interfaces>
+       
<beans:value>org.apache.james.domainlist.api.DomainListManagementMBean</beans:value>
+      </osgi:interfaces>
+    </osgi:service>                                        
+</beans:beans>



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to