mirror of https://github.com/apache/activemq.git
Getting gbeans to work.
git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@389219 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2d82776503
commit
90ce62b952
|
@ -1,31 +0,0 @@
|
||||||
/**
|
|
||||||
*
|
|
||||||
* Copyright 2004 Protique Ltd
|
|
||||||
*
|
|
||||||
* Licensed 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.activemq.gbean;
|
|
||||||
|
|
||||||
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 $Revision: 1.0$
|
|
||||||
*/
|
|
||||||
public interface ActiveMQBroker extends JMSBroker {
|
|
||||||
}
|
|
|
@ -1,35 +0,0 @@
|
||||||
/**
|
|
||||||
*
|
|
||||||
* Copyright 2004 Protique Ltd
|
|
||||||
*
|
|
||||||
* Licensed 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.activemq.gbean;
|
|
||||||
|
|
||||||
import org.apache.geronimo.management.geronimo.JMSConnector;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The GBean interface for the ActiveMQ network connector GBean
|
|
||||||
*
|
|
||||||
* @version $Revision: 1.0$
|
|
||||||
*/
|
|
||||||
public interface ActiveMQConnector extends JMSConnector {
|
|
||||||
public final static String CONNECTOR_J2EE_TYPE = "JMSConnector";
|
|
||||||
|
|
||||||
// Additional stuff you can add to an ActiveMQ connector URI
|
|
||||||
public String getPath();
|
|
||||||
public void setPath(String path);
|
|
||||||
public String getQuery();
|
|
||||||
public void setQuery(String query);
|
|
||||||
}
|
|
|
@ -1,29 +0,0 @@
|
||||||
/**
|
|
||||||
*
|
|
||||||
* Copyright 2004 Protique Ltd
|
|
||||||
*
|
|
||||||
* Licensed 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.activemq.gbean;
|
|
||||||
|
|
||||||
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 $Revision: 1.0$
|
|
||||||
*/
|
|
||||||
public interface ActiveMQManager extends JMSManager {
|
|
||||||
}
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Copyright 2005-2006 The Apache Software Foundation
|
||||||
|
*
|
||||||
|
* Licensed 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.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 $Revision: 1.0$
|
||||||
|
*/
|
||||||
|
public interface ActiveMQBroker extends JMSBroker {
|
||||||
|
}
|
|
@ -0,0 +1,34 @@
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Copyright 2005-2006 The Apache Software Foundation
|
||||||
|
*
|
||||||
|
* Licensed 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.geronimo.management.geronimo.JMSConnector;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The GBean interface for the ActiveMQ network connector GBean
|
||||||
|
*
|
||||||
|
* @version $Revision: 1.0$
|
||||||
|
*/
|
||||||
|
public interface ActiveMQConnector extends JMSConnector {
|
||||||
|
public final static String CONNECTOR_J2EE_TYPE = "JMSConnector";
|
||||||
|
|
||||||
|
// Additional stuff you can add to an ActiveMQ connector URI
|
||||||
|
public String getPath();
|
||||||
|
public void setPath(String path);
|
||||||
|
public String getQuery();
|
||||||
|
public void setQuery(String query);
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Copyright 2005-2006 The Apache Software Foundation
|
||||||
|
*
|
||||||
|
* Licensed 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.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 $Revision: 1.0$
|
||||||
|
*/
|
||||||
|
public interface ActiveMQManager extends JMSManager {
|
||||||
|
}
|
|
@ -36,18 +36,10 @@ public class BrokerServiceGBeanImpl implements GBeanLifecycle, BrokerServiceGBea
|
||||||
private Log log = LogFactory.getLog(getClass().getName());
|
private Log log = LogFactory.getLog(getClass().getName());
|
||||||
|
|
||||||
private String brokerName;
|
private String brokerName;
|
||||||
private final URI brokerUri;
|
private String brokerUri;
|
||||||
private BrokerService brokerService;
|
private BrokerService brokerService;
|
||||||
|
|
||||||
public BrokerServiceGBeanImpl() {
|
public BrokerServiceGBeanImpl() {
|
||||||
brokerName = null;
|
|
||||||
brokerUri=null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BrokerServiceGBeanImpl(String brokerName, URI brokerUri) {
|
|
||||||
assert brokerName != null;
|
|
||||||
this.brokerName = brokerName;
|
|
||||||
this.brokerUri=brokerUri;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized BrokerService getBrokerContainer() {
|
public synchronized BrokerService getBrokerContainer() {
|
||||||
|
@ -69,7 +61,7 @@ public class BrokerServiceGBeanImpl implements GBeanLifecycle, BrokerServiceGBea
|
||||||
|
|
||||||
protected BrokerService createContainer() throws Exception {
|
protected BrokerService createContainer() throws Exception {
|
||||||
if( brokerUri!=null ) {
|
if( brokerUri!=null ) {
|
||||||
BrokerService answer = BrokerFactory.createBroker(brokerUri);
|
BrokerService answer = BrokerFactory.createBroker(new URI(brokerUri));
|
||||||
brokerName = answer.getBrokerName();
|
brokerName = answer.getBrokerName();
|
||||||
return answer;
|
return answer;
|
||||||
} else {
|
} else {
|
||||||
|
@ -104,9 +96,9 @@ public class BrokerServiceGBeanImpl implements GBeanLifecycle, BrokerServiceGBea
|
||||||
static {
|
static {
|
||||||
GBeanInfoBuilder infoFactory = new GBeanInfoBuilder("ActiveMQ Message Broker", BrokerServiceGBeanImpl.class, "JMSServer");
|
GBeanInfoBuilder infoFactory = new GBeanInfoBuilder("ActiveMQ Message Broker", BrokerServiceGBeanImpl.class, "JMSServer");
|
||||||
infoFactory.addAttribute("brokerName", String.class, true);
|
infoFactory.addAttribute("brokerName", String.class, true);
|
||||||
infoFactory.addAttribute("brokerUri", URI.class, true);
|
infoFactory.addAttribute("brokerUri", String.class, true);
|
||||||
infoFactory.addInterface(BrokerServiceGBean.class);
|
infoFactory.addInterface(BrokerServiceGBean.class);
|
||||||
infoFactory.setConstructor(new String[]{"brokerName, brokerUri"});
|
// infoFactory.setConstructor(new String[]{"brokerName, brokerUri"});
|
||||||
GBEAN_INFO = infoFactory.getBeanInfo();
|
GBEAN_INFO = infoFactory.getBeanInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,9 +113,17 @@ public class BrokerServiceGBeanImpl implements GBeanLifecycle, BrokerServiceGBea
|
||||||
return brokerName;
|
return brokerName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public URI getBrokerUri() {
|
public String getBrokerUri() {
|
||||||
return brokerUri;
|
return brokerUri;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setBrokerName(String brokerName) {
|
||||||
|
this.brokerName = brokerName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBrokerUri(String brokerUri) {
|
||||||
|
this.brokerUri = brokerUri;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -14,6 +14,8 @@ activemq-ra/project.xml,\
|
||||||
activemq-web/project.xml,\
|
activemq-web/project.xml,\
|
||||||
activemq-console/project.xml,\
|
activemq-console/project.xml,\
|
||||||
activemq-optional/project.xml,\
|
activemq-optional/project.xml,\
|
||||||
|
activemq-gbean/project.xml,\
|
||||||
|
activemq-gbean-management/project.xml,\
|
||||||
assembly/project.xml
|
assembly/project.xml
|
||||||
#activeio/project.xml,\
|
#activeio/project.xml,\
|
||||||
#activemq-systest/project.xml,\
|
#activemq-systest/project.xml,\
|
||||||
|
|
Loading…
Reference in New Issue