geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r519774 - in /geronimo/server/trunk: ./ configs/activemq-broker/ configs/activemq-broker/src/plan/ configs/webconsole-jetty6/ configs/webconsole-tomcat/ modules/ modules/geronimo-activemq-gbean-management/ modules/geronimo-activemq-gbean/ m...
Date Mon, 19 Mar 2007 01:01:04 GMT
Author: jdillon
Date: Sun Mar 18 18:01:01 2007
New Revision: 519774

URL: http://svn.apache.org/viewvc?view=rev&rev=519774
Log:
 r6663@Bliss:  jason | 2007-03-18 15:28:48 -0700
 Branch for server/trunk re-org
 r6664@Bliss:  jason | 2007-03-18 15:38:19 -0700
 New parent dir
 r6665@Bliss:  jason | 2007-03-18 15:41:22 -0700
 new dir
 r6666@Bliss:  jason | 2007-03-18 15:48:27 -0700
 Repackage amq stuff into org.apache.geronimo.activemq
 r6667@Bliss:  jason | 2007-03-18 15:57:00 -0700
 Rename geronimo-activemq-gbean* modules to geronimo-activemq*
 r6668@Bliss:  jason | 2007-03-18 16:00:24 -0700
 Fixing up packages
 r6669@Bliss:  jason | 2007-03-18 16:03:31 -0700
 Drop gbean package
 r6670@Bliss:  jason | 2007-03-18 16:52:18 -0700
 Update references to new activemq module names

Added:
    geronimo/server/trunk/modules/geronimo-activemq/
      - copied from r519684, geronimo/server/trunk/modules/geronimo-activemq-gbean/
    geronimo/server/trunk/modules/geronimo-activemq-management/
      - copied from r519684, geronimo/server/trunk/modules/geronimo-activemq-gbean-management/
    geronimo/server/trunk/modules/geronimo-activemq-management/src/main/java/org/apache/geronimo/
    geronimo/server/trunk/modules/geronimo-activemq-management/src/main/java/org/apache/geronimo/activemq/
    geronimo/server/trunk/modules/geronimo-activemq-management/src/main/java/org/apache/geronimo/activemq/ActiveMQBroker.java   (with props)
    geronimo/server/trunk/modules/geronimo-activemq-management/src/main/java/org/apache/geronimo/activemq/ActiveMQConnector.java   (with props)
    geronimo/server/trunk/modules/geronimo-activemq-management/src/main/java/org/apache/geronimo/activemq/ActiveMQManager.java   (with props)
    geronimo/server/trunk/modules/geronimo-activemq-management/src/main/java/org/apache/geronimo/activemq/package.html   (with props)
    geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/
    geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/
    geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/BrokerServiceGBean.java   (with props)
    geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/BrokerServiceGBeanImpl.java   (with props)
    geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/TransportConnectorGBeanImpl.java   (with props)
    geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/management/
    geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/management/ActiveMQManagerGBean.java   (with props)
    geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/package.html   (with props)
    geronimo/server/trunk/modules/geronimo-activemq/src/test/java/org/apache/geronimo/
    geronimo/server/trunk/modules/geronimo-activemq/src/test/java/org/apache/geronimo/activemq/
    geronimo/server/trunk/modules/geronimo-activemq/src/test/java/org/apache/geronimo/activemq/ConnectorTest.java   (with props)
Removed:
    geronimo/server/trunk/modules/geronimo-activemq-gbean-management/
    geronimo/server/trunk/modules/geronimo-activemq-gbean/LICENSE.txt
    geronimo/server/trunk/modules/geronimo-activemq-gbean/NOTICE.txt
    geronimo/server/trunk/modules/geronimo-activemq-gbean/pom.xml
    geronimo/server/trunk/modules/geronimo-activemq-gbean/src/main/java/org/apache/activemq/gbean/BrokerServiceGBeanImpl.java
    geronimo/server/trunk/modules/geronimo-activemq-gbean/src/main/java/org/apache/activemq/gbean/TransportConnectorGBeanImpl.java
    geronimo/server/trunk/modules/geronimo-activemq-gbean/src/main/java/org/apache/activemq/gbean/management/
    geronimo/server/trunk/modules/geronimo-activemq-gbean/src/main/java/org/apache/activemq/gbean/package.html
    geronimo/server/trunk/modules/geronimo-activemq-gbean/src/site/
    geronimo/server/trunk/modules/geronimo-activemq-gbean/src/test/
Modified:
    geronimo/server/trunk/   (props changed)
    geronimo/server/trunk/configs/activemq-broker/pom.xml
    geronimo/server/trunk/configs/activemq-broker/src/plan/plan.xml
    geronimo/server/trunk/configs/webconsole-jetty6/pom.xml
    geronimo/server/trunk/configs/webconsole-tomcat/pom.xml
    geronimo/server/trunk/modules/geronimo-activemq-gbean/src/main/java/org/apache/activemq/gbean/BrokerServiceGBean.java
    geronimo/server/trunk/modules/geronimo-activemq-management/pom.xml
    geronimo/server/trunk/modules/geronimo-activemq/pom.xml
    geronimo/server/trunk/modules/pom.xml

Propchange: geronimo/server/trunk/
------------------------------------------------------------------------------
--- svk:merge (original)
+++ svk:merge Sun Mar 18 18:01:01 2007
@@ -1,2 +1,3 @@
 13f79535-47bb-0310-9956-ffa450edef68:/geronimo/sandbox/svkmerge/m2migration:428851
 13f79535-47bb-0310-9956-ffa450edef68:/geronimo/sandbox/svkmerge/trunk:428882
+bdd66121-cd02-4950-91dc-3687ae657a63:/geronimo/trunk-reorg:6670

Modified: geronimo/server/trunk/configs/activemq-broker/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/activemq-broker/pom.xml?view=diff&rev=519774&r1=519773&r2=519774
==============================================================================
--- geronimo/server/trunk/configs/activemq-broker/pom.xml (original)
+++ geronimo/server/trunk/configs/activemq-broker/pom.xml Sun Mar 18 18:01:01 2007
@@ -45,13 +45,13 @@
 
         <dependency>
             <groupId>org.apache.geronimo.modules</groupId>
-            <artifactId>geronimo-activemq-gbean</artifactId>
+            <artifactId>geronimo-activemq</artifactId>
             <version>${version}</version>
         </dependency>
        
         <dependency>
             <groupId>org.apache.geronimo.modules</groupId>
-            <artifactId>geronimo-activemq-gbean-management</artifactId>
+            <artifactId>geronimo-activemq-management</artifactId>
             <version>${version}</version>
         </dependency>
 

Modified: geronimo/server/trunk/configs/activemq-broker/src/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/activemq-broker/src/plan/plan.xml?view=diff&rev=519774&r1=519773&r2=519774
==============================================================================
--- geronimo/server/trunk/configs/activemq-broker/src/plan/plan.xml (original)
+++ geronimo/server/trunk/configs/activemq-broker/src/plan/plan.xml Sun Mar 18 18:01:01 2007
@@ -20,9 +20,9 @@
 
 <module xmlns="http://geronimo.apache.org/xml/ns/deployment-${geronimoSchemaVersion}">
 
-    <gbean name="ActiveMQManager" class="org.apache.activemq.gbean.management.ActiveMQManagerGBean"/>
+    <gbean name="ActiveMQManager" class="org.apache.geronimo.activemq.management.ActiveMQManagerGBean"/>
 
-    <gbean name="ActiveMQ" class="org.apache.activemq.gbean.BrokerServiceGBeanImpl">
+    <gbean name="ActiveMQ" class="org.apache.geronimo.activemq.BrokerServiceGBeanImpl">
         <!-- Instead of using the limited configuration syntax in this file,
              you can set the brokerURI property to externally specify the configuration for 
              the broker.
@@ -44,7 +44,7 @@
         </reference>
     </gbean>
 
-    <gbean name="ActiveMQ.tcp.default" class="org.apache.activemq.gbean.TransportConnectorGBeanImpl">
+    <gbean name="ActiveMQ.tcp.default" class="org.apache.geronimo.activemq.TransportConnectorGBeanImpl">
         <attribute name="protocol">tcp</attribute>
         <attribute name="host">localhost</attribute>
         <attribute name="port">61616</attribute>
@@ -53,7 +53,7 @@
         </reference>
     </gbean>
 
-    <gbean name="ActiveMQ.stomp.default" class="org.apache.activemq.gbean.TransportConnectorGBeanImpl">
+    <gbean name="ActiveMQ.stomp.default" class="org.apache.geronimo.activemq.TransportConnectorGBeanImpl">
         <attribute name="protocol">stomp</attribute>
         <attribute name="host">localhost</attribute>
         <attribute name="port">61613</attribute>

Modified: geronimo/server/trunk/configs/webconsole-jetty6/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/webconsole-jetty6/pom.xml?view=diff&rev=519774&r1=519773&r2=519774
==============================================================================
--- geronimo/server/trunk/configs/webconsole-jetty6/pom.xml (original)
+++ geronimo/server/trunk/configs/webconsole-jetty6/pom.xml Sun Mar 18 18:01:01 2007
@@ -116,13 +116,13 @@
 
         <dependency>
             <groupId>org.apache.geronimo.modules</groupId>
-            <artifactId>geronimo-activemq-gbean</artifactId>
+            <artifactId>geronimo-activemq</artifactId>
             <version>${version}</version>
         </dependency>
 
         <dependency>
             <groupId>org.apache.geronimo.modules</groupId>
-            <artifactId>geronimo-activemq-gbean-management</artifactId>
+            <artifactId>geronimo-activemq-management</artifactId>
             <version>${version}</version>
         </dependency>
 

Modified: geronimo/server/trunk/configs/webconsole-tomcat/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/webconsole-tomcat/pom.xml?view=diff&rev=519774&r1=519773&r2=519774
==============================================================================
--- geronimo/server/trunk/configs/webconsole-tomcat/pom.xml (original)
+++ geronimo/server/trunk/configs/webconsole-tomcat/pom.xml Sun Mar 18 18:01:01 2007
@@ -30,8 +30,8 @@
     </parent>
 
     <artifactId>webconsole-tomcat</artifactId>
-    <packaging>car</packaging>
     <name>Geronimo Configs :: WebConsole Tomcat</name>
+    <packaging>car</packaging>
 
     <dependencies>
         
@@ -120,13 +120,13 @@
 
         <dependency>
             <groupId>org.apache.geronimo.modules</groupId>
-            <artifactId>geronimo-activemq-gbean</artifactId>
+            <artifactId>geronimo-activemq</artifactId>
             <version>${version}</version>
         </dependency>
 
         <dependency>
             <groupId>org.apache.geronimo.modules</groupId>
-            <artifactId>geronimo-activemq-gbean-management</artifactId>
+            <artifactId>geronimo-activemq-management</artifactId>
             <version>${version}</version>
         </dependency>
 

Modified: geronimo/server/trunk/modules/geronimo-activemq-gbean/src/main/java/org/apache/activemq/gbean/BrokerServiceGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-activemq-gbean/src/main/java/org/apache/activemq/gbean/BrokerServiceGBean.java?view=diff&rev=519774&r1=519773&r2=519774
==============================================================================
--- geronimo/server/trunk/modules/geronimo-activemq-gbean/src/main/java/org/apache/activemq/gbean/BrokerServiceGBean.java (original)
+++ geronimo/server/trunk/modules/geronimo-activemq-gbean/src/main/java/org/apache/activemq/gbean/BrokerServiceGBean.java Sun Mar 18 18:01:01 2007
@@ -28,4 +28,37 @@
 public interface BrokerServiceGBean extends ActiveMQBroker {
     BrokerService getBrokerContainer();
     String getBrokerName();
-}
\ No newline at end of file
+}==== ORIGINAL VERSION modules/geronimo-activemq-gbean/src/main/java/org/apache/activemq/gbean/BrokerServiceGBean.java 117426603840632
+/**
+ *  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.gbean;
+
+import org.apache.activemq.broker.BrokerService;
+import org.apache.activemq.gbean.ActiveMQBroker;
+
+/**
+ * An interface to the ActiveMQContainerGBean for use by the 
+ * ActiveMQConnectorGBean.
+ *
+ * @version $Revision$
+ */
+public interface BrokerServiceGBean extends ActiveMQBroker {
+	
+	abstract BrokerService getBrokerContainer();	
+	String getBrokerName();
+	
+}==== THEIR VERSION modules/geronimo-activemq-gbean/src/main/java/org/apache/activemq/gbean/BrokerServiceGBean.java (/geronimo/trunk-reorg) 117426603840632

Modified: geronimo/server/trunk/modules/geronimo-activemq-management/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-activemq-management/pom.xml?view=diff&rev=519774&r1=519684&r2=519774
==============================================================================
--- geronimo/server/trunk/modules/geronimo-activemq-management/pom.xml (original)
+++ geronimo/server/trunk/modules/geronimo-activemq-management/pom.xml Sun Mar 18 18:01:01 2007
@@ -29,17 +29,15 @@
         <relativePath>../pom.xml</relativePath>
     </parent>
 
-    <artifactId>geronimo-activemq-gbean-management</artifactId>
-    <name>Geronimo :: ActiveMQ GBean Management Interfaces</name>
+    <artifactId>geronimo-activemq-management</artifactId>
+    <name>Geronimo :: ActiveMQ Management Interfaces</name>
     
     <dependencies>
-
         <dependency>
             <groupId>org.apache.geronimo.modules</groupId>
             <artifactId>geronimo-management</artifactId>
             <version>${version}</version>
         </dependency>
-        
     </dependencies>
     
 </project>

Added: geronimo/server/trunk/modules/geronimo-activemq-management/src/main/java/org/apache/geronimo/activemq/ActiveMQBroker.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-activemq-management/src/main/java/org/apache/geronimo/activemq/ActiveMQBroker.java?view=auto&rev=519774
==============================================================================
--- geronimo/server/trunk/modules/geronimo-activemq-management/src/main/java/org/apache/geronimo/activemq/ActiveMQBroker.java (added)
+++ geronimo/server/trunk/modules/geronimo-activemq-management/src/main/java/org/apache/geronimo/activemq/ActiveMQBroker.java Sun Mar 18 18:01:01 2007
@@ -0,0 +1,31 @@
+/**
+ *  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.geronimo.activemq;
+
+import org.apache.geronimo.management.geronimo.JMSBroker;
+
+/**
+ * The management interface for the ActiveMQ broker GBean.
+ * This is separate from ActiveMQContainer because that interface has hard
+ * links to code in activemq-core, yet we still want to be able to
+ * distinguish ActiveMQ brokers from non-ActiveMQ JMS brokers.
+ *
+ * @version $Rev$ $Date$
+ */
+public interface ActiveMQBroker extends JMSBroker {
+}

Propchange: geronimo/server/trunk/modules/geronimo-activemq-management/src/main/java/org/apache/geronimo/activemq/ActiveMQBroker.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/modules/geronimo-activemq-management/src/main/java/org/apache/geronimo/activemq/ActiveMQBroker.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/server/trunk/modules/geronimo-activemq-management/src/main/java/org/apache/geronimo/activemq/ActiveMQBroker.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/modules/geronimo-activemq-management/src/main/java/org/apache/geronimo/activemq/ActiveMQConnector.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-activemq-management/src/main/java/org/apache/geronimo/activemq/ActiveMQConnector.java?view=auto&rev=519774
==============================================================================
--- geronimo/server/trunk/modules/geronimo-activemq-management/src/main/java/org/apache/geronimo/activemq/ActiveMQConnector.java (added)
+++ geronimo/server/trunk/modules/geronimo-activemq-management/src/main/java/org/apache/geronimo/activemq/ActiveMQConnector.java Sun Mar 18 18:01:01 2007
@@ -0,0 +1,35 @@
+/**
+ *  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.geronimo.activemq;
+
+import org.apache.geronimo.management.geronimo.JMSConnector;
+
+/**
+ * The GBean interface for the ActiveMQ network connector GBean
+ *
+ * @version $Rev$ $Date$
+ */
+public interface ActiveMQConnector extends JMSConnector {
+    String CONNECTOR_J2EE_TYPE = "JMSConnector";
+
+    // Additional stuff you can add to an ActiveMQ connector URI
+    String getPath();
+    void setPath(String path);
+    String getQuery();
+    void setQuery(String query);
+}

Propchange: geronimo/server/trunk/modules/geronimo-activemq-management/src/main/java/org/apache/geronimo/activemq/ActiveMQConnector.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/modules/geronimo-activemq-management/src/main/java/org/apache/geronimo/activemq/ActiveMQConnector.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/server/trunk/modules/geronimo-activemq-management/src/main/java/org/apache/geronimo/activemq/ActiveMQConnector.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/modules/geronimo-activemq-management/src/main/java/org/apache/geronimo/activemq/ActiveMQManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-activemq-management/src/main/java/org/apache/geronimo/activemq/ActiveMQManager.java?view=auto&rev=519774
==============================================================================
--- geronimo/server/trunk/modules/geronimo-activemq-management/src/main/java/org/apache/geronimo/activemq/ActiveMQManager.java (added)
+++ geronimo/server/trunk/modules/geronimo-activemq-management/src/main/java/org/apache/geronimo/activemq/ActiveMQManager.java Sun Mar 18 18:01:01 2007
@@ -0,0 +1,30 @@
+/**
+ *  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.geronimo.activemq;
+
+import org.apache.geronimo.management.J2EEManagedObject;
+import org.apache.geronimo.management.geronimo.JMSManager;
+
+/**
+ * The GBean interface for the ActiveMQ management GBean.  This defines the
+ * features that should be available to the management interface at runtime.
+ *
+ * @version $Rev$ $Date$
+ */
+public interface ActiveMQManager extends JMSManager, J2EEManagedObject {
+}

Propchange: geronimo/server/trunk/modules/geronimo-activemq-management/src/main/java/org/apache/geronimo/activemq/ActiveMQManager.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/modules/geronimo-activemq-management/src/main/java/org/apache/geronimo/activemq/ActiveMQManager.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/server/trunk/modules/geronimo-activemq-management/src/main/java/org/apache/geronimo/activemq/ActiveMQManager.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/modules/geronimo-activemq-management/src/main/java/org/apache/geronimo/activemq/package.html
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-activemq-management/src/main/java/org/apache/geronimo/activemq/package.html?view=auto&rev=519774
==============================================================================
--- geronimo/server/trunk/modules/geronimo-activemq-management/src/main/java/org/apache/geronimo/activemq/package.html (added)
+++ geronimo/server/trunk/modules/geronimo-activemq-management/src/main/java/org/apache/geronimo/activemq/package.html Sun Mar 18 18:01:01 2007
@@ -0,0 +1,28 @@
+<!--
+  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.
+-->
+<html>
+<head>
+</head>
+<body>
+
+<p>
+	The management API for ActiveMQ, when run in a
+        container like Geronimo
+</p>
+
+</body>
+</html>

Propchange: geronimo/server/trunk/modules/geronimo-activemq-management/src/main/java/org/apache/geronimo/activemq/package.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/modules/geronimo-activemq-management/src/main/java/org/apache/geronimo/activemq/package.html
------------------------------------------------------------------------------
    svn:executable = *

Propchange: geronimo/server/trunk/modules/geronimo-activemq-management/src/main/java/org/apache/geronimo/activemq/package.html
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/server/trunk/modules/geronimo-activemq-management/src/main/java/org/apache/geronimo/activemq/package.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Modified: geronimo/server/trunk/modules/geronimo-activemq/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-activemq/pom.xml?view=diff&rev=519774&r1=519684&r2=519774
==============================================================================
--- geronimo/server/trunk/modules/geronimo-activemq/pom.xml (original)
+++ geronimo/server/trunk/modules/geronimo-activemq/pom.xml Sun Mar 18 18:01:01 2007
@@ -29,14 +29,13 @@
         <relativePath>../pom.xml</relativePath>
     </parent>
 
-    <artifactId>geronimo-activemq-gbean</artifactId>
-    <name>Geronimo :: ActiveMQ GBeans</name>
+    <artifactId>geronimo-activemq</artifactId>
+    <name>Geronimo :: ActiveMQ</name>
     
     <dependencies>
-
         <dependency>
             <groupId>org.apache.geronimo.modules</groupId>
-            <artifactId>geronimo-activemq-gbean-management</artifactId>
+            <artifactId>geronimo-activemq-management</artifactId>
             <version>${version}</version>
         </dependency>
  
@@ -48,8 +47,8 @@
         </dependency>
 
         <dependency>
-                <groupId>org.apache.geronimo.specs</groupId>
-                <artifactId>geronimo-jms_1.1_spec</artifactId>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-jms_1.1_spec</artifactId>
         </dependency>
         
         <dependency>
@@ -61,7 +60,6 @@
             <groupId>org.apache.activemq</groupId>
             <artifactId>activeio-core</artifactId>
         </dependency>
-        
     </dependencies>
     
 </project>

Added: geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/BrokerServiceGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/BrokerServiceGBean.java?view=auto&rev=519774
==============================================================================
--- geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/BrokerServiceGBean.java (added)
+++ geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/BrokerServiceGBean.java Sun Mar 18 18:01:01 2007
@@ -0,0 +1,32 @@
+/**
+ *  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.geronimo.activemq;
+
+import org.apache.activemq.broker.BrokerService;
+import org.apache.geronimo.activemq.ActiveMQBroker;
+
+/**
+ * An interface to the ActiveMQContainerGBean for use by the 
+ * ActiveMQConnectorGBean.
+ *
+ * @version $Rev$ $Date$
+ */
+public interface BrokerServiceGBean extends ActiveMQBroker {
+    BrokerService getBrokerContainer();
+    String getBrokerName();
+}
\ No newline at end of file

Propchange: geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/BrokerServiceGBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/BrokerServiceGBean.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/BrokerServiceGBean.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/BrokerServiceGBean.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/BrokerServiceGBeanImpl.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/BrokerServiceGBeanImpl.java?view=auto&rev=519774
==============================================================================
--- geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/BrokerServiceGBeanImpl.java (added)
+++ geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/BrokerServiceGBeanImpl.java Sun Mar 18 18:01:01 2007
@@ -0,0 +1,253 @@
+/**
+ *   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.geronimo.activemq;
+
+import java.net.URI;
+
+import javax.sql.DataSource;
+import javax.jms.JMSException;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import org.apache.activemq.broker.BrokerFactory;
+import org.apache.activemq.broker.BrokerService;
+import org.apache.activemq.store.DefaultPersistenceAdapterFactory;
+import org.apache.activemq.transport.TransportDisposedIOException;
+import org.apache.geronimo.connector.outbound.ConnectionFactorySource;
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.gbean.GBeanLifecycle;
+import org.apache.geronimo.management.geronimo.JMSManager;
+import org.apache.geronimo.management.geronimo.NetworkConnector;
+import org.apache.geronimo.system.serverinfo.ServerInfo;
+
+/**
+ * Default implementation of the ActiveMQ Message Server
+ *
+ * @version $Rev$ $Date$
+ */
+public class BrokerServiceGBeanImpl implements GBeanLifecycle, BrokerServiceGBean {
+
+    private Log log = LogFactory.getLog(getClass());
+
+    private String brokerName;
+    private String brokerUri;
+    private BrokerService brokerService;
+    private ServerInfo serverInfo;
+    private String dataDirectory;
+    private ConnectionFactorySource dataSource;
+    private ClassLoader classLoader;
+    private String objectName;
+    private JMSManager manager;
+    private boolean useShutdownHook;
+
+    public BrokerServiceGBeanImpl() {
+    }
+
+    public synchronized BrokerService getBrokerContainer() {
+        return brokerService;
+    }
+
+    public synchronized void doStart() throws Exception {
+        ClassLoader old = Thread.currentThread().getContextClassLoader();
+        Thread.currentThread().setContextClassLoader(getClassLoader());
+        try {
+            if (brokerService == null) {
+                if (brokerUri != null) {
+                    brokerService = BrokerFactory.createBroker(new URI(brokerUri));
+                    brokerName = brokerService.getBrokerName();
+                }
+                else {
+                    brokerService = new BrokerService();
+                    if (brokerName != null) {
+                        brokerService.setBrokerName(brokerName);
+                    }
+                    else {
+                        brokerName = brokerService.getBrokerName();
+                    }
+                }
+            }
+
+            // Do not allow the broker to use a shutown hook, the kernel will stop it
+            brokerService.setUseShutdownHook(isUseShutdownHook());
+
+            // Setup the persistence adapter to use the right datasource and directory
+            DefaultPersistenceAdapterFactory persistenceFactory = (DefaultPersistenceAdapterFactory) brokerService.getPersistenceFactory();
+            persistenceFactory.setDataDirectoryFile(serverInfo.resolve(dataDirectory));
+            persistenceFactory.setDataSource((DataSource) dataSource.$getResource());
+
+            brokerService.start();
+        }
+        finally {
+            Thread.currentThread().setContextClassLoader(old);
+        }
+    }
+
+    public synchronized void doStop() throws Exception {
+        if (brokerService != null) {
+            BrokerService temp = brokerService;
+            brokerService = null;
+            try {
+                temp.stop();
+            } catch (JMSException ignored) {
+                // just a lame exception ActiveMQ likes to throw on shutdown
+                if (!(ignored.getCause() instanceof TransportDisposedIOException)) {
+                    throw ignored;
+                }
+            }
+        }
+    }
+
+    public synchronized void doFail() {
+        if (brokerService != null) {
+            BrokerService temp = brokerService;
+            brokerService = null;
+            try {
+                temp.stop();
+            } catch (JMSException ignored) {
+                // just a lame exception ActiveMQ likes to throw on shutdown
+                if (!(ignored.getCause() instanceof TransportDisposedIOException)) {
+                    log.warn("Caught while closing due to failure: " + ignored, ignored);
+                }
+            } catch (Exception e) {
+                log.warn("Caught while closing due to failure: " + e, e);
+            }
+        }
+    }
+
+    public static final GBeanInfo GBEAN_INFO;
+
+    static {
+        GBeanInfoBuilder infoBuilder = new GBeanInfoBuilder("ActiveMQ Message Broker", BrokerServiceGBeanImpl.class, "JMSServer");
+        infoBuilder.addReference("serverInfo", ServerInfo.class);
+        infoBuilder.addAttribute("classLoader", ClassLoader.class, false);
+        infoBuilder.addAttribute("brokerName", String.class, true);
+        infoBuilder.addAttribute("brokerUri", String.class, true);
+        infoBuilder.addAttribute("useShutdownHook", Boolean.TYPE, true);
+        infoBuilder.addAttribute("dataDirectory", String.class, true);
+        infoBuilder.addReference("dataSource", ConnectionFactorySource.class);
+        infoBuilder.addAttribute("objectName", String.class, false);
+        infoBuilder.addReference("manager", JMSManager.class);
+        infoBuilder.addInterface(BrokerServiceGBean.class);
+        // infoFactory.setConstructor(new String[]{"brokerName, brokerUri"});
+        GBEAN_INFO = infoBuilder.getBeanInfo();
+    }
+
+    public static GBeanInfo getGBeanInfo() {
+        return GBEAN_INFO;
+    }
+
+	/**
+	 * @return Returns the brokerName.
+	 */
+	public String getBrokerName() {
+		return brokerName;
+	}
+
+    public String getBrokerUri() {
+        return brokerUri;
+    }
+
+    public void setBrokerName(String brokerName) {
+        this.brokerName = brokerName;
+    }
+
+    public void setBrokerUri(String brokerUri) {
+        this.brokerUri = brokerUri;
+    }
+
+    public ServerInfo getServerInfo() {
+        return serverInfo;
+    }
+
+    public void setServerInfo(ServerInfo serverInfo) {
+        this.serverInfo = serverInfo;
+    }
+
+    public String getDataDirectory() {
+        return dataDirectory;
+    }
+
+    public void setDataDirectory(String dataDir) {
+        this.dataDirectory = dataDir;
+    }
+
+    public ConnectionFactorySource getDataSource() {
+        return dataSource;
+    }
+
+    public void setDataSource(ConnectionFactorySource dataSource) {
+        this.dataSource = dataSource;
+    }
+
+    public String getObjectName() {
+        return objectName;
+    }
+
+    public boolean isStateManageable() {
+        return true;
+    }
+
+    public boolean isStatisticsProvider() {
+        return false; // todo: return true once stats are integrated
+    }
+
+    public boolean isEventProvider() {
+        return true;
+    }
+
+    public NetworkConnector[] getConnectors() {
+        return manager.getConnectorsForContainer(this);
+    }
+
+    public NetworkConnector[] getConnectors(String protocol) {
+        return manager.getConnectorsForContainer(this, protocol);
+    }
+
+    public JMSManager getManager() {
+        return manager;
+    }
+
+    public void setManager(JMSManager manager) {
+        this.manager = manager;
+    }
+
+    public void setObjectName(String objectName) {
+        this.objectName = objectName;
+    }
+
+    public ClassLoader getClassLoader() {
+        if( classLoader == null ) {
+            classLoader = this.getClass().getClassLoader();
+        }
+        return classLoader;
+    }
+
+    public void setClassLoader(ClassLoader classLoader) {
+        this.classLoader = classLoader;
+    }
+
+    public boolean isUseShutdownHook() {
+        return useShutdownHook;
+    }
+
+    public void setUseShutdownHook(final boolean useShutdownHook) {
+        this.useShutdownHook = useShutdownHook;
+    }
+}
\ No newline at end of file

Propchange: geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/BrokerServiceGBeanImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/BrokerServiceGBeanImpl.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/BrokerServiceGBeanImpl.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/BrokerServiceGBeanImpl.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/TransportConnectorGBeanImpl.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/TransportConnectorGBeanImpl.java?view=auto&rev=519774
==============================================================================
--- geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/TransportConnectorGBeanImpl.java (added)
+++ geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/TransportConnectorGBeanImpl.java Sun Mar 18 18:01:01 2007
@@ -0,0 +1,183 @@
+/**
+ *  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.geronimo.activemq;
+
+import java.net.InetSocketAddress;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import org.apache.activemq.broker.TransportConnector;
+import org.apache.geronimo.activemq.ActiveMQConnector;
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.gbean.GBeanLifecycle;
+import org.apache.geronimo.gbean.GConstructorInfo;
+
+/**
+ * Default implementation of the ActiveMQ connector
+ *
+ * @version $Rev$ $Date$
+ */
+public class TransportConnectorGBeanImpl implements GBeanLifecycle, ActiveMQConnector {
+    private Log log = LogFactory.getLog(getClass().getName());
+
+    private TransportConnector transportConnector;
+    private BrokerServiceGBean brokerServiceGBean;
+    
+    private String protocol;
+    private String host;
+    private int port;
+    private String path;
+    private String query;
+    private String urlAsStarted;
+    private ClassLoader classLoader;
+
+    public TransportConnectorGBeanImpl(BrokerServiceGBean brokerServiceGBean, String protocol, String host, int port) {
+        this.brokerServiceGBean = brokerServiceGBean;
+        this.protocol = protocol;
+        this.host = host;
+        this.port = port;
+    }
+
+    public String getProtocol() {
+        return protocol;
+    }
+
+    public void setProtocol(String protocol) {
+        this.protocol = protocol;
+    }
+
+    public String getHost() {
+        return host;
+    }
+
+    public void setHost(String host) {
+        this.host = host;
+    }
+
+    public int getPort() {
+        return port;
+    }
+
+    public void setPort(int port) {
+        this.port = port;
+    }
+
+    public String getPath() {
+        return path;
+    }
+
+    public void setPath(String path) {
+        this.path = path;
+    }
+
+    public String getQuery() {
+        return query;
+    }
+
+    public void setQuery(String query) {
+        this.query = query;
+    }
+
+    public String getUrl() {
+        try {
+            return new URI(protocol, null, host, port, path, query, null).toString();
+        } catch (URISyntaxException e) {
+            throw new IllegalStateException("Attributes don't form a valid URI: "+protocol+"://"+host+":"+port+"/"+path+"?"+query);
+        }
+    }
+
+    public InetSocketAddress getListenAddress() {
+        try {
+            return transportConnector.getServer().getSocketAddress();
+        } catch (Throwable e) {
+            log.debug("Failure to determine ListenAddress: "+e,e);
+            return null;
+        }
+    }
+
+    public synchronized void doStart() throws Exception {
+    	ClassLoader old = Thread.currentThread().getContextClassLoader();
+    	Thread.currentThread().setContextClassLoader(getClassLoader());
+    	try {
+	        if (transportConnector == null) {
+                urlAsStarted = getUrl();
+	            transportConnector = createBrokerConnector(urlAsStarted);
+	            transportConnector.start();
+	        }
+    	} finally {
+        	Thread.currentThread().setContextClassLoader(old);
+    	}
+    }
+
+    public synchronized void doStop() throws Exception {
+        if (transportConnector != null) {
+            TransportConnector temp = transportConnector;
+            transportConnector = null;
+            temp.stop();
+        }
+    }
+
+    public synchronized void doFail() {
+        if (transportConnector != null) {
+            TransportConnector temp = transportConnector;
+            transportConnector = null;
+            try {
+                temp.stop();
+            }
+            catch (Exception e) {
+                log.info("Caught while closing due to failure: " + e, e);
+            }
+        }
+    }
+
+    protected TransportConnector createBrokerConnector(String url) throws Exception {
+        return brokerServiceGBean.getBrokerContainer().addConnector(url);
+    }
+
+    public ClassLoader getClassLoader() {
+        if( classLoader == null ) {
+            classLoader = this.getClass().getClassLoader();
+        }
+        return classLoader;
+    }
+
+    public void setClassLoader(ClassLoader classLoader) {
+        this.classLoader = classLoader;
+    }
+
+    public static final GBeanInfo GBEAN_INFO;
+
+    static {
+        GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic("ActiveMQ Transport Connector", TransportConnectorGBeanImpl.class, CONNECTOR_J2EE_TYPE);
+        infoBuilder.addAttribute("classLoader", ClassLoader.class, false);
+        infoBuilder.addAttribute("url", String.class.getName(), false);
+        infoBuilder.addReference("brokerService", BrokerServiceGBean.class);
+        infoBuilder.addInterface(ActiveMQConnector.class, new String[]{"host","port","protocol","path","query"},
+                new String[]{"host","port"});
+        infoBuilder.setConstructor(new GConstructorInfo(new String[]{"brokerService", "protocol", "host", "port"}));
+        GBEAN_INFO = infoBuilder.getBeanInfo();
+    }
+
+    public static GBeanInfo getGBeanInfo() {
+        return GBEAN_INFO;
+    }
+}

Propchange: geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/TransportConnectorGBeanImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/TransportConnectorGBeanImpl.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/TransportConnectorGBeanImpl.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/TransportConnectorGBeanImpl.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/management/ActiveMQManagerGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/management/ActiveMQManagerGBean.java?view=auto&rev=519774
==============================================================================
--- geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/management/ActiveMQManagerGBean.java (added)
+++ geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/management/ActiveMQManagerGBean.java Sun Mar 18 18:01:01 2007
@@ -0,0 +1,268 @@
+/**
+ *   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.geronimo.activemq.management;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import org.apache.geronimo.activemq.ActiveMQBroker;
+import org.apache.geronimo.activemq.ActiveMQConnector;
+import org.apache.geronimo.activemq.ActiveMQManager;
+import org.apache.geronimo.activemq.TransportConnectorGBeanImpl;
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.gbean.AbstractNameQuery;
+import org.apache.geronimo.gbean.GBeanData;
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.gbean.ReferencePatterns;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.kernel.GBeanNotFoundException;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.config.ConfigurationUtil;
+import org.apache.geronimo.kernel.config.EditableConfigurationManager;
+import org.apache.geronimo.kernel.config.InvalidConfigException;
+import org.apache.geronimo.kernel.proxy.ProxyManager;
+import org.apache.geronimo.management.geronimo.JMSBroker;
+import org.apache.geronimo.management.geronimo.JMSConnector;
+import org.apache.geronimo.management.geronimo.NetworkConnector;
+
+/**
+ * Implementation of the ActiveMQ management interface.  These are the ActiveMQ
+ * management features available at runtime.
+ *
+ * @version $Rev$ $Date$
+ */
+public class ActiveMQManagerGBean implements ActiveMQManager {
+    private static final Log log = LogFactory.getLog(ActiveMQManagerGBean.class.getName());
+    private Kernel kernel;
+    private String objectName;
+
+    public ActiveMQManagerGBean(Kernel kernel, String objectName) {
+        this.kernel = kernel;
+        this.objectName = objectName;
+    }
+
+    public String getProductName() {
+        return "ActiveMQ";
+    }
+
+    public String getObjectName() {
+        return objectName;
+    }
+
+    public boolean isEventProvider() {
+        return false;
+    }
+
+    public boolean isStateManageable() {
+        return true;
+    }
+
+    public boolean isStatisticsProvider() {
+        return false;
+    }
+
+    public Object[] getContainers() {
+        ProxyManager proxyManager = kernel.getProxyManager();
+        AbstractNameQuery query = new AbstractNameQuery(ActiveMQBroker.class.getName());
+        Set names = kernel.listGBeans(query);
+        ActiveMQBroker[] results = new ActiveMQBroker[names.size()];
+        int i=0;
+        for (Iterator it = names.iterator(); it.hasNext(); i++) {
+            AbstractName name = (AbstractName) it.next();
+            results[i] = (ActiveMQBroker) proxyManager.createProxy(name, ActiveMQBroker.class.getClassLoader());
+        }
+        return results;
+    }
+
+    public String[] getSupportedProtocols() {
+        // see files in modules/core/src/conf/META-INF/services/org/activemq/transport/server/
+        return new String[]{ "tcp", "stomp", "vm", "peer", "udp", "multicast", "failover"};
+    }
+
+    public NetworkConnector[] getConnectors() {
+        ProxyManager proxyManager = kernel.getProxyManager();
+        AbstractNameQuery query = new AbstractNameQuery(ActiveMQConnector.class.getName());
+        Set names = kernel.listGBeans(query);
+        ActiveMQConnector[] results = new ActiveMQConnector[names.size()];
+        int i=0;
+        for (Iterator it = names.iterator(); it.hasNext(); i++) {
+            AbstractName name = (AbstractName) it.next();
+            results[i] = (ActiveMQConnector) proxyManager.createProxy(name, ActiveMQConnector.class.getClassLoader());
+        }
+        return results;
+    }
+
+    public NetworkConnector[] getConnectors(String protocol) {
+        if(protocol == null) {
+            return getConnectors();
+        }
+        List result = new ArrayList();
+        ProxyManager proxyManager = kernel.getProxyManager();
+        AbstractNameQuery query = new AbstractNameQuery(ActiveMQConnector.class.getName());
+        Set names = kernel.listGBeans(query);
+        for (Iterator it = names.iterator(); it.hasNext();) {
+            AbstractName name = (AbstractName) it.next();
+            try {
+                if (kernel.getAttribute(name, "protocol").equals(protocol)) {
+                    result.add(proxyManager.createProxy(name, ActiveMQConnector.class.getClassLoader()));
+                }
+            } catch (Exception e) {
+                log.error("Unable to check the protocol for a connector", e);
+            }
+        }
+        return (ActiveMQConnector[]) result.toArray(new ActiveMQConnector[names.size()]);
+    }
+
+    public NetworkConnector[] getConnectorsForContainer(Object broker) {
+        AbstractName containerName = kernel.getAbstractNameFor(broker);
+        ProxyManager mgr = kernel.getProxyManager();
+        try {
+            List results = new ArrayList();
+            AbstractNameQuery query = new AbstractNameQuery(ActiveMQConnector.class.getName());
+            Set set = kernel.listGBeans(query); // all Jetty connectors
+            for (Iterator it = set.iterator(); it.hasNext();) {
+                AbstractName name = (AbstractName) it.next(); // a single Jetty connector
+                GBeanData data = kernel.getGBeanData(name);
+                ReferencePatterns refs = data.getReferencePatterns("brokerService");
+                if (containerName.equals(refs.getAbstractName())) {
+                    results.add(mgr.createProxy(name, ActiveMQConnector.class.getClassLoader()));
+                }
+            }
+            return (ActiveMQConnector[]) results.toArray(new ActiveMQConnector[results.size()]);
+        } catch (Exception e) {
+            throw (IllegalArgumentException) new IllegalArgumentException("Unable to look up connectors for ActiveMQ broker '"+containerName).initCause(e);
+        }
+    }
+
+    public NetworkConnector[] getConnectorsForContainer(Object broker, String protocol) {
+        if(protocol == null) {
+            return getConnectorsForContainer(broker);
+        }
+        AbstractName containerName = kernel.getAbstractNameFor(broker);
+        ProxyManager mgr = kernel.getProxyManager();
+        try {
+            List results = new ArrayList();
+            AbstractNameQuery query = new AbstractNameQuery(ActiveMQConnector.class.getName());
+            Set set = kernel.listGBeans(query); // all Jetty connectors
+            for (Iterator it = set.iterator(); it.hasNext();) {
+                AbstractName name = (AbstractName) it.next(); // a single Jetty connector
+                GBeanData data = kernel.getGBeanData(name);
+                ReferencePatterns refs = data.getReferencePatterns("brokerService");
+                if(containerName.equals(refs.getAbstractName())) {
+                    try {
+                        String testProtocol = (String) kernel.getAttribute(name, "protocol");
+                        if(testProtocol != null && testProtocol.equals(protocol)) {
+                            results.add(mgr.createProxy(name, ActiveMQConnector.class.getClassLoader()));
+                        }
+                    } catch (Exception e) {
+                        log.error("Unable to look up protocol for connector '"+name+"'",e);
+                    }
+                    break;
+                }
+            }
+            return (ActiveMQConnector[]) results.toArray(new ActiveMQConnector[results.size()]);
+        } catch (Exception e) {
+            throw (IllegalArgumentException)new IllegalArgumentException("Unable to look up connectors for ActiveMQ broker '"+containerName +"': ").initCause(e);
+        }
+    }
+
+    /**
+     * Returns a new JMSConnector.  Note that
+     * the connector may well require further customization before being fully
+     * functional (e.g. SSL settings for a secure connector).
+     */
+    public JMSConnector addConnector(JMSBroker broker, String uniqueName, String protocol, String host, int port) {
+        AbstractName brokerAbstractName = kernel.getAbstractNameFor(broker);
+        AbstractName name = kernel.getNaming().createChildName(brokerAbstractName, uniqueName, NameFactory.GERONIMO_SERVICE);
+        GBeanData connector = new GBeanData(name, TransportConnectorGBeanImpl.GBEAN_INFO);
+        //todo: if SSL is supported, need to add more properties or use a different GBean?
+        connector.setAttribute("protocol", protocol);
+        connector.setAttribute("host", host);
+        connector.setAttribute("port", new Integer(port));
+        connector.setReferencePattern("brokerService", brokerAbstractName);
+        EditableConfigurationManager mgr = ConfigurationUtil.getEditableConfigurationManager(kernel);
+        if(mgr != null) {
+            try {
+                mgr.addGBeanToConfiguration(brokerAbstractName.getArtifact(), connector, false);
+                return (JMSConnector) kernel.getProxyManager().createProxy(name, ActiveMQConnector.class.getClassLoader());
+            } catch (InvalidConfigException e) {
+                log.error("Unable to add GBean", e);
+                return null;
+            } finally {
+                ConfigurationUtil.releaseConfigurationManager(kernel, mgr);
+            }
+        } else {
+            log.warn("The ConfigurationManager in the kernel does not allow editing");
+            return null;
+        }
+    }
+
+    public void removeConnector(AbstractName connectorName) {
+        try {
+            GBeanInfo info = kernel.getGBeanInfo(connectorName);
+            boolean found = false;
+            Set intfs = info.getInterfaces();
+            for (Iterator it = intfs.iterator(); it.hasNext();) {
+                String intf = (String) it.next();
+                if (intf.equals(ActiveMQConnector.class.getName())) {
+                    found = true;
+                }
+            }
+            if (!found) {
+                throw new GBeanNotFoundException(connectorName);
+            }
+            EditableConfigurationManager mgr = ConfigurationUtil.getEditableConfigurationManager(kernel);
+            if (mgr != null) {
+                try {
+                    mgr.removeGBeanFromConfiguration(connectorName.getArtifact(), connectorName);
+                } catch (InvalidConfigException e) {
+                    log.error("Unable to add GBean", e);
+                } finally {
+                    ConfigurationUtil.releaseConfigurationManager(kernel, mgr);
+                }
+            } else {
+                log.warn("The ConfigurationManager in the kernel does not allow editing");
+            }
+        } catch (GBeanNotFoundException e) {
+            log.warn("No such GBean '" + connectorName + "'"); //todo: what if we want to remove a failed GBean?
+        } catch (Exception e) {
+            log.error(e);
+        }
+    }
+
+    public static final GBeanInfo GBEAN_INFO;
+
+    static {
+        GBeanInfoBuilder infoFactory = new GBeanInfoBuilder("ActiveMQ Manager", ActiveMQManagerGBean.class);
+        infoFactory.addAttribute("kernel", Kernel.class, false);
+        infoFactory.addAttribute("objectName", String.class, false);
+        infoFactory.addInterface(ActiveMQManager.class);
+        infoFactory.setConstructor(new String[]{"kernel", "objectName"});
+        GBEAN_INFO = infoFactory.getBeanInfo();
+    }
+
+    public static GBeanInfo getGBeanInfo() {
+        return GBEAN_INFO;
+    }
+}

Propchange: geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/management/ActiveMQManagerGBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/management/ActiveMQManagerGBean.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/management/ActiveMQManagerGBean.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/package.html
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/package.html?view=auto&rev=519774
==============================================================================
--- geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/package.html (added)
+++ geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/package.html Sun Mar 18 18:01:01 2007
@@ -0,0 +1,25 @@
+<!--
+  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.
+-->
+<html>
+<head>
+</head>
+<body>
+
+<p>The JMS container using GBeans for deployment in Apache Geronimo</p>
+
+</body>
+</html>

Propchange: geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/package.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/package.html
------------------------------------------------------------------------------
    svn:executable = *

Propchange: geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/package.html
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/server/trunk/modules/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/package.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: geronimo/server/trunk/modules/geronimo-activemq/src/test/java/org/apache/geronimo/activemq/ConnectorTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-activemq/src/test/java/org/apache/geronimo/activemq/ConnectorTest.java?view=auto&rev=519774
==============================================================================
--- geronimo/server/trunk/modules/geronimo-activemq/src/test/java/org/apache/geronimo/activemq/ConnectorTest.java (added)
+++ geronimo/server/trunk/modules/geronimo-activemq/src/test/java/org/apache/geronimo/activemq/ConnectorTest.java Sun Mar 18 18:01:01 2007
@@ -0,0 +1,60 @@
+/**
+ *  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.geronimo.activemq;
+
+import junit.framework.TestCase;
+
+/**
+ * Tests to ensure that URL parsing and updating doesn't blow up
+ *
+ * @version $Rev$ $Date$
+ */
+public class ConnectorTest extends TestCase {
+    public TransportConnectorGBeanImpl test;
+
+    protected void setUp() throws Exception {
+    }
+
+    public void testURLManipulation() {
+        test = new TransportConnectorGBeanImpl(null, "foo", "localhost", 1234);
+        assertEquals("foo://localhost:1234", test.getUrl());
+        assertEquals("foo", test.getProtocol());
+        assertEquals("localhost", test.getHost());
+        assertEquals(1234, test.getPort());
+        test.setHost("0.0.0.0");
+        assertEquals("foo://0.0.0.0:1234", test.getUrl());
+        assertEquals("foo", test.getProtocol());
+        assertEquals("0.0.0.0", test.getHost());
+        assertEquals(1234, test.getPort());
+        test.setPort(8765);
+        assertEquals("foo://0.0.0.0:8765", test.getUrl());
+        assertEquals("foo", test.getProtocol());
+        assertEquals("0.0.0.0", test.getHost());
+        assertEquals(8765, test.getPort());
+        test.setProtocol("bar");
+        assertEquals("bar://0.0.0.0:8765", test.getUrl());
+        assertEquals("bar", test.getProtocol());
+        assertEquals("0.0.0.0", test.getHost());
+        assertEquals(8765, test.getPort());
+        test = new TransportConnectorGBeanImpl(null, "vm", "localhost", -1);
+        assertEquals("vm://localhost", test.getUrl());
+        assertEquals("vm", test.getProtocol());
+        assertEquals("localhost", test.getHost());
+        assertEquals(-1, test.getPort());
+    }
+}

Propchange: geronimo/server/trunk/modules/geronimo-activemq/src/test/java/org/apache/geronimo/activemq/ConnectorTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/modules/geronimo-activemq/src/test/java/org/apache/geronimo/activemq/ConnectorTest.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/server/trunk/modules/geronimo-activemq/src/test/java/org/apache/geronimo/activemq/ConnectorTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/trunk/modules/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/pom.xml?view=diff&rev=519774&r1=519773&r2=519774
==============================================================================
--- geronimo/server/trunk/modules/pom.xml (original)
+++ geronimo/server/trunk/modules/pom.xml Sun Mar 18 18:01:01 2007
@@ -42,8 +42,8 @@
     <modules>
         <module>geronimo-activation</module>
         <module>ge-activemq-rar</module>
-        <module>geronimo-activemq-gbean</module>
-        <module>geronimo-activemq-gbean-management</module>
+        <module>geronimo-activemq</module>
+        <module>geronimo-activemq-management</module>
         <module>geronimo-axis</module>
         <module>geronimo-axis-builder</module>
         <module>geronimo-client</module>



Mime
View raw message