activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r517671 - in /activemq/trunk/activemq-core/src/main: java/org/apache/activemq/xbean/FileXBeanBrokerFactory.java java/org/apache/activemq/xbean/XBeanBrokerFactory.java resources/META-INF/services/org/apache/activemq/broker/file
Date Tue, 13 Mar 2007 12:47:19 GMT
Author: jstrachan
Date: Tue Mar 13 05:47:19 2007
New Revision: 517671

URL: http://svn.apache.org/viewvc?view=rev&rev=517671
Log:
added a file: based handler for the broker factory

Added:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/xbean/FileXBeanBrokerFactory.java
  (with props)
    activemq/trunk/activemq-core/src/main/resources/META-INF/services/org/apache/activemq/broker/file
Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/xbean/XBeanBrokerFactory.java

Added: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/xbean/FileXBeanBrokerFactory.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/xbean/FileXBeanBrokerFactory.java?view=auto&rev=517671
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/xbean/FileXBeanBrokerFactory.java
(added)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/xbean/FileXBeanBrokerFactory.java
Tue Mar 13 05:47:19 2007
@@ -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.
+ */
+package org.apache.activemq.xbean;
+
+import org.apache.xbean.spring.context.ClassPathXmlApplicationContext;
+import org.apache.xbean.spring.context.FileSystemXmlApplicationContext;
+import org.springframework.context.ApplicationContext;
+
+/**
+ * @version $Revision$
+ */
+public class FileXBeanBrokerFactory extends XBeanBrokerFactory {
+    @Override
+    protected ApplicationContext createApplicationContext(String uri) {
+        String name = uri.toString();
+        if (name.startsWith("//")) {
+            name = name.substring(2);
+        }
+        return new FileSystemXmlApplicationContext(name);
+    }
+}

Propchange: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/xbean/FileXBeanBrokerFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/xbean/FileXBeanBrokerFactory.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/xbean/FileXBeanBrokerFactory.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/xbean/XBeanBrokerFactory.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/xbean/XBeanBrokerFactory.java?view=diff&rev=517671&r1=517670&r2=517671
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/xbean/XBeanBrokerFactory.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/xbean/XBeanBrokerFactory.java
Tue Mar 13 05:47:19 2007
@@ -23,6 +23,7 @@
 import org.apache.activemq.broker.BrokerService;
 import org.apache.activemq.broker.BrokerFactory.BrokerFactoryHandler;
 import org.springframework.beans.BeansException;
+import org.springframework.context.ApplicationContext;
 import org.apache.xbean.spring.context.ClassPathXmlApplicationContext;
 import org.apache.xbean.spring.context.impl.URIEditor;
 
@@ -38,7 +39,7 @@
     public BrokerService createBroker(URI config) throws Exception {
 
         String uri = config.getSchemeSpecificPart();
-        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(uri);
+        ApplicationContext context = createApplicationContext(uri);
 
         BrokerService broker = null;
         try {
@@ -67,4 +68,7 @@
         return broker;
     }
 
+    protected ApplicationContext createApplicationContext(String uri) {
+        return new ClassPathXmlApplicationContext(uri);
+    }
 }

Added: activemq/trunk/activemq-core/src/main/resources/META-INF/services/org/apache/activemq/broker/file
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/resources/META-INF/services/org/apache/activemq/broker/file?view=auto&rev=517671
==============================================================================
--- activemq/trunk/activemq-core/src/main/resources/META-INF/services/org/apache/activemq/broker/file
(added)
+++ activemq/trunk/activemq-core/src/main/resources/META-INF/services/org/apache/activemq/broker/file
Tue Mar 13 05:47:19 2007
@@ -0,0 +1 @@
+class=org.apache.activemq.xbean.FileXBeanBrokerFactory
\ No newline at end of file



Mime
View raw message