Author: norman
Date: Thu Jun 30 13:54:51 2011
New Revision: 1141539
URL: http://svn.apache.org/viewvc?rev=1141539&view=rev
Log:
Add osgi meta-data and service declaration for queue-jms and queue-activemq.
See JAMES-835
Added:
james/server/trunk/queue-activemq/src/main/resources/
james/server/trunk/queue-activemq/src/main/resources/META-INF/
james/server/trunk/queue-activemq/src/main/resources/META-INF/spring/
james/server/trunk/queue-activemq/src/main/resources/META-INF/spring/activemq-queue-context.xml
james/server/trunk/queue-activemq/src/main/resources/META-INF/spring/activemq-queue-osgi.xml
james/server/trunk/queue-jms/src/main/resources/
james/server/trunk/queue-jms/src/main/resources/META-INF/
james/server/trunk/queue-jms/src/main/resources/META-INF/spring/
Modified:
james/server/trunk/queue-activemq/pom.xml
james/server/trunk/queue-jms/pom.xml
Modified: james/server/trunk/queue-activemq/pom.xml
URL:
http://svn.apache.org/viewvc/james/server/trunk/queue-activemq/pom.xml?rev=1141539&r1=1141538&r2=1141539&view=diff
==============================================================================
--- james/server/trunk/queue-activemq/pom.xml (original)
+++ james/server/trunk/queue-activemq/pom.xml Thu Jun 30 13:54:51 2011
@@ -27,6 +27,26 @@
<groupId>org.apache.james</groupId>
<artifactId>james-server-queue-activemq</artifactId>
<name>Apache James Server ActiveMQ Queue</name>
+ <properties>
+ <!-- OSGI stuff -->
+ <james.osgi.export>
+ org.apache.james.queue.activemq.*
+ </james.osgi.export>
+ <!-- Add the needed imports for ActiveMQ and Spring which are needed to
startup the bundle-->
+ <james.osgi.import>
+ org.apache.activemq.xbean,
+ org.apache.activemq.broker,
+ org.apache.activemq.pool,
+ org.apache.activemq.broker.region.policy,
+ org.apache.activemq.broker.jmx,
+ org.apache.activemq.store.amq,
+ org.apache.activemq.plugin,
+ org.apache.activemq.spring,
+ org.springframework.jms.connection.*,
+ org.springframework.transaction.support.*,
+ *
+ </james.osgi.import>
+ </properties>
<dependencies>
<dependency>
<groupId>org.apache.james</groupId>
Added:
james/server/trunk/queue-activemq/src/main/resources/META-INF/spring/activemq-queue-context.xml
URL:
http://svn.apache.org/viewvc/james/server/trunk/queue-activemq/src/main/resources/META-INF/spring/activemq-queue-context.xml?rev=1141539&view=auto
==============================================================================
---
james/server/trunk/queue-activemq/src/main/resources/META-INF/spring/activemq-queue-context.xml
(added)
+++
james/server/trunk/queue-activemq/src/main/resources/META-INF/spring/activemq-queue-context.xml
Thu Jun 30 13:54:51 2011
@@ -0,0 +1,100 @@
+<?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:amq="http://activemq.apache.org/schema/core"
+ xmlns:osgix="http://www.springframework.org/schema/osgi-compendium"
+ xmlns:ctx="http://www.springframework.org/schema/context"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+ http://activemq.apache.org/schema/core
http://activemq.apache.org/schema/core/activemq-core.xsd
+ http://www.springframework.org/schema/osgi-compendium
http://www.springframework.org/schema/osgi-compendium/spring-osgi-compendium.xsd
+ http://www.springframework.org/schema/context
+ http://www.springframework.org/schema/context/spring-context.xsd">
+
+ <!-- Import PostBeanProcessors -->
+ <import
resource="classpath*:org/apache/james/container/spring/server-context.xml"/>
+
+ <!-- Configuration Admin entries so the user can overwrite them if needed
-->
+ <osgix:cm-properties id="cmProps" persistent-id="org.apache.james">
+ <prop key="amq.brokerURL">vm://james?create=false</prop>
+ <prop key="amq.sessionCacheSize">10</prop>
+ <prop key="amq.baseDir">/var/store/activemq/</prop>
+ </osgix:cm-properties>
+
+ <!-- placeholder configurer -->
+ <ctx:property-placeholder properties-ref="cmProps" />
+
+ <!--
+ ===========================================================================
+ ActiveMQ Queue and Camel
+ ===========================================================================
+ -->
+
+ <!--
+ James Mail Queue Factory
+ -->
+ <bean id="mailqueuefactory"
class="org.apache.james.queue.activemq.ActiveMQMailQueueFactory"
depends-on="broker"/>
+
+ <!--
+ ActiveMQ Broker, Connections, Blob
+ -->
+ <amq:broker useJmx="true" persistent="true" brokerName="james"
dataDirectory="${amq.baseDir}/brokers" useShutdownHook="false"
schedulerSupport="false" id="broker">
+ <amq:destinationPolicy>
+ <amq:policyMap>
+ <amq:policyEntries>
+ <!-- Support priority handling of messages -->
+ <!--
http://activemq.apache.org/how-can-i-support-priority-queues.html -->
+ <amq:policyEntry queue=">" prioritizedMessages="true"/>
+ </amq:policyEntries>
+ </amq:policyMap>
+ </amq:destinationPolicy>
+ <amq:managementContext>
+ <amq:managementContext createConnector="false"/>
+ </amq:managementContext>
+ <amq:persistenceAdapter>
+ <amq:amqPersistenceAdapter/>
+ </amq:persistenceAdapter>
+ <amq:plugins>
+ <amq:statisticsBrokerPlugin/>
+ </amq:plugins>
+ <amq:transportConnectors>
+ <amq:transportConnector uri="tcp://localhost:0" />
+ </amq:transportConnectors>
+ </amq:broker>
+ <amq:connectionFactory id="amqConnectionFactory"
brokerURL="${amq.brokerURL}">
+ <amq:prefetchPolicy>
+ <!-- Disable prefetch so slow consuming can not block other
threads -->
+ <!-- See JAMES-1253 -->
+ <amq:prefetchPolicy queuePrefetch="0" topicPrefetch="0"/>
+ </amq:prefetchPolicy>
+ <property name="blobTransferPolicy" ref="blobTransferPolicy"/>
+ </amq:connectionFactory>
+ <bean id="blobTransferPolicy"
class="org.apache.james.queue.activemq.FileSystemBlobTransferPolicy">
+ <property name="defaultUploadUrl"
value="${amq.baseDir}/blob-transfer"/>
+ </bean>
+ <bean id="jmsConnectionFactory"
class="org.springframework.jms.connection.CachingConnectionFactory">
+ <property name="targetConnectionFactory" ref="amqConnectionFactory"/>
+ <property name="sessionCacheSize" value="${amq.sessionCacheSize}"/>
+ <property name="cacheConsumers" value="false"/>
+ <property name="cacheProducers" value="true"/>
+ </bean>
+ <bean id="jmsTransactionManager"
class="org.springframework.jms.connection.JmsTransactionManager">
+ <property name="connectionFactory" ref="jmsConnectionFactory"/>
+ </bean>
+
+</beans>
Added:
james/server/trunk/queue-activemq/src/main/resources/META-INF/spring/activemq-queue-osgi.xml
URL:
http://svn.apache.org/viewvc/james/server/trunk/queue-activemq/src/main/resources/META-INF/spring/activemq-queue-osgi.xml?rev=1141539&view=auto
==============================================================================
---
james/server/trunk/queue-activemq/src/main/resources/META-INF/spring/activemq-queue-osgi.xml
(added)
+++
james/server/trunk/queue-activemq/src/main/resources/META-INF/spring/activemq-queue-osgi.xml
Thu Jun 30 13:54:51 2011
@@ -0,0 +1,36 @@
+<?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="mailqueuefactory">
+ <osgi:interfaces>
+ <beans:value> org.apache.james.queue.api.MailQueueFactory</beans:value>
+ </osgi:interfaces>
+ </osgi:service>
+
+</beans:beans>
Modified: james/server/trunk/queue-jms/pom.xml
URL:
http://svn.apache.org/viewvc/james/server/trunk/queue-jms/pom.xml?rev=1141539&r1=1141538&r2=1141539&view=diff
==============================================================================
--- james/server/trunk/queue-jms/pom.xml (original)
+++ james/server/trunk/queue-jms/pom.xml Thu Jun 30 13:54:51 2011
@@ -27,8 +27,16 @@
<groupId>org.apache.james</groupId>
<artifactId>james-server-queue-jms</artifactId>
<name>Apache James Server JMS Mail Queue</name>
+ <properties>
+ <!-- OSGI stuff -->
+ <james.osgi.export>
+ org.apache.james.queue.jms*
+ </james.osgi.export>
+ <james.osgi.import>
+ *
+ </james.osgi.import>
+ </properties>
<dependencies>
-
<dependency>
<groupId>org.apache.james</groupId>
<artifactId>james-server-queue-api</artifactId>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]