You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ro...@apache.org on 2012/03/13 16:56:54 UTC
svn commit: r1300204 [5/8] - in
/qpid/branches/java-config-and-management/qpid/java: ./
broker-plugins/experimental/shutdown/src/main/java/org/apache/qpid/shutdown/
broker-plugins/extras/src/main/java/org/apache/qpid/extras/exchanges/diagnostic/
broker...
Added: qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/broker.js
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/broker.js?rev=1300204&view=auto
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/broker.js (added)
+++ qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/broker.js Tue Mar 13 15:56:45 2012
@@ -0,0 +1,153 @@
+var vhostGrid, dataStore, store, vhostStore;
+var exchangeGrid, exchangeStore, exchangeDataStore;
+var updateList = new Array();
+var vhostTuple, exchangesTuple;
+
+
+require(["dojo/store/JsonRest",
+ "dojo/store/Memory",
+ "dojo/store/Cache",
+ "dojox/grid/DataGrid",
+ "dojo/data/ObjectStore",
+ "dojo/query",
+ "dojo/store/Observable",
+ "dojo/_base/xhr",
+ "dojo/domReady!"],
+ function(JsonRest, Memory, Cache, DataGrid, ObjectStore, query, Observable, xhr)
+ {
+
+
+ function UpdatableStore( query, divName, structure, func ) {
+
+
+ this.query = query;
+
+ var thisObj = this;
+
+ xhr.get({url: query, handleAs: "json"}).then(function(data)
+ {
+ thisObj.store = Observable(Memory({data: data, idProperty: "id"}));
+ thisObj.dataStore = ObjectStore({objectStore: thisObj.store});
+ thisObj.grid = new DataGrid({
+ store: thisObj.dataStore,
+ structure: structure,
+ }, divName);
+
+ // since we created this grid programmatically, call startup to render it
+ thisObj.grid.startup();
+
+ updateList.push( thisObj );
+ if( func )
+ {
+ func(thisObj);
+ }
+ });
+
+
+ }
+
+ UpdatableStore.prototype.update = function() {
+ var store = this.store;
+
+
+ xhr.get({url: this.query, handleAs: "json"}).then(function(data)
+ {
+ // handle deletes
+ // iterate over existing store... if not in new data then remove
+ store.query({ }).forEach(function(object)
+ {
+ for(var i=0; i < data.length; i++)
+ {
+ if(data[i].id == object.id)
+ {
+ return;
+ }
+ }
+ store.remove(object.id);
+ //store.notify(null, object.id);
+ });
+
+ // iterate over data...
+ for(var i=0; i < data.length; i++)
+ {
+ if(item = store.get(data[i].id))
+ {
+ var modified;
+ for(var propName in data[i])
+ {
+ if(item[ propName ] != data[i][ propName ])
+ {
+ item[ propName ] = data[i][ propName ];
+ modified = true;
+ }
+ }
+ if(modified)
+ {
+ // ... check attributes for updates
+ store.notify(item, data[i].id);
+ }
+ }
+ else
+ {
+ // ,,, if not in the store then add
+ store.put(data[i]);
+ //store.notify(data[i], null);
+ }
+ }
+ });
+ };
+
+ exchangeTuple = new UpdatableStore("/rest/exchange", "exchanges",
+ [ { name: "Name", field: "name", width: "190px"},
+ { name: "Type", field: "type", width: "90px"},
+ { name: "Durable", field: "durable", width: "80px"},
+ { name: "Auto-Delete", field: "auto-delete", width: "100px"},
+ { name: "Bindings", field: "binding-count", width: "80px"}
+ ]);
+ queueTuple = new UpdatableStore("/rest/queue", "queues",
+ [ { name: "Name", field: "name", width: "240px"},
+ { name: "Durable", field: "durable", width: "100px"},
+ { name: "Auto-Delete", field: "auto-delete", width: "100px"},
+ { name: "Bindings", field: "binding-count", width: "100px"} ]);
+ connectionTuple = new UpdatableStore("/rest/connection", "connections",
+ [ { name: "Name", field: "name", width: "160px"},
+ { name: "Sessions", field: "session-count", width: "80px"},
+ { name: "Msgs In", field: "msgs-in-total", width: "80px"},
+ { name: "Msgs Out", field: "msgs-out-total",width: "80px"},
+ { name: "Bytes In", field: "bytes-in-total", width: "80px"},
+ { name: "Bytes Out", field: "bytes-out-total",width: "80px"}]);
+
+ vhostTuple = new UpdatableStore("/rest/virtualhost", "virtualHosts",
+ [ { name: "Name", field: "name", width: "180px"},
+ { name: "Connections", field: "connection-count", width: "90px"},
+ { name: "Queues", field: "queue-count", width: "90px"},
+ { name: "Exchanges", field: "exchange-count", width: "90px"},
+ { name: "Msgs In", field: "msgs-in-total", width: "80px"},
+ { name: "Msgs Out", field: "msgs-out-total",width: "80px"},
+ { name: "Bytes In", field: "bytes-in-total", width: "80px"},
+ { name: "Bytes Out", field: "bytes-out-total",width: "80px"} ],
+ function(obj)
+ {
+ dojo.connect(obj.grid, "onRowClick", obj.grid, function(evt){
+ var idx = evt.rowIndex,
+ item = this.getItem(idx);
+
+ exchangeTuple.query = "/rest/exchange/"+obj.dataStore.getValue(item, "name")+"/";
+ exchangeTuple.update();
+ queueTuple.query = "/rest/queue/"+obj.dataStore.getValue(item, "name")+"/";
+ queueTuple.update();
+ connectionTuple.query = "/rest/connection/"+obj.dataStore.getValue(item, "name")+"/";
+ connectionTuple.update();
+
+ });
+ });
+
+
+ setInterval(function(){
+ for(var i = 0; i < updateList.length; i++)
+ {
+ var obj = updateList[i];
+ obj.update();
+ }}, 5000); // every second
+ });
+
Modified: qpid/branches/java-config-and-management/qpid/java/broker/etc/config.xml
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker/etc/config.xml?rev=1300204&r1=1300203&r2=1300204&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker/etc/config.xml (original)
+++ qpid/branches/java-config-and-management/qpid/java/broker/etc/config.xml Tue Mar 13 15:56:45 2012
@@ -43,7 +43,7 @@
<socketSendBuffer>262144</socketSendBuffer>
</connector>
<management>
- <enabled>true</enabled>
+ <enabled>false</enabled>
<jmxport>
<registryServer>8999</registryServer>
<!--
Modified: qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/log4j/xml/QpidLog4JConfigurator.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/log4j/xml/QpidLog4JConfigurator.java?rev=1300204&r1=1300203&r2=1300204&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/log4j/xml/QpidLog4JConfigurator.java (original)
+++ qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/log4j/xml/QpidLog4JConfigurator.java Tue Mar 13 15:56:45 2012
@@ -22,12 +22,11 @@ package org.apache.log4j.xml;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
+import org.apache.qpid.server.management.LoggingManagementMBean;
import org.xml.sax.ErrorHandler;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
-import org.apache.qpid.server.logging.management.LoggingManagementMBean;
-
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
Modified: qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java?rev=1300204&r1=1300203&r2=1300204&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java (original)
+++ qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java Tue Mar 13 15:56:45 2012
@@ -213,7 +213,7 @@ public class AMQChannel implements Sessi
public void receivedComplete()
{
- sync();
+ //sync();
}
@@ -1566,7 +1566,7 @@ public class AMQChannel implements Sessi
_unfinishedCommandsQueue.add(new AsyncCommand(future, action));
}
- public void completeAsyncCommands()
+ public boolean completeAsyncCommands()
{
AsyncCommand cmd;
while((cmd = _unfinishedCommandsQueue.peek()) != null && cmd.isReadyForCompletion())
@@ -1580,6 +1580,7 @@ public class AMQChannel implements Sessi
cmd.awaitReadyForCompletion();
cmd.complete();
}
+ return _unfinishedCommandsQueue.isEmpty();
}
Modified: qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/Broker.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/Broker.java?rev=1300204&r1=1300203&r2=1300204&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/Broker.java (original)
+++ qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/Broker.java Tue Mar 13 15:56:45 2012
@@ -26,13 +26,13 @@ import org.apache.log4j.xml.QpidLog4JCon
import org.apache.qpid.server.configuration.ServerConfiguration;
import org.apache.qpid.server.configuration.ServerNetworkTransportConfiguration;
-import org.apache.qpid.server.configuration.management.ConfigurationManagementMBean;
-import org.apache.qpid.server.information.management.ServerInformationMBean;
+import org.apache.qpid.server.management.ConfigurationManagementMBean;
+import org.apache.qpid.server.management.LoggingManagementMBean;
+import org.apache.qpid.server.management.ServerInformationMBean;
import org.apache.qpid.server.logging.SystemOutMessageLogger;
import org.apache.qpid.server.logging.actors.BrokerActor;
import org.apache.qpid.server.logging.actors.CurrentActor;
import org.apache.qpid.server.logging.actors.GenericActor;
-import org.apache.qpid.server.logging.management.LoggingManagementMBean;
import org.apache.qpid.server.logging.messages.BrokerMessages;
import org.apache.qpid.server.protocol.AmqpProtocolVersion;
import org.apache.qpid.server.protocol.MultiVersionProtocolEngineFactory;
Modified: qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/connection/ConnectionRegistry.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/connection/ConnectionRegistry.java?rev=1300204&r1=1300203&r2=1300204&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/connection/ConnectionRegistry.java (original)
+++ qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/connection/ConnectionRegistry.java Tue Mar 13 15:56:45 2012
@@ -29,6 +29,7 @@ import org.apache.qpid.server.protocol.A
import org.apache.qpid.transport.TransportException;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
@@ -37,6 +38,8 @@ public class ConnectionRegistry implemen
private List<AMQConnectionModel> _registry = new CopyOnWriteArrayList<AMQConnectionModel>();
private Logger _logger = Logger.getLogger(ConnectionRegistry.class);
+ private final Collection<RegistryChangeListener> _listeners =
+ new ArrayList<RegistryChangeListener>();
public void initialise()
{
@@ -73,11 +76,34 @@ public class ConnectionRegistry implemen
public void registerConnection(AMQConnectionModel connnection)
{
_registry.add(connnection);
+ synchronized (_listeners)
+ {
+ for(RegistryChangeListener listener : _listeners)
+ {
+ listener.connectionRegistered(connnection);
+ }
+ }
}
public void deregisterConnection(AMQConnectionModel connnection)
{
_registry.remove(connnection);
+
+ synchronized (_listeners)
+ {
+ for(RegistryChangeListener listener : _listeners)
+ {
+ listener.connectionUnregistered(connnection);
+ }
+ }
+ }
+
+ public void addRegistryChangeListener(RegistryChangeListener listener)
+ {
+ synchronized (_listeners)
+ {
+ _listeners.add(listener);
+ }
}
public List<AMQConnectionModel> getConnections()
Modified: qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/connection/IConnectionRegistry.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/connection/IConnectionRegistry.java?rev=1300204&r1=1300203&r2=1300204&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/connection/IConnectionRegistry.java (original)
+++ qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/connection/IConnectionRegistry.java Tue Mar 13 15:56:45 2012
@@ -39,4 +39,13 @@ public interface IConnectionRegistry
public void registerConnection(AMQConnectionModel connnection);
public void deregisterConnection(AMQConnectionModel connnection);
+
+ void addRegistryChangeListener(RegistryChangeListener listener);
+
+ interface RegistryChangeListener
+ {
+ void connectionRegistered(AMQConnectionModel connection);
+ void connectionUnregistered(AMQConnectionModel connection);
+
+ }
}
Modified: qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/AbstractExchange.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/AbstractExchange.java?rev=1300204&r1=1300203&r2=1300204&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/AbstractExchange.java (original)
+++ qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/AbstractExchange.java Tue Mar 13 15:56:45 2012
@@ -32,6 +32,7 @@ import org.apache.qpid.server.logging.Lo
import org.apache.qpid.server.logging.actors.CurrentActor;
import org.apache.qpid.server.logging.messages.ExchangeMessages;
import org.apache.qpid.server.logging.subjects.ExchangeLogSubject;
+import org.apache.qpid.server.management.AbstractExchangeMBean;
import org.apache.qpid.server.management.Managable;
import org.apache.qpid.server.management.ManagedObject;
import org.apache.qpid.server.message.InboundMessage;
Modified: qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeRegistry.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeRegistry.java?rev=1300204&r1=1300203&r2=1300204&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeRegistry.java (original)
+++ qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeRegistry.java Tue Mar 13 15:56:45 2012
@@ -30,7 +30,9 @@ import org.apache.qpid.protocol.AMQConst
import org.apache.qpid.server.store.DurableConfigurationStore;
import org.apache.qpid.server.virtualhost.VirtualHost;
+import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
@@ -46,6 +48,8 @@ public class DefaultExchangeRegistry imp
private Exchange _defaultExchange;
private VirtualHost _host;
+ private final Collection<RegistryChangeListener> _listeners =
+ Collections.synchronizedCollection(new ArrayList<RegistryChangeListener>());
public DefaultExchangeRegistry(VirtualHost host)
{
@@ -70,6 +74,14 @@ public class DefaultExchangeRegistry imp
{
_exchangeMap.put(exchange.getNameShortString(), exchange);
_exchangeMapStr.put(exchange.getNameShortString().toString(), exchange);
+ synchronized (_listeners)
+ {
+ for(RegistryChangeListener listener : _listeners)
+ {
+ listener.exchangeRegistered(exchange);
+ }
+
+ }
}
public void setDefaultExchange(Exchange exchange)
@@ -116,6 +128,15 @@ public class DefaultExchangeRegistry imp
getDurableConfigurationStore().removeExchange(e);
}
e.close();
+
+ synchronized (_listeners)
+ {
+ for(RegistryChangeListener listener : _listeners)
+ {
+ listener.exchangeUnregistered(exchange);
+ }
+ }
+
}
else
{
@@ -128,6 +149,16 @@ public class DefaultExchangeRegistry imp
unregisterExchange(new AMQShortString(name), inUse);
}
+ public Collection<Exchange> getExchanges()
+ {
+ return new ArrayList<Exchange>(_exchangeMap.values());
+ }
+
+ public void addRegistryChangeListener(RegistryChangeListener listener)
+ {
+ _listeners.add(listener);
+ }
+
public Exchange getExchange(AMQShortString name)
{
if ((name == null) || name.length() == 0)
Modified: qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DirectExchange.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DirectExchange.java?rev=1300204&r1=1300203&r2=1300204&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DirectExchange.java (original)
+++ qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DirectExchange.java Tue Mar 13 15:56:45 2012
@@ -27,6 +27,8 @@ import org.apache.qpid.exchange.Exchange
import org.apache.qpid.framing.AMQShortString;
import org.apache.qpid.framing.FieldTable;
import org.apache.qpid.server.binding.Binding;
+import org.apache.qpid.server.management.AbstractExchangeMBean;
+import org.apache.qpid.server.management.DirectExchangeMBean;
import org.apache.qpid.server.message.InboundMessage;
import org.apache.qpid.server.queue.AMQQueue;
import org.apache.qpid.server.queue.BaseQueue;
Modified: qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeRegistry.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeRegistry.java?rev=1300204&r1=1300203&r2=1300204&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeRegistry.java (original)
+++ qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeRegistry.java Tue Mar 13 15:56:45 2012
@@ -7,9 +7,9 @@
* 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
@@ -52,4 +52,15 @@ public interface ExchangeRegistry
Exchange getExchange(String exchangeName);
void unregisterExchange(String exchange, boolean ifUnused) throws ExchangeInUseException, AMQException;;
+
+ Collection<Exchange> getExchanges();
+
+ void addRegistryChangeListener(RegistryChangeListener listener);
+
+ interface RegistryChangeListener
+ {
+ void exchangeRegistered(Exchange exchange);
+ void exchangeUnregistered(Exchange exchange);
+
+ }
}
Modified: qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/FanoutExchange.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/FanoutExchange.java?rev=1300204&r1=1300203&r2=1300204&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/FanoutExchange.java (original)
+++ qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/FanoutExchange.java Tue Mar 13 15:56:45 2012
@@ -27,6 +27,8 @@ import org.apache.qpid.exchange.Exchange
import org.apache.qpid.framing.AMQShortString;
import org.apache.qpid.framing.FieldTable;
import org.apache.qpid.server.binding.Binding;
+import org.apache.qpid.server.management.AbstractExchangeMBean;
+import org.apache.qpid.server.management.FanoutExchangeMBean;
import org.apache.qpid.server.message.InboundMessage;
import org.apache.qpid.server.queue.AMQQueue;
import org.apache.qpid.server.queue.BaseQueue;
Modified: qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/HeadersExchange.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/HeadersExchange.java?rev=1300204&r1=1300203&r2=1300204&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/HeadersExchange.java (original)
+++ qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/HeadersExchange.java Tue Mar 13 15:56:45 2012
@@ -27,6 +27,8 @@ import org.apache.qpid.exchange.Exchange
import org.apache.qpid.framing.AMQShortString;
import org.apache.qpid.framing.FieldTable;
import org.apache.qpid.server.binding.Binding;
+import org.apache.qpid.server.management.AbstractExchangeMBean;
+import org.apache.qpid.server.management.HeadersExchangeMBean;
import org.apache.qpid.server.message.AMQMessageHeader;
import org.apache.qpid.server.message.InboundMessage;
import org.apache.qpid.server.queue.AMQQueue;
Modified: qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/TopicExchange.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/TopicExchange.java?rev=1300204&r1=1300203&r2=1300204&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/TopicExchange.java (original)
+++ qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/TopicExchange.java Tue Mar 13 15:56:45 2012
@@ -47,6 +47,8 @@ import org.apache.qpid.server.exchange.t
import org.apache.qpid.server.exchange.topic.TopicParser;
import org.apache.qpid.server.filter.JMSSelectorFilter;
import org.apache.qpid.server.filter.MessageFilter;
+import org.apache.qpid.server.management.AbstractExchangeMBean;
+import org.apache.qpid.server.management.TopicExchangeMBean;
import org.apache.qpid.server.message.InboundMessage;
import org.apache.qpid.server.protocol.AMQSessionModel;
import org.apache.qpid.server.queue.AMQQueue;
Copied: qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/AMQBrokerManagerMBean.java (from r1300169, qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBean.java)
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/AMQBrokerManagerMBean.java?p2=qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/AMQBrokerManagerMBean.java&p1=qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBean.java&r1=1300169&r2=1300204&rev=1300204&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBean.java (original)
+++ qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/AMQBrokerManagerMBean.java Tue Mar 13 15:56:45 2012
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.qpid.server;
+package org.apache.qpid.server.management;
import org.apache.qpid.AMQException;
import org.apache.qpid.framing.AMQShortString;
@@ -31,15 +31,11 @@ import org.apache.qpid.server.exchange.E
import org.apache.qpid.server.exchange.ExchangeType;
import org.apache.qpid.server.logging.actors.CurrentActor;
import org.apache.qpid.server.logging.actors.ManagementActor;
-import org.apache.qpid.server.management.AMQManagedObject;
-import org.apache.qpid.server.management.ManagedObject;
import org.apache.qpid.server.queue.AMQQueue;
import org.apache.qpid.server.queue.AMQQueueFactory;
-import org.apache.qpid.server.queue.AMQQueueMBean;
import org.apache.qpid.server.queue.QueueRegistry;
import org.apache.qpid.server.store.DurableConfigurationStore;
import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.server.virtualhost.VirtualHostImpl;
import javax.management.JMException;
import javax.management.MBeanException;
@@ -63,10 +59,10 @@ public class AMQBrokerManagerMBean exten
private final Exchange _defaultExchange;
private final DurableConfigurationStore _durableConfig;
- private final VirtualHostImpl.VirtualHostMBean _virtualHostMBean;
+ private final VirtualHostMBean _virtualHostMBean;
@MBeanConstructor("Creates the Broker Manager MBean")
- public AMQBrokerManagerMBean(VirtualHostImpl.VirtualHostMBean virtualHostMBean) throws JMException
+ public AMQBrokerManagerMBean(VirtualHostMBean virtualHostMBean) throws JMException
{
super(ManagedBroker.class, ManagedBroker.TYPE);
Copied: qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/AMQProtocolSessionMBean.java (from r1300169, qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java)
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/AMQProtocolSessionMBean.java?p2=qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/AMQProtocolSessionMBean.java&p1=qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java&r1=1300169&r2=1300204&rev=1300204&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java (original)
+++ qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/AMQProtocolSessionMBean.java Tue Mar 13 15:56:45 2012
@@ -35,7 +35,7 @@
* limitations under the License.
*
*/
-package org.apache.qpid.server.protocol;
+package org.apache.qpid.server.management;
import org.apache.qpid.AMQException;
import org.apache.qpid.framing.AMQShortString;
@@ -49,6 +49,7 @@ import org.apache.qpid.server.logging.ac
import org.apache.qpid.server.logging.actors.ManagementActor;
import org.apache.qpid.server.management.AbstractAMQManagedConnectionObject;
import org.apache.qpid.server.management.ManagedObject;
+import org.apache.qpid.server.protocol.AMQProtocolSession;
import javax.management.JMException;
import javax.management.MBeanException;
Copied: qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/AMQQueueMBean.java (from r1300169, qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java)
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/AMQQueueMBean.java?p2=qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/AMQQueueMBean.java&p1=qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java&r1=1300169&r2=1300204&rev=1300204&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java (original)
+++ qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/AMQQueueMBean.java Tue Mar 13 15:56:45 2012
@@ -18,7 +18,7 @@
* under the License.
*
*/
-package org.apache.qpid.server.queue;
+package org.apache.qpid.server.management;
import org.apache.commons.lang.time.FastDateFormat;
import org.apache.log4j.Logger;
@@ -30,12 +30,14 @@ import org.apache.qpid.management.common
import org.apache.qpid.management.common.mbeans.annotations.MBeanConstructor;
import org.apache.qpid.management.common.mbeans.annotations.MBeanDescription;
import org.apache.qpid.server.exchange.Exchange;
-import org.apache.qpid.server.management.AMQManagedObject;
-import org.apache.qpid.server.management.ManagedObject;
import org.apache.qpid.server.message.AMQMessage;
import org.apache.qpid.server.message.AMQMessageHeader;
import org.apache.qpid.server.message.MessageTransferMessage;
import org.apache.qpid.server.message.ServerMessage;
+import org.apache.qpid.server.queue.AMQQueue;
+import org.apache.qpid.server.queue.NotificationCheck;
+import org.apache.qpid.server.queue.QueueEntry;
+import org.apache.qpid.server.queue.QueueNotificationListener;
import org.apache.qpid.transport.MessageProperties;
import javax.management.JMException;
@@ -55,13 +57,14 @@ import javax.management.openmbean.Simple
import javax.management.openmbean.TabularData;
import javax.management.openmbean.TabularDataSupport;
import javax.management.openmbean.TabularType;
+import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
/**
- * AMQQueueMBean is the management bean for an {@link AMQQueue}.
+ * AMQQueueMBean is the management bean for an {@link org.apache.qpid.server.queue.AMQQueue}.
*
* <p/><table id="crc"><caption>CRC Caption</caption>
* <tr><th> Responsibilities <th> Collaborations
@@ -131,7 +134,7 @@ public class AMQQueueMBean extends AMQMa
_msgContentAttributeTypes[0] = SimpleType.LONG; // For message id
_msgContentAttributeTypes[1] = SimpleType.STRING; // For MimeType
_msgContentAttributeTypes[2] = SimpleType.STRING; // For Encoding
- _msgContentAttributeTypes[3] = new ArrayType(1, SimpleType.BYTE); // For message content
+ _msgContentAttributeTypes[3] = new ArrayType(SimpleType.BYTE, true); // For message content
_msgContentType = new CompositeType("Message Content", "AMQ Message Content",
VIEW_MSG_CONTENT_COMPOSITE_ITEM_NAMES_DESC.toArray(new String[VIEW_MSG_CONTENT_COMPOSITE_ITEM_NAMES_DESC.size()]),
VIEW_MSG_CONTENT_COMPOSITE_ITEM_NAMES_DESC.toArray(new String[VIEW_MSG_CONTENT_COMPOSITE_ITEM_NAMES_DESC.size()]),
@@ -405,21 +408,15 @@ public class AMQQueueMBean extends AMQMa
ServerMessage serverMsg = entry.getMessage();
final int bodySize = (int) serverMsg.getSize();
-
- List<Byte> msgContent = new ArrayList<Byte>();
-
- java.nio.ByteBuffer buf = java.nio.ByteBuffer.allocate(bodySize);
+ byte[] msgContent = new byte[bodySize];
+
+ ByteBuffer buf = ByteBuffer.wrap(msgContent);
int position = 0;
while(position < bodySize)
{
position += serverMsg.getContent(buf, position);
- buf.flip();
- for(int i = 0; i < buf.limit(); i++)
- {
- msgContent.add(buf.get(i));
- }
- buf.clear();
+
}
AMQMessageHeader header = serverMsg.getMessageHeader();
@@ -433,7 +430,7 @@ public class AMQQueueMBean extends AMQMa
}
- Object[] itemValues = { msgId, mimeType, encoding, msgContent.toArray(new Byte[0]) };
+ Object[] itemValues = { msgId, mimeType, encoding, msgContent };
return new CompositeDataSupport(_msgContentType,
VIEW_MSG_CONTENT_COMPOSITE_ITEM_NAMES_DESC.toArray(
Copied: qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/AMQUserManagementMBean.java (from r1300169, qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/management/AMQUserManagementMBean.java)
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/AMQUserManagementMBean.java?p2=qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/AMQUserManagementMBean.java&p1=qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/management/AMQUserManagementMBean.java&r1=1300169&r2=1300204&rev=1300204&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/management/AMQUserManagementMBean.java (original)
+++ qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/AMQUserManagementMBean.java Tue Mar 13 15:56:45 2012
@@ -18,7 +18,7 @@
*
*
*/
-package org.apache.qpid.server.security.auth.management;
+package org.apache.qpid.server.management;
import org.apache.log4j.Logger;
Copied: qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/AbstractExchangeMBean.java (from r1300169, qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/AbstractExchangeMBean.java)
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/AbstractExchangeMBean.java?p2=qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/AbstractExchangeMBean.java&p1=qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/AbstractExchangeMBean.java&r1=1300169&r2=1300204&rev=1300204&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/AbstractExchangeMBean.java (original)
+++ qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/AbstractExchangeMBean.java Tue Mar 13 15:56:45 2012
@@ -18,11 +18,12 @@
* under the License.
*
*/
-package org.apache.qpid.server.exchange;
+package org.apache.qpid.server.management;
import org.apache.qpid.AMQException;
import org.apache.qpid.framing.AMQShortString;
import org.apache.qpid.management.common.mbeans.ManagedExchange;
+import org.apache.qpid.server.exchange.AbstractExchange;
import org.apache.qpid.server.logging.actors.CurrentActor;
import org.apache.qpid.server.logging.actors.ManagementActor;
import org.apache.qpid.server.management.AMQManagedObject;
@@ -158,7 +159,7 @@ public abstract class AbstractExchangeMB
/**
* Removes a queue binding from the exchange.
*
- * @see org.apache.qpid.server.binding.BindingFactory#removeBinding(String, AMQQueue, Exchange, java.util.Map)
+ * @see org.apache.qpid.server.binding.BindingFactory#removeBinding(String, AMQQueue, org.apache.qpid.server.exchange.Exchange, java.util.Map)
*/
public void removeBinding(String queueName, String binding) throws JMException
{
Copied: qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ConfigurationManagementMBean.java (from r1300169, qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/management/ConfigurationManagementMBean.java)
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ConfigurationManagementMBean.java?p2=qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ConfigurationManagementMBean.java&p1=qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/management/ConfigurationManagementMBean.java&r1=1300169&r2=1300204&rev=1300204&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/management/ConfigurationManagementMBean.java (original)
+++ qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ConfigurationManagementMBean.java Tue Mar 13 15:56:45 2012
@@ -18,7 +18,7 @@
* under the License.
*
*/
-package org.apache.qpid.server.configuration.management;
+package org.apache.qpid.server.management;
import org.apache.qpid.management.common.mbeans.ConfigurationManagement;
import org.apache.qpid.server.management.AMQManagedObject;
Copied: qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/DirectExchangeMBean.java (from r1300169, qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DirectExchangeMBean.java)
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/DirectExchangeMBean.java?p2=qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/DirectExchangeMBean.java&p1=qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DirectExchangeMBean.java&r1=1300169&r2=1300204&rev=1300204&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DirectExchangeMBean.java (original)
+++ qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/DirectExchangeMBean.java Tue Mar 13 15:56:45 2012
@@ -18,11 +18,13 @@
* under the License.
*
*/
-package org.apache.qpid.server.exchange;
+package org.apache.qpid.server.management;
import org.apache.qpid.management.common.mbeans.annotations.MBeanConstructor;
import org.apache.qpid.management.common.mbeans.annotations.MBeanDescription;
import org.apache.qpid.server.binding.Binding;
+import org.apache.qpid.server.exchange.DirectExchange;
+import org.apache.qpid.server.management.AbstractExchangeMBean;
import javax.management.JMException;
import javax.management.openmbean.CompositeData;
@@ -39,7 +41,7 @@ import java.util.Map;
* MBean class implementing the management interfaces.
*/
@MBeanDescription("Management Bean for Direct Exchange")
-final class DirectExchangeMBean extends AbstractExchangeMBean<DirectExchange>
+public final class DirectExchangeMBean extends AbstractExchangeMBean<DirectExchange>
{
@MBeanConstructor("Creates an MBean for AMQ direct exchange")
public DirectExchangeMBean(final DirectExchange exchange) throws JMException
Copied: qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/FanoutExchangeMBean.java (from r1300169, qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/FanoutExchangeMBean.java)
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/FanoutExchangeMBean.java?p2=qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/FanoutExchangeMBean.java&p1=qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/FanoutExchangeMBean.java&r1=1300169&r2=1300204&rev=1300204&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/FanoutExchangeMBean.java (original)
+++ qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/FanoutExchangeMBean.java Tue Mar 13 15:56:45 2012
@@ -18,11 +18,13 @@
* under the License.
*
*/
-package org.apache.qpid.server.exchange;
+package org.apache.qpid.server.management;
import org.apache.qpid.management.common.mbeans.annotations.MBeanConstructor;
import org.apache.qpid.management.common.mbeans.annotations.MBeanDescription;
import org.apache.qpid.server.binding.Binding;
+import org.apache.qpid.server.exchange.FanoutExchange;
+import org.apache.qpid.server.management.AbstractExchangeMBean;
import javax.management.JMException;
import javax.management.openmbean.CompositeData;
@@ -36,7 +38,7 @@ import java.util.ArrayList;
* MBean class implementing the management interfaces.
*/
@MBeanDescription("Management Bean for Fanout Exchange")
-final class FanoutExchangeMBean extends AbstractExchangeMBean<FanoutExchange>
+public final class FanoutExchangeMBean extends AbstractExchangeMBean<FanoutExchange>
{
private static final String BINDING_KEY_SUBSTITUTE = "*";
Copied: qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/HeadersExchangeMBean.java (from r1300169, qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/HeadersExchangeMBean.java)
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/HeadersExchangeMBean.java?p2=qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/HeadersExchangeMBean.java&p1=qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/HeadersExchangeMBean.java&r1=1300169&r2=1300204&rev=1300204&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/HeadersExchangeMBean.java (original)
+++ qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/HeadersExchangeMBean.java Tue Mar 13 15:56:45 2012
@@ -18,15 +18,17 @@
* under the License.
*
*/
-package org.apache.qpid.server.exchange;
+package org.apache.qpid.server.management;
import org.apache.qpid.AMQException;
import org.apache.qpid.framing.AMQShortString;
import org.apache.qpid.management.common.mbeans.annotations.MBeanConstructor;
import org.apache.qpid.management.common.mbeans.annotations.MBeanDescription;
import org.apache.qpid.server.binding.Binding;
+import org.apache.qpid.server.exchange.HeadersExchange;
import org.apache.qpid.server.logging.actors.CurrentActor;
import org.apache.qpid.server.logging.actors.ManagementActor;
+import org.apache.qpid.server.management.AbstractExchangeMBean;
import org.apache.qpid.server.queue.AMQQueue;
import org.apache.qpid.server.virtualhost.VirtualHost;
@@ -52,7 +54,7 @@ import java.util.Map;
* Header Exchanges.
*/
@MBeanDescription("Management Bean for Headers Exchange")
-final class HeadersExchangeMBean extends AbstractExchangeMBean<HeadersExchange>
+public final class HeadersExchangeMBean extends AbstractExchangeMBean<HeadersExchange>
{
@MBeanConstructor("Creates an MBean for AMQ Headers exchange")
Modified: qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/JMXManagedObjectRegistry.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/JMXManagedObjectRegistry.java?rev=1300204&r1=1300203&r2=1300204&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/JMXManagedObjectRegistry.java (original)
+++ qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/JMXManagedObjectRegistry.java Tue Mar 13 15:56:45 2012
@@ -253,7 +253,6 @@ public class JMXManagedObjectRegistry im
final NotificationListener mapCleanupListener = new NotificationListener()
{
- @Override
public void handleNotification(Notification notification, Object handback)
{
final String connectionId = ((JMXConnectionNotification) notification).getConnectionId();
Copied: qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/LoggingManagementMBean.java (from r1300169, qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/management/LoggingManagementMBean.java)
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/LoggingManagementMBean.java?p2=qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/LoggingManagementMBean.java&p1=qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/management/LoggingManagementMBean.java&r1=1300169&r2=1300204&rev=1300204&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/management/LoggingManagementMBean.java (original)
+++ qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/LoggingManagementMBean.java Tue Mar 13 15:56:45 2012
@@ -18,7 +18,7 @@
*
*
*/
-package org.apache.qpid.server.logging.management;
+package org.apache.qpid.server.management;
import org.apache.log4j.Level;
import org.apache.log4j.LogManager;
@@ -35,7 +35,6 @@ import org.xml.sax.SAXException;
import org.apache.qpid.management.common.mbeans.LoggingManagement;
import org.apache.qpid.management.common.mbeans.annotations.MBeanDescription;
-import org.apache.qpid.server.management.AMQManagedObject;
import javax.management.JMException;
import javax.management.openmbean.CompositeData;
Copied: qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ServerConnectionMBean.java (from r1300169, qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/transport/ServerConnectionMBean.java)
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ServerConnectionMBean.java?p2=qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ServerConnectionMBean.java&p1=qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/transport/ServerConnectionMBean.java&r1=1300169&r2=1300204&rev=1300204&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/transport/ServerConnectionMBean.java (original)
+++ qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ServerConnectionMBean.java Tue Mar 13 15:56:45 2012
@@ -18,7 +18,7 @@
* under the License.
*
*/
-package org.apache.qpid.server.transport;
+package org.apache.qpid.server.management;
import org.apache.qpid.management.common.mbeans.annotations.MBeanConstructor;
import org.apache.qpid.management.common.mbeans.annotations.MBeanDescription;
@@ -27,6 +27,8 @@ import org.apache.qpid.server.logging.ac
import org.apache.qpid.server.management.AbstractAMQManagedConnectionObject;
import org.apache.qpid.server.management.ManagedObject;
import org.apache.qpid.server.protocol.AMQSessionModel;
+import org.apache.qpid.server.transport.ServerConnection;
+import org.apache.qpid.server.transport.ServerSession;
import javax.management.JMException;
import javax.management.NotCompliantMBeanException;
@@ -48,7 +50,7 @@ public class ServerConnectionMBean exten
private final ServerConnection _serverConnection;
@MBeanConstructor("Creates an MBean exposing an AMQ Broker 0-10 Connection")
- protected ServerConnectionMBean(final ServerConnection serverConnection) throws NotCompliantMBeanException
+ public ServerConnectionMBean(final ServerConnection serverConnection) throws NotCompliantMBeanException
{
super(serverConnection.getConfig().getAddress());
_serverConnection = serverConnection;
@@ -60,43 +62,36 @@ public class ServerConnectionMBean exten
return _serverConnection.getVirtualHost().getManagedObject();
}
- @Override
public String getClientId()
{
return _serverConnection.getClientId();
}
- @Override
public String getAuthorizedId()
{
return _serverConnection.getAuthorizedPrincipal().getName();
}
- @Override
public String getVersion()
{
return String.valueOf(_serverConnection.getClientVersion());
}
- @Override
public String getRemoteAddress()
{
return _serverConnection.getConfig().getAddress();
}
- @Override
public Date getLastIoTime()
{
return new Date(_serverConnection.getLastIoTime().longValue());
}
- @Override
public Long getMaximumNumberOfChannels()
{
return (long) _serverConnection.getConnectionDelegate().getChannelMax();
}
- @Override
public TabularData channels() throws IOException, JMException
{
final TabularDataSupport channelsList = new TabularDataSupport(_channelsType);
@@ -121,7 +116,6 @@ public class ServerConnectionMBean exten
return channelsList;
}
- @Override
public void commitTransactions(int channelId) throws JMException
{
final ServerSession session = (ServerSession)_serverConnection.getSession(channelId);
@@ -143,7 +137,6 @@ public class ServerConnectionMBean exten
}
}
- @Override
public void rollbackTransactions(int channelId) throws JMException
{
final ServerSession session = (ServerSession)_serverConnection.getSession(channelId);
@@ -165,97 +158,81 @@ public class ServerConnectionMBean exten
}
}
- @Override
public void closeConnection() throws Exception
{
_serverConnection.mgmtClose();
}
- @Override
public void resetStatistics() throws Exception
{
_serverConnection.resetStatistics();
}
- @Override
public double getPeakMessageDeliveryRate()
{
return _serverConnection.getMessageDeliveryStatistics().getPeak();
}
- @Override
public double getPeakDataDeliveryRate()
{
return _serverConnection.getDataDeliveryStatistics().getPeak();
}
- @Override
public double getMessageDeliveryRate()
{
return _serverConnection.getMessageDeliveryStatistics().getRate();
}
- @Override
public double getDataDeliveryRate()
{
return _serverConnection.getDataDeliveryStatistics().getRate();
}
- @Override
public long getTotalMessagesDelivered()
{
return _serverConnection.getMessageDeliveryStatistics().getTotal();
}
- @Override
public long getTotalDataDelivered()
{
return _serverConnection.getDataDeliveryStatistics().getTotal();
}
- @Override
public double getPeakMessageReceiptRate()
{
return _serverConnection.getMessageReceiptStatistics().getPeak();
}
- @Override
public double getPeakDataReceiptRate()
{
return _serverConnection.getDataReceiptStatistics().getPeak();
}
- @Override
public double getMessageReceiptRate()
{
return _serverConnection.getMessageReceiptStatistics().getRate();
}
- @Override
public double getDataReceiptRate()
{
return _serverConnection.getDataReceiptStatistics().getRate();
}
- @Override
public long getTotalMessagesReceived()
{
return _serverConnection.getMessageReceiptStatistics().getTotal();
}
- @Override
public long getTotalDataReceived()
{
return _serverConnection.getDataReceiptStatistics().getTotal();
}
- @Override
public boolean isStatisticsEnabled()
{
return _serverConnection.isStatisticsEnabled();
}
- @Override
public void setStatisticsEnabled(boolean enabled)
{
_serverConnection.setStatisticsEnabled(enabled);
Copied: qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ServerInformationMBean.java (from r1300169, qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/information/management/ServerInformationMBean.java)
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ServerInformationMBean.java?p2=qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ServerInformationMBean.java&p1=qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/information/management/ServerInformationMBean.java&r1=1300169&r2=1300204&rev=1300204&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/information/management/ServerInformationMBean.java (original)
+++ qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ServerInformationMBean.java Tue Mar 13 15:56:45 2012
@@ -18,7 +18,7 @@
*
*
*/
-package org.apache.qpid.server.information.management;
+package org.apache.qpid.server.management;
import org.apache.qpid.common.QpidProperties;
import org.apache.qpid.management.common.mbeans.ServerInformation;
Copied: qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/TopicExchangeMBean.java (from r1300169, qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/TopicExchangeMBean.java)
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/TopicExchangeMBean.java?p2=qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/TopicExchangeMBean.java&p1=qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/TopicExchangeMBean.java&r1=1300169&r2=1300204&rev=1300204&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/TopicExchangeMBean.java (original)
+++ qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/TopicExchangeMBean.java Tue Mar 13 15:56:45 2012
@@ -18,11 +18,13 @@
* under the License.
*
*/
-package org.apache.qpid.server.exchange;
+package org.apache.qpid.server.management;
import org.apache.qpid.management.common.mbeans.annotations.MBeanConstructor;
import org.apache.qpid.management.common.mbeans.annotations.MBeanDescription;
import org.apache.qpid.server.binding.Binding;
+import org.apache.qpid.server.exchange.TopicExchange;
+import org.apache.qpid.server.management.AbstractExchangeMBean;
import javax.management.JMException;
import javax.management.openmbean.CompositeData;
@@ -37,7 +39,7 @@ import java.util.Map;
/** TopicExchangeMBean class implements the management interface for the Topic exchanges. */
@MBeanDescription("Management Bean for Topic Exchange")
-final class TopicExchangeMBean extends AbstractExchangeMBean<TopicExchange>
+public final class TopicExchangeMBean extends AbstractExchangeMBean<TopicExchange>
{
private TopicExchange _topicExchange;
Copied: qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/VirtualHostMBean.java (from r1300169, qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/management/ConfigurationManagementMBean.java)
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/VirtualHostMBean.java?p2=qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/VirtualHostMBean.java&p1=qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/management/ConfigurationManagementMBean.java&r1=1300169&r2=1300204&rev=1300204&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/management/ConfigurationManagementMBean.java (original)
+++ qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/management/VirtualHostMBean.java Tue Mar 13 15:56:45 2012
@@ -7,9 +7,9 @@
* 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
@@ -18,30 +18,44 @@
* under the License.
*
*/
-package org.apache.qpid.server.configuration.management;
-import org.apache.qpid.management.common.mbeans.ConfigurationManagement;
+package org.apache.qpid.server.management;
+
import org.apache.qpid.server.management.AMQManagedObject;
-import org.apache.qpid.server.registry.ApplicationRegistry;
+import org.apache.qpid.server.virtualhost.ManagedVirtualHost;
+import org.apache.qpid.server.virtualhost.VirtualHostImpl;
import javax.management.NotCompliantMBeanException;
+import javax.management.ObjectName;
-public class ConfigurationManagementMBean extends AMQManagedObject implements ConfigurationManagement
+/**
+ * Virtual host JMX MBean class.
+ *
+ * This has some of the methods implemented from management intrerface for exchanges. Any
+ * implementaion of an Exchange MBean should extend this class.
+ */
+public class VirtualHostMBean extends AMQManagedObject implements ManagedVirtualHost
{
+ private VirtualHostImpl _virtualHost;
- public ConfigurationManagementMBean() throws NotCompliantMBeanException
+ public VirtualHostMBean(VirtualHostImpl virtualHost) throws NotCompliantMBeanException
{
- super(ConfigurationManagement.class, ConfigurationManagement.TYPE);
+ super(ManagedVirtualHost.class, ManagedVirtualHost.TYPE);
+ _virtualHost = virtualHost;
}
public String getObjectInstanceName()
{
- return ConfigurationManagement.TYPE;
+ return ObjectName.quote(_virtualHost.getName());
}
- public void reloadSecurityConfiguration() throws Exception
+ public String getName()
{
- ApplicationRegistry.getInstance().getConfiguration().reparseConfigFileSecuritySections();
+ return _virtualHost.getName();
}
+ public VirtualHostImpl getVirtualHost()
+ {
+ return _virtualHost;
+ }
}
Copied: qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/model/AuthenticationMethod.java (from r1300169, qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueRegistry.java)
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/model/AuthenticationMethod.java?p2=qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/model/AuthenticationMethod.java&p1=qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueRegistry.java&r1=1300169&r2=1300204&rev=1300204&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueRegistry.java (original)
+++ qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/model/AuthenticationMethod.java Tue Mar 13 15:56:45 2012
@@ -18,26 +18,16 @@
* under the License.
*
*/
-package org.apache.qpid.server.queue;
-
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.server.virtualhost.VirtualHost;
+package org.apache.qpid.server.model;
import java.util.Collection;
-public interface QueueRegistry
+public interface AuthenticationMethod extends ConfiguredObject
{
- VirtualHost getVirtualHost();
-
- void registerQueue(AMQQueue queue);
-
- void unregisterQueue(AMQShortString name);
-
- AMQQueue getQueue(AMQShortString name);
-
- Collection<AMQShortString> getQueueNames();
+ // name is the SASL mech where this is a SASL authentication
- Collection<AMQQueue> getQueues();
+ // parents
+ VirtualHostAlias getVirtualHostAlias();
+ AuthenticationProvider getAuthenticationProvider();
- AMQQueue getQueue(String queue);
}
Copied: qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/model/AuthenticationProvider.java (from r1300169, qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueRegistry.java)
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/model/AuthenticationProvider.java?p2=qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/model/AuthenticationProvider.java&p1=qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueRegistry.java&r1=1300169&r2=1300204&rev=1300204&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueRegistry.java (original)
+++ qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/model/AuthenticationProvider.java Tue Mar 13 15:56:45 2012
@@ -18,26 +18,12 @@
* under the License.
*
*/
-package org.apache.qpid.server.queue;
-
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.server.virtualhost.VirtualHost;
+package org.apache.qpid.server.model;
import java.util.Collection;
-public interface QueueRegistry
+public interface AuthenticationProvider extends ConfiguredObject
{
- VirtualHost getVirtualHost();
-
- void registerQueue(AMQQueue queue);
-
- void unregisterQueue(AMQShortString name);
-
- AMQQueue getQueue(AMQShortString name);
-
- Collection<AMQShortString> getQueueNames();
-
- Collection<AMQQueue> getQueues();
-
- AMQQueue getQueue(String queue);
+ //children
+ Collection<VirtualHostAlias> getVirtualHostPortBindings();
}
Copied: qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Binding.java (from r1300169, qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueRegistry.java)
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Binding.java?p2=qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Binding.java&p1=qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueRegistry.java&r1=1300169&r2=1300204&rev=1300204&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueRegistry.java (original)
+++ qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Binding.java Tue Mar 13 15:56:45 2012
@@ -18,26 +18,11 @@
* under the License.
*
*/
-package org.apache.qpid.server.queue;
+package org.apache.qpid.server.model;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.server.virtualhost.VirtualHost;
+import java.util.Map;
-import java.util.Collection;
-
-public interface QueueRegistry
+public interface Binding extends ConfiguredObject
{
- VirtualHost getVirtualHost();
-
- void registerQueue(AMQQueue queue);
-
- void unregisterQueue(AMQShortString name);
-
- AMQQueue getQueue(AMQShortString name);
-
- Collection<AMQShortString> getQueueNames();
-
- Collection<AMQQueue> getQueues();
-
- AMQQueue getQueue(String queue);
+ Map<String,Object> getArguments();
}
Copied: qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Broker.java (from r1300169, qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueRegistry.java)
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Broker.java?p2=qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Broker.java&p1=qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueRegistry.java&r1=1300169&r2=1300204&rev=1300204&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueRegistry.java (original)
+++ qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Broker.java Tue Mar 13 15:56:45 2012
@@ -18,26 +18,25 @@
* under the License.
*
*/
-package org.apache.qpid.server.queue;
-
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.server.virtualhost.VirtualHost;
+package org.apache.qpid.server.model;
+import java.security.AccessControlException;
import java.util.Collection;
+import java.util.Map;
-public interface QueueRegistry
+public interface Broker extends ConfiguredObject
{
- VirtualHost getVirtualHost();
-
- void registerQueue(AMQQueue queue);
-
- void unregisterQueue(AMQShortString name);
+ //children
+ Collection<VirtualHost> getVirtualHosts();
- AMQQueue getQueue(AMQShortString name);
+ Collection<Port> getPorts();
- Collection<AMQShortString> getQueueNames();
+ Collection<AuthenticationProvider> getAuthenticationProviders();
- Collection<AMQQueue> getQueues();
+ VirtualHost createVirtualHost(String name, State initialState, boolean durable,
+ LifetimePolicy lifetime, long ttl, Map<String, Object> attributes)
+ throws AccessControlException, IllegalArgumentException;
- AMQQueue getQueue(String queue);
+ void deleteVirtualHost(VirtualHost virtualHost)
+ throws AccessControlException, IllegalStateException;
}
Copied: qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/model/ConfigurationChangeListener.java (from r1300169, qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueRegistry.java)
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/model/ConfigurationChangeListener.java?p2=qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/model/ConfigurationChangeListener.java&p1=qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueRegistry.java&r1=1300169&r2=1300204&rev=1300204&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueRegistry.java (original)
+++ qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/model/ConfigurationChangeListener.java Tue Mar 13 15:56:45 2012
@@ -18,26 +18,22 @@
* under the License.
*
*/
-package org.apache.qpid.server.queue;
+package org.apache.qpid.server.model;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-
-import java.util.Collection;
-
-public interface QueueRegistry
+public interface ConfigurationChangeListener
{
- VirtualHost getVirtualHost();
-
- void registerQueue(AMQQueue queue);
-
- void unregisterQueue(AMQShortString name);
-
- AMQQueue getQueue(AMQShortString name);
-
- Collection<AMQShortString> getQueueNames();
+ /**
+ * Inform the listener that the passed object has changed state
+ *
+ * @param object the object whose state has changed
+ * @param oldState the state prior to the change
+ * @param newState the state after the change
+ */
+ void stateChanged(ConfiguredObject object, State oldState, State newState);
+
+
+ void childAdded(ConfiguredObject object, ConfiguredObject child);
- Collection<AMQQueue> getQueues();
+ void childRemoved(ConfiguredObject object, ConfiguredObject child);
- AMQQueue getQueue(String queue);
}
Added: qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/model/ConfiguredObject.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/model/ConfiguredObject.java?rev=1300204&view=auto
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/model/ConfiguredObject.java (added)
+++ qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/model/ConfiguredObject.java Tue Mar 13 15:56:45 2012
@@ -0,0 +1,229 @@
+/*
+ *
+ * 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.qpid.server.model;
+
+import java.security.AccessControlException;
+import java.util.Collection;
+import java.util.UUID;
+
+public interface ConfiguredObject
+{
+
+ /**
+ * Get the universally unique identifier for the object
+ *
+ * @return the objects id
+ */
+ UUID getId();
+
+ /**
+ * Get the name of the object
+ *
+ * @return the name of the object
+ */
+ String getName();
+
+
+ /**
+ * Attempt to change the name of the object
+ *
+ * Request a change to the name of the object. The caller must pass in the name it believes the object currently
+ * has. If the current name differes from this expected value, then no name change will occur
+ *
+ * @param currentName the name the caller believes the object to have
+ * @param desiredName the name the caller would like the object to have
+ * @return the new name for the object
+ * @throws IllegalStateException if the name of the object may not be changed in in the current state
+ * @throws AccessControlException if the current context does not have permission to change the name
+ * @throws IllegalArgumentException if the provided name is not legal
+ * @throws NullPointerException if the desired name is null
+ */
+ String setName(String currentName, String desiredName) throws IllegalStateException,
+ AccessControlException;
+
+
+ /**
+ * Get the desired state of the object.
+ *
+ * This is the state set at the object itself, however the object
+ * may not be able attain this state if one of its ancestors is in a different state (in particular a descendant
+ * object may not be ACTIVE if all of its ancestors are not also ACTIVE).
+ *
+ * @return the desired state of the object
+ */
+ State getDesiredState();
+
+ /**
+ * Change the desired state of the object
+ *
+ * Request a change to the current state. The caller must pass in the state it believe the object to be in, if
+ * this differs from the current desired state when the object evalues the request, then no state change will occur.
+ *
+ * @param currentState the state the caller believes the object to be in
+ * @param desiredState the state the caller wishes the object to attain
+ * @return the new current state
+ * @throws IllegalStateTransitionException the requested state tranisition is invalid
+ * @throws AccessControlException the current context does not have sufficeint permissions to change the state
+ */
+ State setDesiredState(State currentState, State desiredState) throws IllegalStateTransitionException,
+ AccessControlException;
+
+ /**
+ * Get the actual state of the object.
+ *
+ * This state is derived fromt the desired state of the object itself and
+ * the actual state of its parents. If an object "desires" to be ACTIVE, but one of its parents is STOPPED, then
+ * the actual state of the object will be STOPPED
+ *
+ * @return the actual state of the object
+ */
+ State getActualState();
+
+
+ /**
+ * Add a listener which will be informed of all changes to this configuration object
+ *
+ * @param listener the listener to add
+ */
+ void addChangeListener(ConfigurationChangeListener listener);
+
+ /**
+ * Remove a change listener
+ *
+ *
+ * @param listener the listener to remove
+ * @return true iff a listener was removed
+ */
+ boolean removeChangeListener(ConfigurationChangeListener listener);
+
+ /**
+ * Get the parent of the given type for this object
+ *
+ * @param clazz the class of parent being asked for
+ * @return the objects parent
+ */
+ <T extends ConfiguredObject> T getParent(Class<T> clazz);
+
+
+ /**
+ * Returns whether the the object configuration is durably stored
+ *
+ * @return the durablity
+ */
+ boolean isDurable();
+
+ /**
+ * Sets the durability of the object
+ *
+ * @param durable true iff the caller wishes the object to store its configuration durably
+ *
+ * @throws IllegalStateException if the durability cannot be changed in the current state
+ * @throws AccessControlException if the current context does not have sufficient permission to change the durability
+ * @throws IllegalArgumentException if the object does not support the requested durability
+ */
+ void setDurable(boolean durable) throws IllegalStateException,
+ AccessControlException,
+ IllegalArgumentException;
+
+ /**
+ * Return the lifetime policy for the object
+ *
+ * @return the lifetime policy
+ */
+ LifetimePolicy getLifetimePolicy();
+
+ /**
+ * Set the lifetime policy of the object
+ *
+ * @param expected The lifetime policy the caller believes the object currently has
+ * @param desired The lifetime policy the caller desires the object to have
+ * @return the new lifetime policy
+ * @throws IllegalStateException if the lifetime policy cannot be changed in the current state
+ * @throws AccessControlException if the caller does not have permission to change the lifetime policy
+ * @throws IllegalArgumentException if the object does not support the requested lifetime policy
+ */
+ LifetimePolicy setLifetimePolicy(LifetimePolicy expected, LifetimePolicy desired) throws IllegalStateException,
+ AccessControlException,
+ IllegalArgumentException;
+
+ /**
+ * Get the time the object will live once the lifetime policy conditions are no longer fulfilled
+ *
+ * @return the time to live
+ */
+ long getTimeToLive();
+
+ /**
+ * Set the ttl value
+ *
+ * @param expected the ttl the caller believes the object currently has
+ * @param desired the ttl value the caller
+ * @return the new ttl value
+ * @throws IllegalStateException if the ttl cannot be set in the current state
+ * @throws AccessControlException if the caller does not have permission to change the ttl
+ * @throws IllegalArgumentException if the object does not support the requested ttl value
+ */
+ long setTimeToLive(long expected, long desired) throws IllegalStateException,
+ AccessControlException,
+ IllegalArgumentException;
+
+ /**
+ * Get the names of attributes that are set on this object
+ *
+ * Not that the returned collection is correct at the time the method is called, but will not reflect future
+ * additions or removals when they occur
+ *
+ * @return the collection of attribute names
+ */
+ Collection<String> getAttributeNames();
+
+
+ /**
+ * Return the value for the given attribute
+ *
+ * @param name the name of the attribute
+ * @return the value of the attribute at the object (or null if the attribute is not set
+ */
+ Object getAttribute(String name);
+
+ /**
+ * Set the value of an attribute
+ *
+ * @param name the name of the attribute to be set
+ * @param expected the value the caller believes the attribute currently has (or null if it is expected to be unset)
+ * @param desired the desired value for the attribute (or null to unset the attribute)
+ * @return the new value for the given attribute
+ * @throws IllegalStateException if the attribute cannot be set while the object is in its current state
+ * @throws AccessControlException if the caller does not have permission to alter the value of the attribute
+ * @throws IllegalArgumentException if the provided value is not valid for the given argument
+ */
+ Object setAttribute(String name, Object expected, Object desired) throws IllegalStateException,
+ AccessControlException,
+ IllegalArgumentException;
+
+
+ /**
+ * Return the Statistics holder for the ConfiguredObject
+ *
+ * @return the Statistics holder for the ConfiguredObject (or null if none exists)
+ */
+ Statistics getStatistics();
+}
Copied: qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Connection.java (from r1300169, qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueRegistry.java)
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Connection.java?p2=qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Connection.java&p1=qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueRegistry.java&r1=1300169&r2=1300204&rev=1300204&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueRegistry.java (original)
+++ qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Connection.java Tue Mar 13 15:56:45 2012
@@ -18,26 +18,12 @@
* under the License.
*
*/
-package org.apache.qpid.server.queue;
-
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.server.virtualhost.VirtualHost;
+package org.apache.qpid.server.model;
import java.util.Collection;
-public interface QueueRegistry
+public interface Connection extends ConfiguredObject
{
- VirtualHost getVirtualHost();
-
- void registerQueue(AMQQueue queue);
-
- void unregisterQueue(AMQShortString name);
-
- AMQQueue getQueue(AMQShortString name);
-
- Collection<AMQShortString> getQueueNames();
-
- Collection<AMQQueue> getQueues();
-
- AMQQueue getQueue(String queue);
+ //children
+ Collection<Session> getSessions();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org