Return-Path: X-Original-To: apmail-activemq-commits-archive@www.apache.org Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3DC38D419 for ; Fri, 18 Jan 2013 10:12:42 +0000 (UTC) Received: (qmail 82915 invoked by uid 500); 18 Jan 2013 10:12:41 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 81923 invoked by uid 500); 18 Jan 2013 10:12:40 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 81887 invoked by uid 99); 18 Jan 2013 10:12:39 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Jan 2013 10:12:39 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Jan 2013 10:12:33 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 027222388900; Fri, 18 Jan 2013 10:12:13 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1435065 - in /activemq/trunk: activemq-karaf-itest/src/test/java/org/apache/activemq/karaf/itest/ activemq-karaf-itest/src/test/resources/org/apache/activemq/karaf/itest/ activemq-karaf/ activemq-karaf/src/main/java/org/apache/activemq/kar... Date: Fri, 18 Jan 2013 10:12:12 -0000 To: commits@activemq.apache.org From: dejanb@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130118101213.027222388900@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dejanb Date: Fri Jan 18 10:12:11 2013 New Revision: 1435065 URL: http://svn.apache.org/viewvc?rev=1435065&view=rev Log: https://issues.apache.org/jira/browse/AMQ-4034 -first step on fixing features and creating a osgi service factory for the broker Added: activemq/trunk/activemq-karaf-itest/src/test/resources/org/apache/activemq/karaf/itest/activemq.xml activemq/trunk/activemq-karaf-itest/src/test/resources/org/apache/activemq/karaf/itest/org.apache.activemq.server-default.cfg activemq/trunk/activemq-karaf/src/main/java/org/apache/activemq/karaf/ActiveMQServiceFactory.java activemq/trunk/activemq-karaf/src/main/resources/META-INF/ activemq/trunk/activemq-karaf/src/main/resources/META-INF/spring.schemas activemq/trunk/activemq-osgi/src/ activemq/trunk/activemq-osgi/src/main/ activemq/trunk/activemq-osgi/src/main/resources/ activemq/trunk/activemq-osgi/src/main/resources/META-INF/ activemq/trunk/activemq-osgi/src/main/resources/META-INF/spring.schemas Modified: activemq/trunk/activemq-karaf-itest/src/test/java/org/apache/activemq/karaf/itest/AbstractFeatureTest.java activemq/trunk/activemq-karaf/pom.xml activemq/trunk/activemq-karaf/src/main/resources/OSGI-INF/blueprint/activemq-karaf.xml activemq/trunk/activemq-karaf/src/main/resources/features.xml activemq/trunk/activemq-osgi/pom.xml activemq/trunk/activemq-spring/pom.xml Modified: activemq/trunk/activemq-karaf-itest/src/test/java/org/apache/activemq/karaf/itest/AbstractFeatureTest.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-karaf-itest/src/test/java/org/apache/activemq/karaf/itest/AbstractFeatureTest.java?rev=1435065&r1=1435064&r2=1435065&view=diff ============================================================================== --- activemq/trunk/activemq-karaf-itest/src/test/java/org/apache/activemq/karaf/itest/AbstractFeatureTest.java (original) +++ activemq/trunk/activemq-karaf-itest/src/test/java/org/apache/activemq/karaf/itest/AbstractFeatureTest.java Fri Jan 18 10:12:11 2013 @@ -170,6 +170,8 @@ public abstract class AbstractFeatureTes // override the config.properties (to fix pax-exam bug) replaceConfigurationFile("etc/config.properties", new File(basedir+"/src/test/resources/org/apache/activemq/karaf/itest/config.properties")), replaceConfigurationFile("etc/custom.properties", new File(basedir+"/src/test/resources/org/apache/activemq/karaf/itest/custom.properties")), + replaceConfigurationFile("etc/org.apache.activemq.server-default.cfg", new File(basedir+"/src/test/resources/org/apache/activemq/karaf/itest/org.apache.activemq.server-default.cfg")), + replaceConfigurationFile("etc/activemq.xml", new File(basedir+"/src/test/resources/org/apache/activemq/karaf/itest/activemq.xml")), scanFeatures(getActiveMQKarafFeatureUrl(), f.toArray(new String[f.size()]))}; return options; Added: activemq/trunk/activemq-karaf-itest/src/test/resources/org/apache/activemq/karaf/itest/activemq.xml URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-karaf-itest/src/test/resources/org/apache/activemq/karaf/itest/activemq.xml?rev=1435065&view=auto ============================================================================== --- activemq/trunk/activemq-karaf-itest/src/test/resources/org/apache/activemq/karaf/itest/activemq.xml (added) +++ activemq/trunk/activemq-karaf-itest/src/test/resources/org/apache/activemq/karaf/itest/activemq.xml Fri Jan 18 10:12:11 2013 @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Added: activemq/trunk/activemq-karaf-itest/src/test/resources/org/apache/activemq/karaf/itest/org.apache.activemq.server-default.cfg URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-karaf-itest/src/test/resources/org/apache/activemq/karaf/itest/org.apache.activemq.server-default.cfg?rev=1435065&view=auto ============================================================================== --- activemq/trunk/activemq-karaf-itest/src/test/resources/org/apache/activemq/karaf/itest/org.apache.activemq.server-default.cfg (added) +++ activemq/trunk/activemq-karaf-itest/src/test/resources/org/apache/activemq/karaf/itest/org.apache.activemq.server-default.cfg Fri Jan 18 10:12:11 2013 @@ -0,0 +1,3 @@ +broker-name=localhost +data=${karaf.data}/localhost +config=${karaf.base}/etc/activemq.xml \ No newline at end of file Modified: activemq/trunk/activemq-karaf/pom.xml URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-karaf/pom.xml?rev=1435065&r1=1435064&r2=1435065&view=diff ============================================================================== --- activemq/trunk/activemq-karaf/pom.xml (original) +++ activemq/trunk/activemq-karaf/pom.xml Fri Jan 18 10:12:11 2013 @@ -170,7 +170,7 @@ ${project.artifactId} - org.apache.activemq.karaf.commands;version=${project.version};-split-package:=merge-first + org.apache.activemq.karaf*;version=${project.version};-split-package:=merge-first org.apache.felix.gogo.commands, * Added: activemq/trunk/activemq-karaf/src/main/java/org/apache/activemq/karaf/ActiveMQServiceFactory.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-karaf/src/main/java/org/apache/activemq/karaf/ActiveMQServiceFactory.java?rev=1435065&view=auto ============================================================================== --- activemq/trunk/activemq-karaf/src/main/java/org/apache/activemq/karaf/ActiveMQServiceFactory.java (added) +++ activemq/trunk/activemq-karaf/src/main/java/org/apache/activemq/karaf/ActiveMQServiceFactory.java Fri Jan 18 10:12:11 2013 @@ -0,0 +1,102 @@ +/** + * 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.activemq.karaf; + +import org.apache.activemq.broker.BrokerService; +import org.apache.activemq.spring.Utils; +import org.apache.xbean.spring.context.ResourceXmlApplicationContext; +import org.osgi.framework.BundleContext; +import org.osgi.service.cm.ConfigurationException; +import org.osgi.service.cm.ManagedServiceFactory; +import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; +import org.springframework.core.io.Resource; + +import java.util.Arrays; +import java.util.Dictionary; +import java.util.HashMap; +import java.util.Map; + +public class ActiveMQServiceFactory implements ManagedServiceFactory { + + BundleContext bundleContext; + HashMap brokers = new HashMap(); + + @Override + public String getName() { + return "ActiveMQ Server Controller"; + } + + @Override + public void updated(String pid, Dictionary properties) throws ConfigurationException { + String config = (String)properties.get("config"); + if (config == null) { + throw new ConfigurationException("config", "Property must be set"); + } + String name = (String)properties.get("broker-name"); + if (config == null) { + throw new ConfigurationException("broker-name", "Property must be set"); + } + try { + Thread.currentThread().setContextClassLoader(BrokerService.class.getClassLoader()); + Resource resource = Utils.resourceFromString(config); + ResourceXmlApplicationContext ctx = new ResourceXmlApplicationContext((resource)) { + protected void initBeanDefinitionReader(XmlBeanDefinitionReader reader) { + reader.setValidating(false); + } + }; + + BrokerService broker = ctx.getBean(BrokerService.class); + if (broker == null) { + throw new ConfigurationException(null, "Broker not defined"); + } + //TODO deal with multiple brokers + + + broker.start(); + broker.waitUntilStarted(); + brokers.put(pid, broker); + + + } catch (Exception e) { + throw new ConfigurationException(null, "Cannot start the broker", e); + } + } + + @Override + public void deleted(String pid) { + BrokerService broker = brokers.get(pid); + if (broker == null) { + //TODO LOG + return; + } + try { + broker.stop(); + broker.waitUntilStopped(); + } catch (Exception e) { + //TODO LOG + e.printStackTrace(); + } + } + + public BundleContext getBundleContext() { + return bundleContext; + } + + public void setBundleContext(BundleContext bundleContext) { + this.bundleContext = bundleContext; + } +} Added: activemq/trunk/activemq-karaf/src/main/resources/META-INF/spring.schemas URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-karaf/src/main/resources/META-INF/spring.schemas?rev=1435065&view=auto ============================================================================== --- activemq/trunk/activemq-karaf/src/main/resources/META-INF/spring.schemas (added) +++ activemq/trunk/activemq-karaf/src/main/resources/META-INF/spring.schemas Fri Jan 18 10:12:11 2013 @@ -0,0 +1,36 @@ +## --------------------------------------------------------------------------- +## 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. +## --------------------------------------------------------------------------- +http\://activemq.org/config/1.0=activemq.xsd +http\://activemq.org/config/1.0/1.0.xsd=activemq.xsd +http\://activemq.apache.org/schema/core=activemq.xsd +http\://activemq.apache.org/schema/core/activemq-core.xsd=activemq.xsd +http\://activemq.apache.org/schema/core/activemq-core-5.0.0.xsd=activemq.xsd +http\://activemq.apache.org/schema/core/activemq-core-5.1.0.xsd=activemq.xsd +http\://activemq.apache.org/schema/core/activemq-core-5.2.0.xsd=activemq.xsd +http\://activemq.apache.org/schema/core/activemq-core-5.3.0.xsd=activemq.xsd +http\://activemq.apache.org/schema/core/activemq-core-5.3.1.xsd=activemq.xsd +http\://activemq.apache.org/schema/core/activemq-core-5.3.2.xsd=activemq.xsd +http\://activemq.apache.org/schema/core/activemq-core-5.4.0.xsd=activemq.xsd +http\://activemq.apache.org/schema/core/activemq-core-5.4.1.xsd=activemq.xsd +http\://activemq.apache.org/schema/core/activemq-core-5.4.2.xsd=activemq.xsd +http\://activemq.apache.org/schema/core/activemq-core-5.5.0.xsd=activemq.xsd +http\://activemq.apache.org/schema/core/activemq-core-5.5.1.xsd=activemq.xsd +http\://activemq.apache.org/schema/core/activemq-core-5.6.0.xsd=activemq.xsd +http\://activemq.apache.org/schema/core/activemq-core-5.7.0.xsd=activemq.xsd +http\://activemq.apache.org/schema/core/activemq-core-5.8.0.xsd=activemq.xsd +http\://activemq.apache.org/schema/core/activemq-core-5.9.0.xsd=activemq.xsd +http\://activemq.apache.org/schema/core/activemq-core-5.10.0.xsd=activemq.xsd Modified: activemq/trunk/activemq-karaf/src/main/resources/OSGI-INF/blueprint/activemq-karaf.xml URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-karaf/src/main/resources/OSGI-INF/blueprint/activemq-karaf.xml?rev=1435065&r1=1435064&r2=1435065&view=diff ============================================================================== --- activemq/trunk/activemq-karaf/src/main/resources/OSGI-INF/blueprint/activemq-karaf.xml (original) +++ activemq/trunk/activemq-karaf/src/main/resources/OSGI-INF/blueprint/activemq-karaf.xml Fri Jan 18 10:12:11 2013 @@ -20,6 +20,16 @@ + + + + + + + + + + Modified: activemq/trunk/activemq-karaf/src/main/resources/features.xml URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-karaf/src/main/resources/features.xml?rev=1435065&r1=1435064&r2=1435065&view=diff ============================================================================== --- activemq/trunk/activemq-karaf/src/main/resources/features.xml (original) +++ activemq/trunk/activemq-karaf/src/main/resources/features.xml Fri Jan 18 10:12:11 2013 @@ -67,6 +67,9 @@ mvn:org.fusesource.hawtbuf/hawtbuf-proto/${hawtbuf-version} mvn:org.codehaus.jackson/jackson-core-asl/${jackson-version} mvn:org.codehaus.jackson/jackson-mapper-asl/${jackson-version} + spring31 + mvn:org.apache.xbean/xbean-spring/${xbean-version} + mvn:org.apache.activemq/activemq-karaf/${project.version} Modified: activemq/trunk/activemq-osgi/pom.xml URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-osgi/pom.xml?rev=1435065&r1=1435064&r2=1435065&view=diff ============================================================================== --- activemq/trunk/activemq-osgi/pom.xml (original) +++ activemq/trunk/activemq-osgi/pom.xml Fri Jan 18 10:12:11 2013 @@ -94,11 +94,71 @@ ${project.groupId} activemq-camel + + + ${project.groupId} + activemq-jaas + + + + ${project.groupId} + activemq-console + + + + ${project.groupId} + activemq-ra + + + + ${project.groupId} + activemq-spring + + + org.apache.xbean + maven-xbean-plugin + 3.12 + + + process-classes + + + ${basedir}/../activemq-client/src/main/java + ${basedir}/../activemq-broker/src/main/java + ${basedir}/../activemq-leveldb-store/src/main/java + ${basedir}/../activemq-jdbc-store/src/main/java + ${basedir}/../activemq-amq-store/src/main/java + ${basedir}/../activemq-kahadb-store/src/main/java + ${basedir}/../activemq-mqtt/src/main/java + ${basedir}/../activemq-stomp/src/main/java + ${basedir}/../activemq-spring/src/main/java + + false + http://activemq.apache.org/schema/core + ${basedir}/target/classes/activemq.xsd + ${basedir}/target/classes + false + org.apache.activemq.broker.jmx.AnnotatedMBean,org.apache.activemq.broker.jmx.DestinationViewMBean + + + mapping + + + + + + com.thoughtworks.qdox + qdox + 1.12 + + + + org.apache.felix maven-bundle-plugin Added: activemq/trunk/activemq-osgi/src/main/resources/META-INF/spring.schemas URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-osgi/src/main/resources/META-INF/spring.schemas?rev=1435065&view=auto ============================================================================== --- activemq/trunk/activemq-osgi/src/main/resources/META-INF/spring.schemas (added) +++ activemq/trunk/activemq-osgi/src/main/resources/META-INF/spring.schemas Fri Jan 18 10:12:11 2013 @@ -0,0 +1,36 @@ +## --------------------------------------------------------------------------- +## 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. +## --------------------------------------------------------------------------- +http\://activemq.org/config/1.0=activemq.xsd +http\://activemq.org/config/1.0/1.0.xsd=activemq.xsd +http\://activemq.apache.org/schema/core=activemq.xsd +http\://activemq.apache.org/schema/core/activemq-core.xsd=activemq.xsd +http\://activemq.apache.org/schema/core/activemq-core-5.0.0.xsd=activemq.xsd +http\://activemq.apache.org/schema/core/activemq-core-5.1.0.xsd=activemq.xsd +http\://activemq.apache.org/schema/core/activemq-core-5.2.0.xsd=activemq.xsd +http\://activemq.apache.org/schema/core/activemq-core-5.3.0.xsd=activemq.xsd +http\://activemq.apache.org/schema/core/activemq-core-5.3.1.xsd=activemq.xsd +http\://activemq.apache.org/schema/core/activemq-core-5.3.2.xsd=activemq.xsd +http\://activemq.apache.org/schema/core/activemq-core-5.4.0.xsd=activemq.xsd +http\://activemq.apache.org/schema/core/activemq-core-5.4.1.xsd=activemq.xsd +http\://activemq.apache.org/schema/core/activemq-core-5.4.2.xsd=activemq.xsd +http\://activemq.apache.org/schema/core/activemq-core-5.5.0.xsd=activemq.xsd +http\://activemq.apache.org/schema/core/activemq-core-5.5.1.xsd=activemq.xsd +http\://activemq.apache.org/schema/core/activemq-core-5.6.0.xsd=activemq.xsd +http\://activemq.apache.org/schema/core/activemq-core-5.7.0.xsd=activemq.xsd +http\://activemq.apache.org/schema/core/activemq-core-5.8.0.xsd=activemq.xsd +http\://activemq.apache.org/schema/core/activemq-core-5.9.0.xsd=activemq.xsd +http\://activemq.apache.org/schema/core/activemq-core-5.10.0.xsd=activemq.xsd Modified: activemq/trunk/activemq-spring/pom.xml URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-spring/pom.xml?rev=1435065&r1=1435064&r2=1435065&view=diff ============================================================================== --- activemq/trunk/activemq-spring/pom.xml (original) +++ activemq/trunk/activemq-spring/pom.xml Fri Jan 18 10:12:11 2013 @@ -26,26 +26,16 @@ activemq-spring + bundle ActiveMQ :: Spring ActiveMQ Spring Integration - + javax.transaction*;resolution:=optional, org.apache.geronimo.transaction.manager*;resolution:=optional, - org.springframework*;resolution:=optional, - * - - - org.apache.activemq.store*;version=${project.version};-noimport:=;-split-package:=merge-last, - org.apache.activemq.security*;version=${project.version};-noimport:=;-split-package:=merge-last, - org.apache.activemq.network*;version=${project.version};-noimport:=;-split-package:=merge-last, - org.apache.activemq.spring*;version=${project.version};-noimport:=;-split-package:=merge-last, - org.apache.activemq.pool*;version=${project.version};-noimport:=;-split-package:=merge-last, - org.apache.activemq.xbean*;version=${project.version};-noimport:=true;-split-package:=merge-last, - org.apache.activemq.hooks*;version=${project.version};-noimport:=;-split-package:=merge-last - org.apache.activemq.hooks.osgi*;version=${project.version};-noimport:=;-split-package:=merge-last - + org.springframework*;resolution:=optional +