Author: norman
Date: Tue Jun 28 05:53:26 2011
New Revision: 1140444
URL: http://svn.apache.org/viewvc?rev=1140444&view=rev
Log:
Remove the osgi module as it is not needed. Also make sure that the
container-spring bundle register the provided services. Still work in progress.
See JAMES-835
Added:
james/server/trunk/container-spring/src/main/java/org/apache/james/container/spring/filesystem/ResourceLoaderFileSystem.java
james/server/trunk/container-spring/src/main/resources/META-INF/spring/loaders-context.xml
james/server/trunk/container-spring/src/main/resources/META-INF/spring/loaders-osgi.xml
james/server/trunk/container-spring/src/main/resources/org/
james/server/trunk/container-spring/src/main/resources/org/apache/
james/server/trunk/container-spring/src/main/resources/org/apache/james/
james/server/trunk/container-spring/src/main/resources/org/apache/james/container/
james/server/trunk/container-spring/src/main/resources/org/apache/james/container/spring/
james/server/trunk/container-spring/src/main/resources/org/apache/james/container/spring/server-context.xml
Removed:
james/server/trunk/container-spring/src/main/resources/META-INF/spring/extender/
james/server/trunk/osgi/
Modified:
james/server/trunk/container-spring/pom.xml
james/server/trunk/dnsservice-dnsjava/src/main/resources/META-INF/spring/dns-context.xml
james/server/trunk/pom.xml
Modified: james/server/trunk/container-spring/pom.xml
URL:
http://svn.apache.org/viewvc/james/server/trunk/container-spring/pom.xml?rev=1140444&r1=1140443&r2=1140444&view=diff
==============================================================================
--- james/server/trunk/container-spring/pom.xml (original)
+++ james/server/trunk/container-spring/pom.xml Tue Jun 28 05:53:26 2011
@@ -41,6 +41,9 @@
!org.springframework.web.*,
*
</james.osgi.import>
+ <james.osgi.dynamic>
+ *
+ </james.osgi.dynamic>
</properties>
Added:
james/server/trunk/container-spring/src/main/java/org/apache/james/container/spring/filesystem/ResourceLoaderFileSystem.java
URL:
http://svn.apache.org/viewvc/james/server/trunk/container-spring/src/main/java/org/apache/james/container/spring/filesystem/ResourceLoaderFileSystem.java?rev=1140444&view=auto
==============================================================================
---
james/server/trunk/container-spring/src/main/java/org/apache/james/container/spring/filesystem/ResourceLoaderFileSystem.java
(added)
+++
james/server/trunk/container-spring/src/main/java/org/apache/james/container/spring/filesystem/ResourceLoaderFileSystem.java
Tue Jun 28 05:53:26 2011
@@ -0,0 +1,62 @@
+/****************************************************************
+ * 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.james.container.spring.filesystem;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.apache.james.filesystem.api.FileSystem;
+import org.springframework.context.ResourceLoaderAware;
+import org.springframework.core.io.ResourceLoader;
+
+public class ResourceLoaderFileSystem implements FileSystem,
ResourceLoaderAware{
+
+ private ResourceLoader loader;
+
+ @Override
+ public InputStream getResource(String url) throws IOException {
+ return loader.getResource(url).getInputStream();
+ }
+
+ @Override
+ public File getFile(String fileURL) throws FileNotFoundException {
+ try {
+ return loader.getResource(fileURL).getFile();
+ } catch (IOException e) {
+ throw new FileNotFoundException("Could not load file " + fileURL);
+ }
+ }
+
+ @Override
+ public File getBasedir() throws FileNotFoundException {
+ try {
+ return loader.getResource(".").getFile();
+ } catch (IOException e) {
+ throw new FileNotFoundException("Could not access basedirectory");
+ }
+ }
+
+ @Override
+ public void setResourceLoader(ResourceLoader loader) {
+ this.loader = loader;
+ }
+
+}
Added:
james/server/trunk/container-spring/src/main/resources/META-INF/spring/loaders-context.xml
URL:
http://svn.apache.org/viewvc/james/server/trunk/container-spring/src/main/resources/META-INF/spring/loaders-context.xml?rev=1140444&view=auto
==============================================================================
---
james/server/trunk/container-spring/src/main/resources/META-INF/spring/loaders-context.xml
(added)
+++
james/server/trunk/container-spring/src/main/resources/META-INF/spring/loaders-context.xml
Tue Jun 28 05:53:26 2011
@@ -0,0 +1,48 @@
+<?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">
+
+ <!-- Import PostBeanProcessors -->
+ <import
resource="classpath*:org/apache/james/container/spring/server-context.xml"/>
+
+ <!--
+ Mailet and Matcher "Bean-Factory".
+ -->
+ <bean id="mailetloader"
class="org.apache.james.container.spring.bean.factory.mailetcontainer.MailetLoaderBeanFactory"
/>
+ <bean id="matcherloader"
class="org.apache.james.container.spring.bean.factory.mailetcontainer.MatcherLoaderBeanFactory"
/>
+
+ <!--
+ ===========================================================================
+ Mail Protocol Servers
+ ===========================================================================
+ -->
+ <bean id="protocolhandlerloader"
class="org.apache.james.container.spring.bean.factory.protocols.ProtocolHandlerLoaderBeanFactory"
/>
+
+
+ <!--
+
+ -->
+ <bean id="filesystem"
class="org.apache.james.container.spring.filesystem.ResourceLoaderFileSystem" />
+
+</beans>
Added:
james/server/trunk/container-spring/src/main/resources/META-INF/spring/loaders-osgi.xml
URL:
http://svn.apache.org/viewvc/james/server/trunk/container-spring/src/main/resources/META-INF/spring/loaders-osgi.xml?rev=1140444&view=auto
==============================================================================
---
james/server/trunk/container-spring/src/main/resources/META-INF/spring/loaders-osgi.xml
(added)
+++
james/server/trunk/container-spring/src/main/resources/META-INF/spring/loaders-osgi.xml
Tue Jun 28 05:53:26 2011
@@ -0,0 +1,51 @@
+<?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: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">
+
+ <osgi:service ref="matcherloader">
+ <osgi:interfaces>
+
<beans:value>org.apache.james.mailetcontainer.api.MatcherLoader</beans:value>
+ </osgi:interfaces>
+ </osgi:service>
+ <osgi:service ref="mailetloader">
+ <osgi:interfaces>
+
<beans:value>org.apache.james.mailetcontainer.api.MailetLoader</beans:value>
+ </osgi:interfaces>
+ </osgi:service>
+
+ <osgi:service ref="protocolhandlerloader">
+ <osgi:interfaces>
+
<beans:value>org.apache.james.protocols.api.ProtocolHandlerLoader</beans:value>
+ </osgi:interfaces>
+ </osgi:service>
+ <osgi:service ref="filesystem">
+ <osgi:interfaces>
+ <beans:value>org.apache.james.filesystem.api.FileSystem</beans:value>
+ </osgi:interfaces>
+ </osgi:service>
+</beans:beans>
Added:
james/server/trunk/container-spring/src/main/resources/org/apache/james/container/spring/server-context.xml
URL:
http://svn.apache.org/viewvc/james/server/trunk/container-spring/src/main/resources/org/apache/james/container/spring/server-context.xml?rev=1140444&view=auto
==============================================================================
---
james/server/trunk/container-spring/src/main/resources/org/apache/james/container/spring/server-context.xml
(added)
+++
james/server/trunk/container-spring/src/main/resources/org/apache/james/container/spring/server-context.xml
Tue Jun 28 05:53:26 2011
@@ -0,0 +1,68 @@
+<?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"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
+
+ <!--
+ ===========================================================================
+ Annotation - Bean Post-Processors
+ ===========================================================================
+ -->
+
+ <!--
+ Enable Java Annotations processing.
+ -->
+ <bean
class="org.springframework.context.annotation.CommonAnnotationBeanPostProcessor">
+ <property name="order" value="3" />
+ </bean>
+
+ <!--
+ Spring "Bean-Post-Processor" for LogEnabled interface.
+ -->
+ <bean
class="org.apache.james.container.spring.bean.postprocessor.LogEnabledBeanPostProcessor">
+ <property name="logProvider" ref="logprovider" />
+ <property name="order" value="0" />
+ </bean>
+ <bean id="logprovider"
class="org.apache.james.container.spring.provider.log.LogProviderImpl">
+ </bean>
+
+ <!--
+ Spring "Bean-Post-Processor" for Configurable interface.
+ -->
+ <bean
class="org.apache.james.container.spring.bean.postprocessor.ConfigurableBeanPostProcessor">
+ <property name="configurationProvider" ref="configurationprovider" />
+ <property name="order" value="1" />
+ </bean>
+ <bean id="configurationprovider"
class="org.apache.james.container.spring.provider.configuration.ConfigurationProviderImpl">
+ <!--
+ <property name="configurationMappings">
+ <map>
+ <entry key="mailprocessor" value="mailetcontainer.processors"/>
+ <entry key="mailspooler" value="mailetcontainer.spooler"/>
+ <entry key="mailetcontext" value="mailetcontainer.context"/>
+ </map>
+ </property>
+ -->
+ </bean>
+
+
+</beans>
Modified:
james/server/trunk/dnsservice-dnsjava/src/main/resources/META-INF/spring/dns-context.xml
URL:
http://svn.apache.org/viewvc/james/server/trunk/dnsservice-dnsjava/src/main/resources/META-INF/spring/dns-context.xml?rev=1140444&r1=1140443&r2=1140444&view=diff
==============================================================================
---
james/server/trunk/dnsservice-dnsjava/src/main/resources/META-INF/spring/dns-context.xml
(original)
+++
james/server/trunk/dnsservice-dnsjava/src/main/resources/META-INF/spring/dns-context.xml
Tue Jun 28 05:53:26 2011
@@ -20,6 +20,8 @@
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">
+ <!-- Import PostBeanProcessors -->
+ <import
resource="classpath*:org/apache/james/container/spring/server-context.xml"/>
<bean id="dnsservice"
class="org.apache.james.dnsservice.dnsjava.DNSJavaService" />
Modified: james/server/trunk/pom.xml
URL:
http://svn.apache.org/viewvc/james/server/trunk/pom.xml?rev=1140444&r1=1140443&r2=1140444&view=diff
==============================================================================
--- james/server/trunk/pom.xml (original)
+++ james/server/trunk/pom.xml Tue Jun 28 05:53:26 2011
@@ -60,7 +60,6 @@
<module>mailetcontainer-camel</module>
<module>mailets</module>
<module>protocols-library</module>
- <module>osgi</module>
<module>pop3server</module>
<module>smtpserver</module>
<module>queue-api</module>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]