git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1429878 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Timothy A. Bish 2013-01-07 16:19:35 +00:00
parent f79f7ad426
commit 3cd8da80a6
1 changed files with 53 additions and 67 deletions

View File

@ -224,8 +224,8 @@ public class BrokerService implements Service {
private boolean allowTempAutoCreationOnSend;
private JobSchedulerStore jobSchedulerStore;
private int offlineDurableSubscriberTimeout = -1;
private int offlineDurableSubscriberTaskSchedule = 300000;
private long offlineDurableSubscriberTimeout = -1;
private long offlineDurableSubscriberTaskSchedule = 300000;
private DestinationFilter virtualConsumerDestinationFilter;
private final Object persistenceAdapterLock = new Object();
@ -812,8 +812,7 @@ public class BrokerService implements Service {
* @param pollInterval
* @throws Exception
*/
public void stopGracefully(String connectorName, String queueName, long timeout, long pollInterval)
throws Exception {
public void stopGracefully(String connectorName, String queueName, long timeout, long pollInterval) throws Exception {
if (isUseJmx()) {
if (connectorName == null || queueName == null || timeout <= 0) {
throw new Exception(
@ -1349,8 +1348,7 @@ public class BrokerService implements Service {
* nestedType="org.apache.activemq.broker.TransportConnector"
*/
public void setTransportConnectors(List<TransportConnector> transportConnectors) throws Exception {
for (Iterator<TransportConnector> iter = transportConnectors.iterator(); iter.hasNext();) {
TransportConnector connector = iter.next();
for (TransportConnector connector : transportConnectors) {
addConnector(connector);
}
}
@ -1388,10 +1386,9 @@ public class BrokerService implements Service {
* @org.apache.xbean.Property
* nestedType="org.apache.activemq.network.NetworkConnector"
*/
public void setNetworkConnectors(List networkConnectors) throws Exception {
for (Iterator iter = networkConnectors.iterator(); iter.hasNext();) {
NetworkConnector connector = (NetworkConnector) iter.next();
addNetworkConnector(connector);
public void setNetworkConnectors(List<?> networkConnectors) throws Exception {
for (Object connector : networkConnectors) {
addNetworkConnector((NetworkConnector) connector);
}
}
@ -1399,10 +1396,9 @@ public class BrokerService implements Service {
* Sets the network connectors which this broker will use to connect to
* other brokers in a federated network
*/
public void setProxyConnectors(List proxyConnectors) throws Exception {
for (Iterator iter = proxyConnectors.iterator(); iter.hasNext();) {
ProxyConnector connector = (ProxyConnector) iter.next();
addProxyConnector(connector);
public void setProxyConnectors(List<?> proxyConnectors) throws Exception {
for (Object connector : proxyConnectors) {
addProxyConnector((ProxyConnector) connector);
}
}
@ -1480,7 +1476,6 @@ public class BrokerService implements Service {
}
public String getDefaultSocketURIString() {
if (started.get()) {
if (this.defaultSocketURIString == null) {
for (TransportConnector tc:this.transportConnectors) {
@ -1815,7 +1810,6 @@ public class BrokerService implements Service {
* @throws Exception
*/
protected void processHelperProperties() throws Exception {
boolean masterServiceExists = false;
if (transportConnectorURIs != null) {
for (int i = 0; i < transportConnectorURIs.length; i++) {
String uri = transportConnectorURIs[i];
@ -1994,8 +1988,7 @@ public class BrokerService implements Service {
}
protected void unregisterPersistenceAdapterMBean(PersistenceAdapter adaptor) throws IOException {
if (isUseJmx()) {
}
if (isUseJmx()) {}
}
private ObjectName createConnectorObjectName(TransportConnector connector) throws MalformedObjectNameException {
@ -2015,16 +2008,13 @@ public class BrokerService implements Service {
}
}
protected ObjectName createNetworkConnectorObjectName(NetworkConnector connector)
throws MalformedObjectNameException {
protected ObjectName createNetworkConnectorObjectName(NetworkConnector connector) throws MalformedObjectNameException {
String objectNameStr = getBrokerObjectName().toString();
objectNameStr += ",connector=networkConnectors,networkConnectorName="+ JMXSupport.encodeObjectNamePart(connector.getName());
return new ObjectName(objectNameStr);
}
public ObjectName createDuplexNetworkConnectorObjectName(String transport)
throws MalformedObjectNameException {
public ObjectName createDuplexNetworkConnectorObjectName(String transport) throws MalformedObjectNameException {
String objectNameStr = getBrokerObjectName().toString();
objectNameStr += ",connector=duplexNetworkConnectors,networkConnectorName="+ JMXSupport.encodeObjectNamePart(transport);
return new ObjectName(objectNameStr);
@ -2053,8 +2043,6 @@ public class BrokerService implements Service {
}
}
protected void registerJmsConnectorMBean(JmsConnector connector) throws IOException {
JmsConnectorView view = new JmsConnectorView(connector);
try {
@ -2179,7 +2167,6 @@ public class BrokerService implements Service {
if (isUseJmx()) {
JobSchedulerViewMBean view = new JobSchedulerView(sb.getJobScheduler());
try {
String objectNameStr = getBrokerObjectName().toString();
objectNameStr += ",service=JobScheduler,name=JMS";
ObjectName objectName = new ObjectName(objectNameStr);
@ -2189,7 +2176,6 @@ public class BrokerService implements Service {
throw IOExceptionSupport.create("JobScheduler could not be registered in JMX: "
+ e.getMessage(), e);
}
}
broker = sb;
}
@ -2262,7 +2248,7 @@ public class BrokerService implements Service {
/**
* Extracts the port from the options
*/
protected Object getPort(Map options) {
protected Object getPort(Map<?,?> options) {
Object port = options.get("port");
if (port == null) {
port = DEFAULT_PORT;
@ -2819,19 +2805,19 @@ public class BrokerService implements Service {
this.allowTempAutoCreationOnSend = allowTempAutoCreationOnSend;
}
public int getOfflineDurableSubscriberTimeout() {
public long getOfflineDurableSubscriberTimeout() {
return offlineDurableSubscriberTimeout;
}
public void setOfflineDurableSubscriberTimeout(int offlineDurableSubscriberTimeout) {
public void setOfflineDurableSubscriberTimeout(long offlineDurableSubscriberTimeout) {
this.offlineDurableSubscriberTimeout = offlineDurableSubscriberTimeout;
}
public int getOfflineDurableSubscriberTaskSchedule() {
public long getOfflineDurableSubscriberTaskSchedule() {
return offlineDurableSubscriberTaskSchedule;
}
public void setOfflineDurableSubscriberTaskSchedule(int offlineDurableSubscriberTaskSchedule) {
public void setOfflineDurableSubscriberTaskSchedule(long offlineDurableSubscriberTaskSchedule) {
this.offlineDurableSubscriberTaskSchedule = offlineDurableSubscriberTaskSchedule;
}