You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2012/09/20 12:48:57 UTC
svn commit: r1387960 - in /activemq/trunk:
activemq-console/src/main/java/org/apache/activemq/console/filter/
activemq-core/src/main/java/org/apache/activemq/broker/
activemq-core/src/main/java/org/apache/activemq/command/
activemq-core/src/main/java/o...
Author: tabish
Date: Thu Sep 20 10:48:56 2012
New Revision: 1387960
URL: http://svn.apache.org/viewvc?rev=1387960&view=rev
Log:
fix for: https://issues.apache.org/jira/browse/AMQ-4066
Remove old deprecated code.
Removed:
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/thread/Valve.java
activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpTransport.java
activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/https/HttpsTransport.java
activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/util/xstream/XStreamMessageTransformer.java
Modified:
activemq/trunk/activemq-console/src/main/java/org/apache/activemq/console/filter/AmqMessagesQueryFilter.java
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnector.java
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ConsumerInfo.java
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/TransportFactory.java
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/SslTransportFactory.java
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/xbean/XBeanBrokerService.java
Modified: activemq/trunk/activemq-console/src/main/java/org/apache/activemq/console/filter/AmqMessagesQueryFilter.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-console/src/main/java/org/apache/activemq/console/filter/AmqMessagesQueryFilter.java?rev=1387960&r1=1387959&r2=1387960&view=diff
==============================================================================
--- activemq/trunk/activemq-console/src/main/java/org/apache/activemq/console/filter/AmqMessagesQueryFilter.java (original)
+++ activemq/trunk/activemq-console/src/main/java/org/apache/activemq/console/filter/AmqMessagesQueryFilter.java Thu Sep 20 10:48:56 2012
@@ -18,7 +18,6 @@ package org.apache.activemq.console.filt
import java.net.URI;
import java.util.Collections;
-import java.util.Iterator;
import java.util.List;
import javax.jms.Connection;
@@ -74,8 +73,8 @@ public class AmqMessagesQueryFilter exte
String selector = "";
// Convert to message selector
- for (Iterator i = queries.iterator(); i.hasNext(); ) {
- selector = selector + "(" + i.next().toString() + ") AND ";
+ for (Object query : queries) {
+ selector = selector + "(" + query.toString() + ") AND ";
}
// Remove last AND
@@ -130,35 +129,19 @@ public class AmqMessagesQueryFilter exte
/**
* Create and start a JMS connection
*
- * @param brokerUrl - broker url to connect to.
- * @return JMS connection
- * @throws JMSException
- * @deprecated Use createConnection() instead, and pass the url to the ConnectionFactory when it's created.
- */
- @Deprecated
- protected Connection createConnection(URI brokerUrl) throws JMSException {
- // maintain old behaviour, when called this way.
- connectionFactory = (new ActiveMQConnectionFactory(brokerUrl));
- return createConnection();
- }
-
- /**
- * Create and start a JMS connection
- *
* @return JMS connection
* @throws JMSException
*/
protected Connection createConnection() throws JMSException {
// maintain old behaviour, when called either way.
- if (null == connectionFactory)
+ if (null == connectionFactory) {
connectionFactory = (new ActiveMQConnectionFactory(getBrokerUrl()));
-
+ }
Connection conn = connectionFactory.createConnection();
conn.start();
return conn;
}
-
/**
* Get the broker url being used.
*
@@ -194,5 +177,4 @@ public class AmqMessagesQueryFilter exte
public void setDestination(Destination destination) {
this.destination = destination;
}
-
}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnector.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnector.java?rev=1387960&r1=1387959&r2=1387960&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnector.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnector.java Thu Sep 20 10:48:56 2012
@@ -19,13 +19,13 @@ package org.apache.activemq.broker;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
-import java.util.Iterator;
import java.util.LinkedList;
import java.util.StringTokenizer;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.regex.Pattern;
import javax.management.ObjectName;
+
import org.apache.activemq.broker.jmx.ManagedTransportConnector;
import org.apache.activemq.broker.jmx.ManagementContext;
import org.apache.activemq.broker.region.ConnectorStatistics;
@@ -46,13 +46,12 @@ import org.slf4j.LoggerFactory;
/**
* @org.apache.xbean.XBean
- *
*/
public class TransportConnector implements Connector, BrokerServiceAware {
final Logger LOG = LoggerFactory.getLogger(TransportConnector.class);
- protected CopyOnWriteArrayList<TransportConnection> connections = new CopyOnWriteArrayList<TransportConnection>();
+ protected final CopyOnWriteArrayList<TransportConnection> connections = new CopyOnWriteArrayList<TransportConnection>();
protected TransportStatusDetector statusDector;
private BrokerService brokerService;
private TransportServer server;
@@ -90,7 +89,6 @@ public class TransportConnector implemen
setEnableStatusMonitor(false);
}
}
-
}
/**
@@ -104,8 +102,7 @@ public class TransportConnector implemen
* Factory method to create a JMX managed version of this transport
* connector
*/
- public ManagedTransportConnector asManagedConnector(ManagementContext context, ObjectName connectorName)
- throws IOException, URISyntaxException {
+ public ManagedTransportConnector asManagedConnector(ManagementContext context, ObjectName connectorName) throws IOException, URISyntaxException {
ManagedTransportConnector rc = new ManagedTransportConnector(context, connectorName, getServer());
rc.setBrokerInfo(getBrokerInfo());
rc.setConnectUri(getConnectUri());
@@ -136,19 +133,6 @@ public class TransportConnector implemen
this.brokerInfo = brokerInfo;
}
- /**
- *
- * @deprecated use the {@link #setBrokerService(BrokerService)} method
- * instead.
- */
- @Deprecated
- public void setBrokerName(String name) {
- if (this.brokerInfo == null) {
- this.brokerInfo = new BrokerInfo();
- }
- this.brokerInfo.setBrokerName(name);
- }
-
public TransportServer getServer() throws IOException, URISyntaxException {
if (server == null) {
setServer(createTransportServer());
@@ -272,8 +256,7 @@ public class TransportConnector implemen
String publishableConnectString = null;
if (theConnectURI != null) {
publishableConnectString = theConnectURI.toString();
- // strip off server side query parameters which may not be compatible to
- // clients
+ // strip off server side query parameters which may not be compatible to clients
if (theConnectURI.getRawQuery() != null) {
publishableConnectString = publishableConnectString.substring(0, publishableConnectString
.indexOf(theConnectURI.getRawQuery()) - 1);
@@ -297,9 +280,8 @@ public class TransportConnector implemen
this.statusDector.stop();
}
- for (Iterator<TransportConnection> iter = connections.iterator(); iter.hasNext();) {
- TransportConnection c = iter.next();
- ss.stop(c);
+ for (TransportConnection connection : connections) {
+ ss.stop(connection);
}
server = null;
ss.throwFirstException();
@@ -341,8 +323,8 @@ public class TransportConnector implemen
if (discoveryUri != null) {
DiscoveryAgent agent = DiscoveryAgentFactory.createDiscoveryAgent(discoveryUri);
- if( agent!=null && agent instanceof BrokerServiceAware ) {
- ((BrokerServiceAware)agent).setBrokerService(brokerService);
+ if (agent != null && agent instanceof BrokerServiceAware) {
+ ((BrokerServiceAware) agent).setBrokerService(brokerService);
}
return agent;
@@ -428,9 +410,8 @@ public class TransportConnector implemen
control.setConnectedBrokers(connectedBrokers);
control.setRebalanceConnection(rebalance);
return control;
-
}
-
+
public void addPeerBroker(BrokerInfo info) {
if (isMatchesClusterFilter(info.getBrokerName())) {
synchronized (peerBrokers) {
@@ -438,7 +419,7 @@ public class TransportConnector implemen
}
}
}
-
+
public void removePeerBroker(BrokerInfo info) {
synchronized (peerBrokers) {
getPeerBrokers().remove(info.getBrokerURL());
@@ -455,7 +436,6 @@ public class TransportConnector implemen
}
public void updateClientClusterInfo() {
-
if (isRebalanceClusterClients() || isUpdateClusterClients()) {
ConnectionControl control = getConnectionControl();
for (Connection c : this.connections) {
@@ -480,6 +460,7 @@ public class TransportConnector implemen
}
}
}
+
return result;
}
@@ -620,5 +601,4 @@ public class TransportConnector implemen
public void setMaximumConsumersAllowedPerConnection(int maximumConsumersAllowedPerConnection) {
this.maximumConsumersAllowedPerConnection = maximumConsumersAllowedPerConnection;
}
-
}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ConsumerInfo.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ConsumerInfo.java?rev=1387960&r1=1387959&r2=1387960&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ConsumerInfo.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ConsumerInfo.java Thu Sep 20 10:48:56 2012
@@ -24,7 +24,7 @@ import org.apache.activemq.state.Command
/**
* @openwire:marshaller code="5"
- *
+ *
*/
public class ConsumerInfo extends BaseCommand {
@@ -117,7 +117,7 @@ public class ConsumerInfo extends BaseCo
/**
* Is used to uniquely identify the consumer to the broker.
- *
+ *
* @openwire:property version=1 cache=true
*/
public ConsumerId getConsumerId() {
@@ -130,7 +130,7 @@ public class ConsumerInfo extends BaseCo
/**
* Is this consumer a queue browser?
- *
+ *
* @openwire:property version=1
*/
public boolean isBrowser() {
@@ -144,7 +144,7 @@ public class ConsumerInfo extends BaseCo
/**
* The destination that the consumer is interested in receiving messages
* from. This destination could be a composite destination.
- *
+ *
* @openwire:property version=1 cache=true
*/
public ActiveMQDestination getDestination() {
@@ -158,7 +158,7 @@ public class ConsumerInfo extends BaseCo
/**
* How many messages a broker will send to the client without receiving an
* ack before he stops dispatching messages to the client.
- *
+ *
* @openwire:property version=1
*/
public int getPrefetchSize() {
@@ -173,7 +173,7 @@ public class ConsumerInfo extends BaseCo
/**
* How many messages a broker will keep around, above the prefetch limit,
* for non-durable topics before starting to discard older messages.
- *
+ *
* @openwire:property version=1
*/
public int getMaximumPendingMessageLimit() {
@@ -190,7 +190,7 @@ public class ConsumerInfo extends BaseCo
* done async, then he broker use a STP style of processing. STP is more
* appropriate in high bandwidth situations or when being used by and in vm
* transport.
- *
+ *
* @openwire:property version=1
*/
public boolean isDispatchAsync() {
@@ -204,7 +204,7 @@ public class ConsumerInfo extends BaseCo
/**
* The JMS selector used to filter out messages that this consumer is
* interested in.
- *
+ *
* @openwire:property version=1
*/
public String getSelector() {
@@ -217,7 +217,7 @@ public class ConsumerInfo extends BaseCo
/**
* Used to identify the name of a durable subscription.
- *
+ *
* @openwire:property version=1
*/
public String getSubscriptionName() {
@@ -229,27 +229,9 @@ public class ConsumerInfo extends BaseCo
}
/**
- * @deprecated
- * @return
- * @see getSubscriptionName
- */
- public String getSubcriptionName() {
- return subscriptionName;
- }
-
- /**
- * @deprecated
- * @see setSubscriptionName
- * @param durableSubscriptionId
- */
- public void setSubcriptionName(String durableSubscriptionId) {
- this.subscriptionName = durableSubscriptionId;
- }
-
- /**
* Set noLocal to true to avoid receiving messages that were published
* locally on the same connection.
- *
+ *
* @openwire:property version=1
*/
public boolean isNoLocal() {
@@ -265,7 +247,7 @@ public class ConsumerInfo extends BaseCo
* receive messages from the destination. If there are multiple exclusive
* consumers for a destination, the first one created will be the exclusive
* consumer of the destination.
- *
+ *
* @openwire:property version=1
*/
public boolean isExclusive() {
@@ -283,7 +265,7 @@ public class ConsumerInfo extends BaseCo
* published to the topic. If the consumer is durable then it will receive
* all persistent messages that are still stored in persistent storage for
* that topic.
- *
+ *
* @openwire:property version=1
*/
public boolean isRetroactive() {
@@ -305,7 +287,7 @@ public class ConsumerInfo extends BaseCo
* are other higher priority consumers available to dispatch to. This allows
* letting the broker to have an affinity to higher priority consumers.
* Default priority is 0.
- *
+ *
* @openwire:property version=1
*/
public byte getPriority() {
@@ -318,7 +300,7 @@ public class ConsumerInfo extends BaseCo
/**
* The route of brokers the command has moved through.
- *
+ *
* @openwire:property version=1 cache=true
*/
public BrokerId[] getBrokerPath() {
@@ -334,7 +316,7 @@ public class ConsumerInfo extends BaseCo
* predicates into the selector on the fly. Handy if if say a Security
* Broker interceptor wants to filter out messages based on security level
* of the consumer.
- *
+ *
* @openwire:property version=1
*/
public BooleanExpression getAdditionalPredicate() {
@@ -396,7 +378,7 @@ public class ConsumerInfo extends BaseCo
/**
* The broker may be able to optimize it's processing or provides better QOS
* if it knows the consumer will not be sending ranged acks.
- *
+ *
* @return true if the consumer will not send range acks.
* @openwire:property version=1
*/
@@ -423,11 +405,11 @@ public class ConsumerInfo extends BaseCo
}
}
}
-
+
public synchronized boolean isNetworkConsumersEmpty() {
return networkConsumerIds == null || networkConsumerIds.isEmpty();
}
-
+
public synchronized List<ConsumerId> getNetworkConsumerIds(){
List<ConsumerId> result = new ArrayList<ConsumerId>();
if (networkConsumerIds != null) {
@@ -437,10 +419,10 @@ public class ConsumerInfo extends BaseCo
}
/**
- * Tracks the original subscription id that causes a subscription to
+ * Tracks the original subscription id that causes a subscription to
* percolate through a network when networkTTL > 1. Tracking the original
* subscription allows duplicate suppression.
- *
+ *
* @return array of the current subscription path
* @openwire:property version=4
*/
@@ -451,7 +433,7 @@ public class ConsumerInfo extends BaseCo
}
return result;
}
-
+
public void setNetworkConsumerPath(ConsumerId[] consumerPath) {
if (consumerPath != null) {
for (int i=0; i<consumerPath.length; i++) {
@@ -463,7 +445,7 @@ public class ConsumerInfo extends BaseCo
public void setLastDeliveredSequenceId(long lastDeliveredSequenceId) {
this.lastDeliveredSequenceId = lastDeliveredSequenceId;
}
-
+
public long getLastDeliveredSequenceId() {
return lastDeliveredSequenceId;
}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/TransportFactory.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/TransportFactory.java?rev=1387960&r1=1387959&r2=1387960&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/TransportFactory.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/TransportFactory.java Thu Sep 20 10:48:56 2012
@@ -112,13 +112,6 @@ public abstract class TransportFactory {
return tf.doBind(location);
}
- /**
- * @deprecated
- */
- public static TransportServer bind(String brokerId, URI location) throws IOException {
- return bind(location);
- }
-
public static TransportServer bind(BrokerService brokerService, URI location) throws IOException {
TransportFactory tf = findTransportFactory(location);
if( brokerService!=null && tf instanceof BrokerServiceAware ) {
@@ -159,7 +152,6 @@ public abstract class TransportFactory {
throw new IllegalArgumentException("Invalid connect parameters: " + options);
}
return rc;
-
} catch (URISyntaxException e) {
throw IOExceptionSupport.create(e);
}
@@ -265,7 +257,7 @@ public abstract class TransportFactory {
* @throws Exception
*/
@SuppressWarnings("rawtypes")
- public Transport serverConfigure(Transport transport, WireFormat format, HashMap options) throws Exception {
+ public Transport serverConfigure(Transport transport, WireFormat format, HashMap options) throws Exception {
if (options.containsKey(THREAD_NAME_FILTER)) {
transport = new ThreadNameFilter(transport);
}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/SslTransportFactory.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/SslTransportFactory.java?rev=1387960&r1=1387959&r2=1387960&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/SslTransportFactory.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/SslTransportFactory.java Thu Sep 20 10:48:56 2012
@@ -20,16 +20,13 @@ import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.UnknownHostException;
-import java.security.SecureRandom;
import java.util.HashMap;
import java.util.Map;
import javax.net.ServerSocketFactory;
import javax.net.SocketFactory;
-import javax.net.ssl.KeyManager;
import javax.net.ssl.SSLServerSocketFactory;
import javax.net.ssl.SSLSocketFactory;
-import javax.net.ssl.TrustManager;
import org.apache.activemq.broker.SslContext;
import org.apache.activemq.transport.Transport;
@@ -46,13 +43,8 @@ import org.slf4j.LoggerFactory;
* contribution from this class is that it is aware of SslTransportServer and
* SslTransport classes. All Transports and TransportServers created from this
* factory will have their needClientAuth option set to false.
- *
- * @author sepandm@gmail.com (Sepand)
- * @author David Martin Clavo david(dot)martin(dot)clavo(at)gmail.com (logging improvement modifications)
- *
*/
public class SslTransportFactory extends TcpTransportFactory {
- // The log this uses.,
private static final Logger LOG = LoggerFactory.getLogger(SslTransportFactory.class);
/**
@@ -82,7 +74,6 @@ public class SslTransportFactory extends
*/
@SuppressWarnings("rawtypes")
public Transport compositeConfigure(Transport transport, WireFormat format, Map options) {
-
SslTransport sslTransport = (SslTransport)transport.narrow(SslTransport.class);
IntrospectionSupport.setProperties(sslTransport, options);
@@ -138,7 +129,6 @@ public class SslTransportFactory extends
* @throws IOException
*/
protected SocketFactory createSocketFactory() throws IOException {
-
if( SslContext.getCurrentSslContext()!=null ) {
SslContext ctx = SslContext.getCurrentSslContext();
try {
@@ -150,19 +140,4 @@ public class SslTransportFactory extends
return SSLSocketFactory.getDefault();
}
}
-
- /**
- *
- * @param km
- * @param tm
- * @param random
- * @deprecated "Do not use anymore... using static initializers like this method only allows the JVM to use 1 SSL configuration per broker."
- * @see org.apache.activemq.broker.SslContext#setCurrentSslContext(SslContext)
- * @see org.apache.activemq.broker.SslContext#getSSLContext()
- */
- public void setKeyAndTrustManagers(KeyManager[] km, TrustManager[] tm, SecureRandom random) {
- SslContext ctx = new SslContext(km, tm, random);
- SslContext.setCurrentSslContext(ctx);
- }
-
}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/xbean/XBeanBrokerService.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/xbean/XBeanBrokerService.java?rev=1387960&r1=1387959&r2=1387960&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/xbean/XBeanBrokerService.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/xbean/XBeanBrokerService.java Thu Sep 20 10:48:56 2012
@@ -23,29 +23,26 @@ import javax.annotation.PreDestroy;
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.usage.SystemUsage;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.springframework.beans.CachedIntrospectionResults;
/**
* An ActiveMQ Message Broker. It consists of a number of transport
* connectors, network connectors and a bunch of properties which can be used to
* configure the broker as its lazily created.
- *
+ *
* @org.apache.xbean.XBean element="broker" rootElement="true"
- * @org.apache.xbean.Defaults {code:xml}
+ * @org.apache.xbean.Defaults {code:xml}
* <broker test="foo.bar">
* lets.
* see what it includes.
- * </broker>
+ * </broker>
* {code}
- *
+ *
*/
public class XBeanBrokerService extends BrokerService {
- private static final transient Logger LOG = LoggerFactory.getLogger(XBeanBrokerService.class);
-
+
private boolean start = true;
-
+
public XBeanBrokerService() {
}
@@ -102,23 +99,4 @@ public class XBeanBrokerService extends
public void setStart(boolean start) {
this.start = start;
}
-
- /**
- * Sets whether the broker should shutdown the ApplicationContext when the broker jvm is shutdown.
- * The broker can be stopped because the underlying JDBC store is unavailable for example.
- */
- @Deprecated
- public void setDestroyApplicationContextOnShutdown(boolean destroy) {
- LOG.warn("destroyApplicationContextOnShutdown parameter is deprecated, please use shutdown hooks instead");
- }
-
- /**
- * Sets whether the broker should shutdown the ApplicationContext when the broker is stopped.
- * The broker can be stopped because the underlying JDBC store is unavailable for example.
- */
- @Deprecated
- public void setDestroyApplicationContextOnStop(boolean destroy) {
- LOG.warn("destroyApplicationContextOnStop parameter is deprecated, please use shutdown hooks instead");
- }
-
}