Return-Path: Delivered-To: apmail-geronimo-activemq-commits-archive@www.apache.org Received: (qmail 50825 invoked from network); 14 Dec 2005 12:38:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 14 Dec 2005 12:38:02 -0000 Received: (qmail 35408 invoked by uid 500); 14 Dec 2005 12:38:02 -0000 Delivered-To: apmail-geronimo-activemq-commits-archive@geronimo.apache.org Received: (qmail 35389 invoked by uid 500); 14 Dec 2005 12:38:01 -0000 Mailing-List: contact activemq-commits-help@geronimo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: activemq-dev@geronimo.apache.org Delivered-To: mailing list activemq-commits@geronimo.apache.org Received: (qmail 35380 invoked by uid 99); 14 Dec 2005 12:38:01 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Dec 2005 04:38:01 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 14 Dec 2005 04:38:00 -0800 Received: (qmail 50709 invoked by uid 65534); 14 Dec 2005 12:37:40 -0000 Message-ID: <20051214123740.50707.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r356775 - in /incubator/activemq/trunk/activemq-web: project.xml src/java/org/activemq/web/SpringBrokerContextListener.java Date: Wed, 14 Dec 2005 12:37:39 -0000 To: activemq-commits@geronimo.apache.org From: jstrachan@apache.org X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: jstrachan Date: Wed Dec 14 04:37:34 2005 New Revision: 356775 URL: http://svn.apache.org/viewcvs?rev=356775&view=rev Log: fixed the SpringBrokerContextListener to spin up a broker from an ActiveMQ XML file (or at least an XBean file) Modified: incubator/activemq/trunk/activemq-web/project.xml incubator/activemq/trunk/activemq-web/src/java/org/activemq/web/SpringBrokerContextListener.java Modified: incubator/activemq/trunk/activemq-web/project.xml URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-web/project.xml?rev=356775&r1=356774&r2=356775&view=diff ============================================================================== --- incubator/activemq/trunk/activemq-web/project.xml (original) +++ incubator/activemq/trunk/activemq-web/project.xml Wed Dec 14 04:37:34 2005 @@ -43,6 +43,17 @@ ${pom.currentVersion} + + + xbean + xbean-spring + ${xbean_spring_version} + http://www.gbean.org + + true + + + springframework @@ -53,11 +64,11 @@ true - + - activeio - activeio - ${activeio_version} + activeio + activeio + ${activeio_version} Modified: incubator/activemq/trunk/activemq-web/src/java/org/activemq/web/SpringBrokerContextListener.java URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-web/src/java/org/activemq/web/SpringBrokerContextListener.java?rev=356775&r1=356774&r2=356775&view=diff ============================================================================== --- incubator/activemq/trunk/activemq-web/src/java/org/activemq/web/SpringBrokerContextListener.java (original) +++ incubator/activemq/trunk/activemq-web/src/java/org/activemq/web/SpringBrokerContextListener.java Wed Dec 14 04:37:34 2005 @@ -17,15 +17,15 @@ **/ package org.activemq.web; -import javax.servlet.ServletContext; -import javax.servlet.ServletContextListener; -import javax.servlet.ServletContextEvent; -import javax.jms.JMSException; - import org.activemq.broker.BrokerService; +import org.activemq.xbean.BrokerFactoryBean; import org.springframework.core.io.Resource; import org.springframework.web.context.support.ServletContextResource; +import javax.servlet.ServletContext; +import javax.servlet.ServletContextEvent; +import javax.servlet.ServletContextListener; + /** * Used to configure and instance of ActiveMQ BrokerService using * ActiveMQ/Spring's xml configuration.

The configuration file is specified @@ -105,7 +105,13 @@ } context.log("Loading ActiveMQ Broker configuration from: " + brokerURI); Resource resource = new ServletContextResource(context, brokerURI); - // return SpringBrokerServiceFactory.newInstance(resource); - return null; + BrokerFactoryBean factory = new BrokerFactoryBean(resource); + try { + factory.afterPropertiesSet(); + } + catch (Exception e) { + context.log("Failed to create broker: " + e, e); + } + return factory.getBroker(); } }