Fix a bunch of javadoc warnings produced during release profile builds.

This commit is contained in:
Timothy Bish 2015-08-04 11:54:46 -04:00
parent 7f4bf84342
commit 5e05df1cb7
41 changed files with 294 additions and 251 deletions

View File

@ -42,8 +42,6 @@ import org.apache.activemq.usage.Usage;
/**
* The Message Broker which routes messages, maintains subscriptions and
* connections, acknowledges messages and handles transactions.
*
*
*/
public interface Broker extends Region, Service {
@ -51,7 +49,7 @@ public interface Broker extends Region, Service {
* Get a Broker from the Broker Stack that is a particular class
*
* @param type
* @return
* @return a Broker instance.
*/
Broker getAdaptor(Class type);
@ -117,7 +115,7 @@ public interface Broker extends Region, Service {
/**
* Adds a producer.
*
* @param context the enviorment the operation is being executed under.
* @param context the environment the operation is being executed under.
* @throws Exception TODO
*/
@Override
@ -126,7 +124,7 @@ public interface Broker extends Region, Service {
/**
* Removes a producer.
*
* @param context the enviorment the operation is being executed under.
* @param context the environment the operation is being executed under.
* @throws Exception TODO
*/
@Override
@ -146,8 +144,10 @@ public interface Broker extends Region, Service {
/**
* return a reference destination map of a region based on the destination type
*
* @param destination
* @return
*
* @return destination Map
*/
public Map<ActiveMQDestination, Destination> getDestinationMap(ActiveMQDestination destination);
@ -155,7 +155,7 @@ public interface Broker extends Region, Service {
* Gets a list of all the prepared xa transactions.
*
* @param context transaction ids
* @return
* @return array of TransactionId values
* @throws Exception TODO
*/
TransactionId[] getPreparedTransactions(ConnectionContext context) throws Exception;
@ -186,7 +186,6 @@ public interface Broker extends Region, Service {
* @param xid
* @throws Exception TODO
*/
void rollbackTransaction(ConnectionContext context, TransactionId xid) throws Exception;
/**
@ -253,6 +252,7 @@ public interface Broker extends Region, Service {
*
* @param context
* @param info
*
* @throws Exception
*/
void removeDestinationInfo(ConnectionContext context, DestinationInfo info) throws Exception;
@ -318,7 +318,7 @@ public interface Broker extends Region, Service {
*
* @param context
* @param messageReference
* @param subscription, may be null
* @param subscription (may be null)
*/
void messageExpired(ConnectionContext context, MessageReference messageReference, Subscription subscription);

View File

@ -2242,8 +2242,6 @@ public class BrokerService implements Service {
* Factory method to create a new broker
*
* @throws Exception
* @throws
* @throws
*/
protected Broker createBroker() throws Exception {
regionBroker = createRegionBroker();
@ -3037,7 +3035,6 @@ public class BrokerService implements Service {
/**
* Sets if the broker allowed to restart on shutdown.
* @return
*/
public void setRestartAllowed(boolean restartAllowed) {
this.restartAllowed = restartAllowed;

View File

@ -16,16 +16,16 @@
*/
package org.apache.activemq.broker;
import java.io.IOException;
import org.apache.activemq.Service;
import org.apache.activemq.broker.region.ConnectionStatistics;
import org.apache.activemq.command.Command;
import org.apache.activemq.command.ConnectionControl;
import org.apache.activemq.command.Response;
import java.io.IOException;
/**
*
*
*/
public interface Connection extends Service {
@ -36,21 +36,21 @@ public interface Connection extends Service {
/**
* Sends a message to the client.
*
*
* @param message the message to send to the client.
*/
void dispatchSync(Command message);
/**
* Sends a message to the client.
*
*
* @param command
*/
void dispatchAsync(Command command);
/**
* Services a client command and submits it to the broker.
*
*
* @param command
* @return Response
*/
@ -58,7 +58,7 @@ public interface Connection extends Service {
/**
* Handles an unexpected error associated with a connection.
*
*
* @param error
*/
void serviceException(Throwable error);
@ -106,18 +106,19 @@ public interface Connection extends Service {
void serviceExceptionAsync(IOException e);
String getConnectionId();
/**
* return true if a network connection
* @return
*
* @return if this is a network connection
*/
boolean isNetworkConnection();
/**
* @return true if a fault tolerant connection
*/
boolean isFaultTolerantConnection();
void updateClient(ConnectionControl control);

View File

@ -186,7 +186,7 @@ public class ConnectionContext {
}
/**
* @return
* @return true if in recovery mode.
*/
public boolean isInRecoveryMode() {
return inRecoveryMode;

View File

@ -16,11 +16,11 @@
*/
package org.apache.activemq.broker;
import java.io.IOException;
import org.apache.activemq.Service;
import org.apache.activemq.store.PersistenceAdapter;
import java.io.IOException;
/**
* Represents a lock service to ensure that a broker is the only master
*/

View File

@ -22,7 +22,6 @@ import java.net.UnknownHostException;
import java.util.HashMap;
import java.util.Locale;
import org.apache.activemq.transport.vm.VMTransport;
import org.apache.activemq.util.InetAddressUtil;
/**
@ -96,7 +95,9 @@ public class PublishedAddressPolicy {
* logic for this method.
*
* @param uriHostEntry
* @return
*
* @return the value published for the given host.
*
* @throws UnknownHostException
*/
protected String getPublishedHostValue(String uriHostEntry) throws UnknownHostException {

View File

@ -138,7 +138,8 @@ public class AnnotatedMBean extends StandardMBean {
* Extracts the Method from the MBeanOperationInfo
*
* @param op
* @return
*
* @return a Method
*/
private Method getMethod(MBeanOperationInfo op) {
final MBeanParameterInfo[] params = op.getSignature();
@ -156,7 +157,8 @@ public class AnnotatedMBean extends StandardMBean {
* @param mbean
* @param method
* @param params
* @return
*
* @return a Method
*/
private static Method getMethod(Class<?> mbean, String method, String... params) {
try {
@ -216,13 +218,11 @@ public class AnnotatedMBean extends StandardMBean {
return super.invoke(s, objects, strings);
}
private Method getMBeanMethod(Class clazz, String methodName, String[] signature) throws ReflectiveOperationException
{
Class[] parameterTypes = new Class[signature.length];
for (int i = 0; i < signature.length; i++)
{
parameterTypes[i] = Class.forName(signature[i]);
}
return clazz.getMethod(methodName, parameterTypes);
private Method getMBeanMethod(Class clazz, String methodName, String[] signature) throws ReflectiveOperationException {
Class[] parameterTypes = new Class[signature.length];
for (int i = 0; i < signature.length; i++) {
parameterTypes[i] = Class.forName(signature[i]);
}
return clazz.getMethod(methodName, parameterTypes);
}
}

View File

@ -17,14 +17,15 @@
*/
package org.apache.activemq.broker.jmx;
import javax.management.openmbean.CompositeData;
import javax.management.openmbean.TabularData;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import javax.management.openmbean.CompositeData;
import javax.management.openmbean.TabularData;
/**
*
*
*/
public class CompositeDataHelper {
@ -56,7 +57,8 @@ public class CompositeDataHelper {
* object
*
* @param cdata
* @return
*
* @return a Map of user properties
*/
public static Map getMessageUserProperties(CompositeData cdata) {
Map map = new HashMap();

View File

@ -19,12 +19,9 @@ package org.apache.activemq.broker.jmx;
import javax.management.ObjectName;
import org.apache.activemq.Service;
import org.apache.activemq.broker.TransportConnectionState;
import org.apache.activemq.state.TransactionState;
import java.util.Collection;
public interface ConnectionViewMBean extends Service {
/**
* @return true if the Connection is slow
*/
@ -118,4 +115,5 @@ public interface ConnectionViewMBean extends Service {
*/
@MBeanInfo("The age in ms of the oldest active transaction established on this Connection.")
public Long getOldestActiveTransactionDuration();
}

View File

@ -52,7 +52,7 @@ public interface ConnectorViewMBean extends Service {
/**
* Returns true if link stealing is enabled on this Connector
*
* @returns true if link stealing is enabled.
* @return true if link stealing is enabled.
*/
@MBeanInfo("Link Stealing enabled")
boolean isAllowLinkStealingEnabled();

View File

@ -36,7 +36,7 @@ public interface DestinationViewMBean {
String getName();
/**
* Resets the managment counters.
* Resets the management counters.
*/
@MBeanInfo("Resets statistics.")
void resetStatistics();
@ -122,9 +122,9 @@ public interface DestinationViewMBean {
long getQueueSize();
/**
* Returns the memory size of all messages in this destination's store
* Returns the memory size of all messages in this destination's store
*
* @return Returns the memory size of all messages in this destination's store
* @return Returns the memory size of all messages in this destination's store
*/
@MBeanInfo("The memory size of all messages in this destination's store.")
long getStoreMessageSize();
@ -193,7 +193,7 @@ public interface DestinationViewMBean {
* @param body the text to send
* @param user
* @param password
* @return
* @return a string value
* @throws Exception
*/
@MBeanInfo("Sends a TextMessage to a password-protected destination.")
@ -206,11 +206,14 @@ public interface DestinationViewMBean {
* @param body the text to send
* @param user
* @param password
* @return
*
* @return a string value
*
* @throws Exception
*/
@MBeanInfo("Sends a TextMessage to a password-protected destination.")
String sendTextMessage(@MBeanInfo("headers") Map<String,String> headers, @MBeanInfo("body") String body, @MBeanInfo("user") String user, @MBeanInfo("password") String password) throws Exception;
/**
* @return the percentage of amount of memory used
*/

View File

@ -16,9 +16,10 @@
*/
package org.apache.activemq.broker.jmx;
import javax.management.openmbean.TabularData;
import java.util.List;
import javax.management.openmbean.TabularData;
/**
* Returns the status events of the broker to indicate any warnings.
*/
@ -31,13 +32,13 @@ public interface HealthViewMBean {
* of {@link HealthStatus} on your classpath or you use something
* like <a href="http://jolokia.org/">jolokia</a> to access JMX.
*
* If in doubt, please use the {@link #status()} method instead!
* If in doubt, please use the {@link #getCurrentStatus()} method instead!
*/
@MBeanInfo("List of warnings and errors about the current health of the Broker - empty list is Good!")
List<HealthStatus> healthList() throws Exception;
/**
* @return String representation of the current Broker state
* @return String representation of the current Broker state
*/
@MBeanInfo("String representation of current Broker state")
String getCurrentStatus();

View File

@ -38,9 +38,10 @@ public class InactiveDurableSubscriptionView extends DurableSubscriptionView imp
* Constructor
*
* @param broker
* @param brokerService
* @param clientId
* @param userName
* @param subInfo
* @param subscription
*/
public InactiveDurableSubscriptionView(ManagedRegionBroker broker, BrokerService brokerService, String clientId, SubscriptionInfo subInfo, Subscription subscription) {
super(broker, brokerService, clientId, null, subscription);

View File

@ -48,7 +48,7 @@ public interface Log4JConfigViewMBean {
/**
* list of all the logger names and their levels
*
* @returns a List of all known loggers names.
* @return a List of all known loggers names.
*
* @throws Exception if an error occurs while getting the loggers.
*/
@ -61,7 +61,7 @@ public interface Log4JConfigViewMBean {
* @param loggerName
* the name of the logger whose level should be queried.
*
* @returns the current log level of the given logger.
* @return the current log level of the given logger.
*
* @throws Exception if an error occurs while getting the log level.
*/

View File

@ -521,7 +521,7 @@ public class ManagementContext implements Service {
}
/**
* @return
* @return an MBeanServer instance
* @throws NullPointerException
* @throws MalformedObjectNameException
* @throws IOException

View File

@ -67,13 +67,13 @@ public interface ProducerViewMBean {
boolean isDestinationTemporary();
/**
* @returns the windows size configured for the producer
* @return the windows size configured for the producer
*/
@MBeanInfo("Configured Window Size for the Producer")
int getProducerWindowSize();
/**
* @returns if the Producer is configured for Async dispatch
* @return if the Producer is configured for Async dispatch
*/
@MBeanInfo("Is the producer configured for Async Dispatch")
boolean isDispatchAsync();

View File

@ -113,9 +113,8 @@ public interface SubscriptionViewMBean {
int getDispatchedQueueSize();
/**
* The same as the number of messages dispatched -
* making it explicit
* @return
* The same as the number of messages dispatched - making it explicit
* @return number of messages waiting for an acknowledge.
*/
@MBeanInfo("Number of messages dispatched awaiting acknowledgement.")
int getMessageCountAwaitingAcknowledge();

View File

@ -548,7 +548,7 @@ public abstract class PrefetchSubscription extends AbstractSubscription {
/**
* Used to determine if the broker can dispatch to the consumer.
*
* @return
* @return true if the subscription is full
*/
@Override
public boolean isFull() {

View File

@ -23,9 +23,9 @@ import org.slf4j.LoggerFactory;
/**
* Queue dispatch policy that determines if a message can be sent to a subscription
*
*
* @org.apache.xbean.XBean
*
*
*/
public class QueueDispatchSelector extends SimpleDispatchSelector {
private static final Logger LOG = LoggerFactory.getLogger(QueueDispatchSelector.class);
@ -38,22 +38,21 @@ public class QueueDispatchSelector extends SimpleDispatchSelector {
public QueueDispatchSelector(ActiveMQDestination destination) {
super(destination);
}
public Subscription getExclusiveConsumer() {
return exclusiveConsumer;
}
public void setExclusiveConsumer(Subscription exclusiveConsumer) {
this.exclusiveConsumer = exclusiveConsumer;
}
public boolean isExclusiveConsumer(Subscription s) {
return s == this.exclusiveConsumer;
}
public boolean canSelect(Subscription subscription,
MessageReference m) throws Exception {
boolean result = !paused && super.canDispatch(subscription, m);
if (result && !subscription.isBrowser()) {
result = exclusiveConsumer == null || exclusiveConsumer == subscription;

View File

@ -21,6 +21,7 @@ import java.util.List;
import javax.jms.InvalidSelectorException;
import javax.management.ObjectName;
import org.apache.activemq.broker.ConnectionContext;
import org.apache.activemq.command.ActiveMQDestination;
import org.apache.activemq.command.ConsumerInfo;
@ -66,7 +67,7 @@ public interface Subscription extends SubscriptionRecovery {
* Is the subscription interested in the message?
* @param node
* @param context
* @return
* @return true if matching
* @throws IOException
*/
boolean matches(MessageReference node, MessageEvaluationContext context) throws IOException;
@ -74,7 +75,7 @@ public interface Subscription extends SubscriptionRecovery {
/**
* Is the subscription interested in messages in the destination?
* @param destination
* @return
* @return true if matching
*/
boolean matches(ActiveMQDestination destination);

View File

@ -16,15 +16,15 @@
*/
package org.apache.activemq.broker.region.cursors;
import org.apache.activemq.broker.region.MessageReference;
import org.apache.activemq.broker.region.QueueMessageReference;
import org.apache.activemq.command.MessageId;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import org.apache.activemq.broker.region.MessageReference;
import org.apache.activemq.broker.region.QueueMessageReference;
import org.apache.activemq.command.MessageId;
/**
* An abstraction that keeps the correct order of messages that need to be dispatched
* to consumers, but also hides the fact that there might be redelivered messages that
@ -60,7 +60,7 @@ public class QueueDispatchPendingList implements PendingList {
* @param message
* The MessageReference that is to be added to this list.
*
* @return
* @return the pending node.
*/
@Override
public PendingNode addMessageFirst(MessageReference message) {
@ -74,7 +74,7 @@ public class QueueDispatchPendingList implements PendingList {
* @param message
* The MessageReference that is to be added to this list.
*
* @return
* @return the pending node.
*/
@Override
public PendingNode addMessageLast(MessageReference message) {

View File

@ -18,15 +18,13 @@ package org.apache.activemq.memory;
/**
* Defines the interface used to cache messages.
*
*
*/
public interface Cache {
/**
* Gets an object that was previously <code>put</code> into this object.
*
* @param msgid
*
* @param key
* @return null if the object was not previously put or if the object has
* expired out of the cache.
*/
@ -34,16 +32,16 @@ public interface Cache {
/**
* Puts an object into the cache.
*
* @param messageID
* @param message
*
* @param key
* @param value
*/
Object put(Object key, Object value);
/**
* Removes an object from the cache.
*
* @param messageID
*
* @param key
* @return the object associated with the key if it was still in the cache.
*/
Object remove(Object key);
@ -56,8 +54,8 @@ public interface Cache {
/**
* How big is the cache right now?
*
* @return
*
* @return the size.
*/
int size();

View File

@ -31,8 +31,6 @@ public class CacheEntry {
}
/**
*
* @param entry
* @return false if you are trying to remove the tail pointer.
*/
public boolean remove() {
@ -53,5 +51,4 @@ public class CacheEntry {
return true;
}
}

View File

@ -98,7 +98,7 @@ public class LdapNetworkConnector extends NetworkConnector implements NamespaceC
/**
* sets the LDAP server URI
*
* @param _uri
* @param uri
* LDAP server URI
*/
public void setUri(URI uri) throws Exception {
@ -114,7 +114,7 @@ public class LdapNetworkConnector extends NetworkConnector implements NamespaceC
/**
* sets the base LDAP dn used for lookup operations
*
* @param _base
* @param base
* LDAP base dn
*/
public void setBase(String base) {
@ -124,7 +124,7 @@ public class LdapNetworkConnector extends NetworkConnector implements NamespaceC
/**
* sets the LDAP user for access credentials
*
* @param _user
* @param user
* LDAP dn of user
*/
public void setUser(String user) {
@ -134,9 +134,10 @@ public class LdapNetworkConnector extends NetworkConnector implements NamespaceC
/**
* sets the LDAP password for access credentials
*
* @param _password
* @param password
* user password
*/
@Override
public void setPassword(String password) {
this.password = password;
}
@ -144,7 +145,7 @@ public class LdapNetworkConnector extends NetworkConnector implements NamespaceC
/**
* sets LDAP anonymous authentication access credentials
*
* @param _anonymousAuthentication
* @param anonymousAuthentication
* set to true to use anonymous authentication
*/
public void setAnonymousAuthentication(boolean anonymousAuthentication) {
@ -154,7 +155,7 @@ public class LdapNetworkConnector extends NetworkConnector implements NamespaceC
/**
* sets the LDAP search scope
*
* @param _searchScope
* @param searchScope
* LDAP JNDI search scope
*/
public void setSearchScope(String searchScope) throws Exception {
@ -174,7 +175,7 @@ public class LdapNetworkConnector extends NetworkConnector implements NamespaceC
/**
* sets the LDAP search filter as defined in RFC 2254
*
* @param _searchFilter
* @param searchFilter
* LDAP search filter
* @see <a href="http://www.faqs.org/rfcs/rfc2254.html">RFC 2254</a>
*/
@ -186,7 +187,7 @@ public class LdapNetworkConnector extends NetworkConnector implements NamespaceC
* enables/disable a persistent search to the LDAP server as defined in
* draft-ietf-ldapext-psearch-03.txt (2.16.840.1.113730.3.4.3)
*
* @param _searchEventListener
* @param searchEventListener
* enable = true, disable = false (default)
* @see <a
* href="http://www.ietf.org/proceedings/01mar/I-D/draft-ietf-ldapext-psearch-03.txt">draft-ietf-ldapext-psearch-03.txt</a>
@ -198,6 +199,7 @@ public class LdapNetworkConnector extends NetworkConnector implements NamespaceC
/**
* start the connector
*/
@Override
public void start() throws Exception {
LOG.info("connecting...");
Hashtable<String, String> env = new Hashtable<String, String>();
@ -262,6 +264,7 @@ public class LdapNetworkConnector extends NetworkConnector implements NamespaceC
/**
* stop the connector
*/
@Override
public void stop() throws Exception {
LOG.info("stopping context...");
for (NetworkConnector connector : connectorMap.values()) {
@ -273,6 +276,7 @@ public class LdapNetworkConnector extends NetworkConnector implements NamespaceC
context.close();
}
@Override
public String toString() {
return this.getClass().getName() + getName() + "[" + ldapURI.toString() + "]";
}
@ -395,6 +399,7 @@ public class LdapNetworkConnector extends NetworkConnector implements NamespaceC
/**
* invoked when an entry has been added during a persistent search
*/
@Override
public void objectAdded(NamingEvent event) {
LOG.debug("entry added");
try {
@ -407,6 +412,7 @@ public class LdapNetworkConnector extends NetworkConnector implements NamespaceC
/**
* invoked when an entry has been removed during a persistent search
*/
@Override
public void objectRemoved(NamingEvent event) {
LOG.debug("entry removed");
try {
@ -419,6 +425,7 @@ public class LdapNetworkConnector extends NetworkConnector implements NamespaceC
/**
* invoked when an entry has been renamed during a persistent search
*/
@Override
public void objectRenamed(NamingEvent event) {
LOG.debug("entry renamed");
// XXX: getNameInNamespace method does not seem to work properly,
@ -433,6 +440,7 @@ public class LdapNetworkConnector extends NetworkConnector implements NamespaceC
/**
* invoked when an entry has been changed during a persistent search
*/
@Override
public void objectChanged(NamingEvent event) {
LOG.debug("entry changed");
try {
@ -447,6 +455,7 @@ public class LdapNetworkConnector extends NetworkConnector implements NamespaceC
/**
* invoked when an exception has occurred during a persistent search
*/
@Override
public void namingExceptionThrown(NamingExceptionEvent event) {
LOG.error("ERR: caught unexpected exception", event.getException());
}

View File

@ -260,7 +260,7 @@ public abstract class JmsConnector implements Service {
}
/**
* @param inboundMessageConvertor The inboundMessageConvertor to set.
* @param jmsMessageConvertor The jmsMessageConvertor to set.
*/
public void setInboundMessageConvertor(JmsMesageConvertor jmsMessageConvertor) {
this.inboundMessageConvertor = jmsMessageConvertor;

View File

@ -51,7 +51,7 @@ public class ReconnectionPolicy {
* Sets the maximum number of a times a Message send should be retried before
* a JMSExeception is thrown indicating that the operation failed.
*
* @param maxRetries
* @param maxSendRetries
* number of send retries that will be performed.
*/
public void setMaxSendRetries(int maxSendRetries) {

View File

@ -77,7 +77,7 @@ public class SimpleJmsQueueConnector extends JmsConnector {
}
/**
* @param localQueueConnectionFactory The localQueueConnectionFactory to
* @param localConnectionFactory The localQueueConnectionFactory to
* set.
*/
public void setLocalQueueConnectionFactory(QueueConnectionFactory localConnectionFactory) {
@ -99,8 +99,8 @@ public class SimpleJmsQueueConnector extends JmsConnector {
}
/**
* @param outboundQueueConnectionFactoryName The
* outboundQueueConnectionFactoryName to set.
* @param foreignQueueConnectionFactoryName The
* foreignQueueConnectionFactoryName to set.
*/
public void setOutboundQueueConnectionFactoryName(String foreignQueueConnectionFactoryName) {
this.outboundQueueConnectionFactoryName = foreignQueueConnectionFactoryName;
@ -142,15 +142,14 @@ public class SimpleJmsQueueConnector extends JmsConnector {
}
/**
* @param outboundQueueConnection The outboundQueueConnection to set.
* @param foreignQueueConnection The foreignQueueConnection to set.
*/
public void setOutboundQueueConnection(QueueConnection foreignQueueConnection) {
this.foreignConnection.set(foreignQueueConnection);
}
/**
* @param outboundQueueConnectionFactory The outboundQueueConnectionFactory
* to set.
* @param foreignQueueConnectionFactory The foreignQueueConnectionFactory to set.
*/
public void setOutboundQueueConnectionFactory(QueueConnectionFactory foreignQueueConnectionFactory) {
this.outboundQueueConnectionFactory = foreignQueueConnectionFactory;
@ -166,7 +165,7 @@ public class SimpleJmsQueueConnector extends JmsConnector {
if (outboundQueueConnectionFactory == null) {
// look it up from JNDI
if (outboundQueueConnectionFactoryName != null) {
outboundQueueConnectionFactory = (QueueConnectionFactory)jndiOutboundTemplate
outboundQueueConnectionFactory = jndiOutboundTemplate
.lookup(outboundQueueConnectionFactoryName, QueueConnectionFactory.class);
if (outboundUsername != null) {
newConnection = outboundQueueConnectionFactory
@ -225,7 +224,7 @@ public class SimpleJmsQueueConnector extends JmsConnector {
if (embeddedConnectionFactory == null) {
// look it up from JNDI
if (localConnectionFactoryName != null) {
localQueueConnectionFactory = (QueueConnectionFactory)jndiLocalTemplate
localQueueConnectionFactory = jndiLocalTemplate
.lookup(localConnectionFactoryName, QueueConnectionFactory.class);
if (localUsername != null) {
newConnection = localQueueConnectionFactory
@ -350,6 +349,7 @@ public class SimpleJmsQueueConnector extends JmsConnector {
}
}
@Override
protected Destination createReplyToBridge(Destination destination, Connection replyToProducerConnection,
Connection replyToConsumerConnection) {
Queue replyToProducerQueue = (Queue)destination;
@ -359,6 +359,7 @@ public class SimpleJmsQueueConnector extends JmsConnector {
InboundQueueBridge bridge = (InboundQueueBridge)replyToBridges.get(replyToProducerQueue);
if (bridge == null) {
bridge = new InboundQueueBridge() {
@Override
protected Destination processReplyToDestination(Destination destination) {
return null;
}
@ -390,6 +391,7 @@ public class SimpleJmsQueueConnector extends JmsConnector {
OutboundQueueBridge bridge = (OutboundQueueBridge)replyToBridges.get(replyToProducerQueue);
if (bridge == null) {
bridge = new OutboundQueueBridge() {
@Override
protected Destination processReplyToDestination(Destination destination) {
return null;
}
@ -430,7 +432,7 @@ public class SimpleJmsQueueConnector extends JmsConnector {
if (preferJndiDestinationLookup) {
try {
// look-up the Queue
result = (Queue)jndiOutboundTemplate.lookup(queueName, Queue.class);
result = jndiOutboundTemplate.lookup(queueName, Queue.class);
} catch (NamingException e) {
try {
result = session.createQueue(queueName);
@ -448,7 +450,7 @@ public class SimpleJmsQueueConnector extends JmsConnector {
} catch (JMSException e) {
// look-up the Queue
try {
result = (Queue)jndiOutboundTemplate.lookup(queueName, Queue.class);
result = jndiOutboundTemplate.lookup(queueName, Queue.class);
} catch (NamingException e1) {
String errStr = "Failed to look-up Queue for name: " + queueName;
LOG.error(errStr, e);

View File

@ -80,8 +80,8 @@ public class SimpleJmsTopicConnector extends JmsConnector {
/**
* @param localTopicConnectionFactory The localTopicConnectionFactory to set.
*/
public void setLocalTopicConnectionFactory(TopicConnectionFactory localConnectionFactory) {
this.localTopicConnectionFactory = localConnectionFactory;
public void setLocalTopicConnectionFactory(TopicConnectionFactory localTopicConnectionFactory) {
this.localTopicConnectionFactory = localTopicConnectionFactory;
}
/**
@ -99,7 +99,7 @@ public class SimpleJmsTopicConnector extends JmsConnector {
}
/**
* @param outboundTopicConnectionFactoryName The outboundTopicConnectionFactoryName to set.
* @param foreignTopicConnectionFactoryName The foreignTopicConnectionFactoryName to set.
*/
public void setOutboundTopicConnectionFactoryName(String foreignTopicConnectionFactoryName) {
this.outboundTopicConnectionFactoryName = foreignTopicConnectionFactoryName;
@ -141,14 +141,14 @@ public class SimpleJmsTopicConnector extends JmsConnector {
}
/**
* @param outboundTopicConnection The outboundTopicConnection to set.
* @param foreignTopicConnection The foreignTopicConnection to set.
*/
public void setOutboundTopicConnection(TopicConnection foreignTopicConnection) {
this.foreignConnection.set(foreignTopicConnection);
}
/**
* @param outboundTopicConnectionFactory The outboundTopicConnectionFactory to set.
* @param foreignTopicConnectionFactory The foreignTopicConnectionFactory to set.
*/
public void setOutboundTopicConnectionFactory(TopicConnectionFactory foreignTopicConnectionFactory) {
this.outboundTopicConnectionFactory = foreignTopicConnectionFactory;
@ -164,7 +164,7 @@ public class SimpleJmsTopicConnector extends JmsConnector {
if (outboundTopicConnectionFactory == null) {
// look it up from JNDI
if (outboundTopicConnectionFactoryName != null) {
outboundTopicConnectionFactory = (TopicConnectionFactory)jndiOutboundTemplate
outboundTopicConnectionFactory = jndiOutboundTemplate
.lookup(outboundTopicConnectionFactoryName, TopicConnectionFactory.class);
if (outboundUsername != null) {
newConnection = outboundTopicConnectionFactory
@ -223,7 +223,7 @@ public class SimpleJmsTopicConnector extends JmsConnector {
if (embeddedConnectionFactory == null) {
// look it up from JNDI
if (localConnectionFactoryName != null) {
localTopicConnectionFactory = (TopicConnectionFactory)jndiLocalTemplate
localTopicConnectionFactory = jndiLocalTemplate
.lookup(localConnectionFactoryName, TopicConnectionFactory.class);
if (localUsername != null) {
newConnection = localTopicConnectionFactory
@ -348,6 +348,7 @@ public class SimpleJmsTopicConnector extends JmsConnector {
}
}
@Override
protected Destination createReplyToBridge(Destination destination, Connection replyToProducerConnection,
Connection replyToConsumerConnection) {
Topic replyToProducerTopic = (Topic)destination;
@ -357,6 +358,7 @@ public class SimpleJmsTopicConnector extends JmsConnector {
InboundTopicBridge bridge = (InboundTopicBridge)replyToBridges.get(replyToProducerTopic);
if (bridge == null) {
bridge = new InboundTopicBridge() {
@Override
protected Destination processReplyToDestination(Destination destination) {
return null;
}
@ -388,6 +390,7 @@ public class SimpleJmsTopicConnector extends JmsConnector {
OutboundTopicBridge bridge = (OutboundTopicBridge)replyToBridges.get(replyToProducerTopic);
if (bridge == null) {
bridge = new OutboundTopicBridge() {
@Override
protected Destination processReplyToDestination(Destination destination) {
return null;
}
@ -428,7 +431,7 @@ public class SimpleJmsTopicConnector extends JmsConnector {
if (preferJndiDestinationLookup) {
try {
// look-up the Queue
result = (Topic)jndiOutboundTemplate.lookup(topicName, Topic.class);
result = jndiOutboundTemplate.lookup(topicName, Topic.class);
} catch (NamingException e) {
try {
result = session.createTopic(topicName);
@ -446,7 +449,7 @@ public class SimpleJmsTopicConnector extends JmsConnector {
} catch (JMSException e) {
// look-up the Topic
try {
result = (Topic)jndiOutboundTemplate.lookup(topicName, Topic.class);
result = jndiOutboundTemplate.lookup(topicName, Topic.class);
} catch (NamingException e1) {
String errStr = "Failed to look-up Topic for name: " + topicName;
LOG.error(errStr, e);
@ -456,7 +459,7 @@ public class SimpleJmsTopicConnector extends JmsConnector {
}
}
}
return result;
}
}

View File

@ -43,6 +43,7 @@ class TopicBridge extends DestinationBridge {
protected TopicConnection consumerConnection;
protected TopicConnection producerConnection;
@Override
public void stop() throws Exception {
super.stop();
if (consumerSession != null) {
@ -53,6 +54,7 @@ class TopicBridge extends DestinationBridge {
}
}
@Override
protected MessageConsumer createConsumer() throws JMSException {
// set up the consumer
if (consumerConnection == null) return null;
@ -78,6 +80,7 @@ class TopicBridge extends DestinationBridge {
return consumer;
}
@Override
protected synchronized MessageProducer createProducer() throws JMSException {
if (producerConnection == null) return null;
producerSession = producerConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
@ -85,6 +88,7 @@ class TopicBridge extends DestinationBridge {
return producer;
}
@Override
protected synchronized void sendMessage(Message message) throws JMSException {
if (producer == null && createProducer() == null) {
throw new JMSException("Producer for remote queue not available.");
@ -119,14 +123,14 @@ class TopicBridge extends DestinationBridge {
}
/**
* @return Returns the subscriptionName.
* @return Returns the consumerName.
*/
public String getConsumerName() {
return consumerName;
}
/**
* @param subscriptionName The subscriptionName to set.
* @param consumerName The consumerName to set.
*/
public void setConsumerName(String consumerName) {
this.consumerName = consumerName;
@ -188,10 +192,12 @@ class TopicBridge extends DestinationBridge {
this.selector = selector;
}
@Override
protected Connection getConnnectionForConsumer() {
return getConsumerConnection();
}
@Override
protected Connection getConnectionForProducer() {
return getProducerConnection();
}

View File

@ -30,6 +30,7 @@ import org.slf4j.LoggerFactory;
* @version 1.0
*/
public class DiscardingDLQBrokerPlugin implements BrokerPlugin {
public DiscardingDLQBrokerPlugin() {
}
@ -41,12 +42,16 @@ public class DiscardingDLQBrokerPlugin implements BrokerPlugin {
private int reportInterval = 1000;
/**
* Installs the plugin into the interceptor chain of the broker, returning the new intercepted broker to use.
* Installs the plugin into the intercepter chain of the broker, returning the new
* intercepted broker to use.
*
* @param broker Broker
* @throws Exception
*
* @return Broker
* @todo Implement this org.apache.activemq.broker.BrokerPlugin method
*
* @throws Exception
*/
@Override
public Broker installPlugin(Broker broker) throws Exception {
log.info("Installing Discarding Dead Letter Queue broker plugin[dropAll={}; dropTemporaryTopics={}; dropTemporaryQueues={}; dropOnly={}; reportInterval={}]", new Object[]{
isDropAll(), isDropTemporaryTopics(), isDropTemporaryQueues(), getDropOnly(), reportInterval

View File

@ -16,58 +16,60 @@
*/
package org.apache.activemq.plugin;
import org.apache.activemq.broker.Broker;
import org.apache.activemq.broker.BrokerPlugin;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* A Plugin which allows to force every incoming message to be PERSISTENT or NON-PERSISTENT.
*
* Useful, if you have set the broker usage policy to process ONLY persistent or ONLY non-persistent
* messages.
* @org.apache.xbean.XBean element="forcePersistencyModeBrokerPlugin"
* A Plugin which allows to force every incoming message to be PERSISTENT or
* NON-PERSISTENT.
*
* Useful, if you have set the broker usage policy to process ONLY persistent or
* ONLY non-persistent messages.
*
* @org.apache.xbean.XBean element="forcePersistencyModeBrokerPlugin"
*/
public class ForcePersistencyModeBrokerPlugin implements BrokerPlugin {
private static Logger LOG = LoggerFactory.getLogger(ForcePersistencyModeBrokerPlugin.class);
private boolean persistenceFlag = false;
/**
* Constructor
*/
public ForcePersistencyModeBrokerPlugin() {
}
private static Logger LOG = LoggerFactory.getLogger(ForcePersistencyModeBrokerPlugin.class);
private boolean persistenceFlag = false;
/**
* @param broker
* @return the Broker
* @throws Exception
* @see org.apache.activemq.broker.BrokerPlugin#installPlugin(org.apache.activemq.broker.Broker)
*/
/**
* Constructor
*/
public ForcePersistencyModeBrokerPlugin() {}
public Broker installPlugin(Broker broker) throws Exception{
ForcePersistencyModeBroker pB = new ForcePersistencyModeBroker(broker);
pB.setPersistenceFlag(isPersistenceForced());
LOG.info("Installing ForcePersistencyModeBroker plugin: persistency enforced={}", pB.isPersistent());
return pB;
}
/**
* @param broker
*
* @return the Broker
*
* @throws Exception
*
* @see org.apache.activemq.broker.BrokerPlugin#installPlugin(org.apache.activemq.broker.Broker)
*/
@Override
public Broker installPlugin(Broker broker) throws Exception {
ForcePersistencyModeBroker pB = new ForcePersistencyModeBroker(broker);
pB.setPersistenceFlag(isPersistenceForced());
LOG.info("Installing ForcePersistencyModeBroker plugin: persistency enforced={}", pB.isPersistent());
return pB;
}
/** Sets the persistency mode.
*
* @param persistenceFlag
*/
public void setPersistenceFlag(final boolean persistenceFlag) {
this.persistenceFlag = persistenceFlag;
}
/**
* Sets the persistence mode.
*
* @param persistenceFlag
*/
public void setPersistenceFlag(final boolean persistenceFlag) {
this.persistenceFlag = persistenceFlag;
}
/**
* @return the mode the (activated) plugin will set the message delivery mode
*/
public final boolean isPersistenceForced() {
return persistenceFlag;
}
/**
* @return the mode the (activated) plugin will set the message delivery
* mode
*/
public final boolean isPersistenceForced() {
return persistenceFlag;
}
}

View File

@ -52,8 +52,9 @@ import org.slf4j.LoggerFactory;
* <p/>
* This is influenced by code snippets developed by Maciej Rakowicz
*
* @see https://issues.apache.org/activemq/browse/AMQ-3004
* @see http://mail-archives.apache.org/mod_mbox/activemq-users/201011.mbox/%3C8A013711-2613-450A-A487-379E784AF1D6@homeaway.co.uk%3E
* Refer to:
* https://issues.apache.org/activemq/browse/AMQ-3004
* http://mail-archives.apache.org/mod_mbox/activemq-users/201011.mbox/%3C8A013711-2613-450A-A487-379E784AF1D6@homeaway.co.uk%3E
*/
public class SubQueueSelectorCacheBroker extends BrokerFilter implements Runnable {
private static final Logger LOG = LoggerFactory.getLogger(SubQueueSelectorCacheBroker.class);

View File

@ -16,13 +16,13 @@
*/
package org.apache.activemq.plugin;
import static org.apache.activemq.plugin.SubQueueSelectorCacheBroker.MAX_PERSIST_INTERVAL;
import java.io.File;
import org.apache.activemq.broker.Broker;
import org.apache.activemq.broker.BrokerPlugin;
import static org.apache.activemq.plugin.SubQueueSelectorCacheBroker.MAX_PERSIST_INTERVAL;
/**
* A plugin which allows the caching of the selector from a subscription queue.
* <p/>
@ -31,8 +31,7 @@ import static org.apache.activemq.plugin.SubQueueSelectorCacheBroker.MAX_PERSIST
* <p/>
* This is influenced by code snippets developed by Maciej Rakowicz
*
* @author Roelof Naude roelof(dot)naude(at)gmail.com
*@org.apache.xbean.XBean element="virtualSelectorCacheBrokerPlugin"
* @org.apache.xbean.XBean element="virtualSelectorCacheBrokerPlugin"
*/
public class SubQueueSelectorCacheBrokerPlugin implements BrokerPlugin {

View File

@ -45,7 +45,7 @@ public class JaasCertificateAuthenticationBroker extends BrokerFilter implements
* Simple constructor. Leaves everything to superclass.
*
* @param next The Broker that does the actual work for this Filter.
* @param jassConfiguration The JAAS domain configuration name (refere to
* @param jaasConfiguration The JAAS domain configuration name (refere to
* JAAS documentation).
*/
public JaasCertificateAuthenticationBroker(Broker next, String jaasConfiguration) {

View File

@ -17,7 +17,9 @@
package org.apache.activemq.store;
import java.io.IOException;
import javax.jms.JMSException;
import org.apache.activemq.broker.ConnectionContext;
import org.apache.activemq.command.MessageAck;
import org.apache.activemq.command.MessageId;
@ -25,27 +27,27 @@ import org.apache.activemq.command.SubscriptionInfo;
/**
* A MessageStore for durable topic subscriptions
*
*
*/
public interface TopicMessageStore extends MessageStore {
/**
* Stores the last acknowledged messgeID for the given subscription so that
* we can recover and commence dispatching messages from the last checkpoint
*
*
* @param context
* @param clientId
* @param subscriptionName
* @param messageId
* @param subscriptionPersistentId
* @param ack
*
* @throws IOException
*/
void acknowledge(ConnectionContext context, String clientId, String subscriptionName, MessageId messageId, MessageAck ack) throws IOException;
/**
* @param clientId
* @param subscriptionName
* @param sub
*
* @throws IOException
* @throws JMSException
*/
@ -57,11 +59,11 @@ public interface TopicMessageStore extends MessageStore {
* <p/> e.g. if we dispatched some messages to a new durable topic
* subscriber, then went down before acknowledging any messages, we need to
* know the correct point from which to recover from.
*
*
* @param clientId
* @param subscriptionName
* @param listener
* @param subscription
*
* @throws Exception
*/
void recoverSubscription(String clientId, String subscriptionName, MessageRecoveryListener listener) throws Exception;
@ -69,18 +71,19 @@ public interface TopicMessageStore extends MessageStore {
/**
* For an active subscription - retrieve messages from the store for the
* subscriber after the lastMessageId messageId <p/>
*
*
* @param clientId
* @param subscriptionName
* @param maxReturned
* @param listener
*
* @throws Exception
*/
void recoverNextMessages(String clientId, String subscriptionName, int maxReturned, MessageRecoveryListener listener) throws Exception;
/**
* A hint to the Store to reset any batching state for a durable subscriber
*
*
* @param clientId
* @param subscriptionName
*/
@ -89,27 +92,31 @@ public interface TopicMessageStore extends MessageStore {
/**
* Get the number of messages ready to deliver from the store to a durable
* subscriber
*
*
* @param clientId
* @param subscriberName
*
* @return the outstanding message count
*
* @throws IOException
*/
int getMessageCount(String clientId, String subscriberName) throws IOException;
/**
* Finds the subscriber entry for the given consumer info
*
*
* @param clientId
* @param subscriptionName
*
* @return the SubscriptionInfo
*
* @throws IOException
*/
SubscriptionInfo lookupSubscription(String clientId, String subscriptionName) throws IOException;
/**
* Lists all the durable subscriptions for a given destination.
*
*
* @return an array SubscriptionInfos
* @throws IOException
*/
@ -122,11 +129,10 @@ public interface TopicMessageStore extends MessageStore {
* new subscription. Otherwise, if retroactive is true, then create the
* subscription without it having an acknowledged message so that on
* recovery, all message recorded for the topic get replayed.
*
* @param clientId
* @param subscriptionName
* @param selector
*
* @param subscriptionInfo
* @param retroactive
*
* @throws IOException
*/
void addSubscription(SubscriptionInfo subscriptionInfo, boolean retroactive) throws IOException;

View File

@ -26,22 +26,22 @@ import org.apache.activemq.command.SubscriptionInfo;
/**
* A MessageStore for durable topic subscriptions
*
*
*/
public interface TopicReferenceStore extends ReferenceStore, TopicMessageStore {
/**
* Removes the last acknowledged messgeID for the given subscription so that
* we can recover and commence dispatching messages from the last checkpoint
* N.B. - all messages previous to this one for a given subscriber
* should also be acknowledged
*
*
* @param context
* @param clientId
* @param subscriptionName
* @param messageId
* @param subscriptionPersistentId
*
* @return true if there are no more references to the message - or the message is null
*
* @throws IOException
*/
boolean acknowledgeReference(ConnectionContext context, String clientId, String subscriptionName, MessageId messageId) throws IOException;
@ -49,10 +49,11 @@ public interface TopicReferenceStore extends ReferenceStore, TopicMessageStore {
/**
* @param clientId
* @param subscriptionName
* @param sub
*
* @throws IOException
* @throws JMSException
*/
@Override
void deleteSubscription(String clientId, String subscriptionName) throws IOException;
/**
@ -61,62 +62,74 @@ public interface TopicReferenceStore extends ReferenceStore, TopicMessageStore {
* <p/> e.g. if we dispatched some messages to a new durable topic
* subscriber, then went down before acknowledging any messages, we need to
* know the correct point from which to recover from.
*
*
* @param clientId
* @param subscriptionName
* @param listener
* @param subscription
*
* @throws Exception
*/
@Override
void recoverSubscription(String clientId, String subscriptionName, MessageRecoveryListener listener) throws Exception;
/**
* For an active subscription - retrieve messages from the store for the
* subscriber after the lastMessageId messageId <p/>
*
*
* @param clientId
* @param subscriptionName
* @param maxReturned
* @param listener
*
* @throws Exception
*/
@Override
void recoverNextMessages(String clientId, String subscriptionName, int maxReturned, MessageRecoveryListener listener) throws Exception;
/**
* A hint to the Store to reset any batching state for a durable subsriber
*
*
* @param clientId
* @param subscriptionName
*/
@Override
void resetBatching(String clientId, String subscriptionName);
/**
* Get the number of messages ready to deliver from the store to a durable
* subscriber
*
*
* @param clientId
* @param subscriberName
*
* @return the outstanding message count
*
* @throws IOException
*/
@Override
int getMessageCount(String clientId, String subscriberName) throws IOException;
/**
* Finds the subscriber entry for the given consumer info
*
*
* @param clientId
* @param subscriptionName
*
* @return the SubscriptionInfo
*
* @throws IOException
*/
@Override
SubscriptionInfo lookupSubscription(String clientId, String subscriptionName) throws IOException;
/**
* Lists all the durable subscirptions for a given destination.
*
* Lists all the durable subscriptions for a given destination.
*
* @return an array SubscriptionInfos
*
* @throws IOException
*/
@Override
SubscriptionInfo[] getAllSubscriptions() throws IOException;
/**
@ -126,11 +139,10 @@ public interface TopicReferenceStore extends ReferenceStore, TopicMessageStore {
* new subscription. Otherwise, if retroactive is true, then create the
* subscription without it having an acknowledged message so that on
* recovery, all message recorded for the topic get replayed.
*
* @param clientId
* @param subscriptionName
* @param selector
*
* @param subscriptionInfo
* @param retroactive
*
* @throws IOException
*/
void addSubsciption(SubscriptionInfo subscriptionInfo, boolean retroactive) throws IOException;

View File

@ -16,14 +16,16 @@
*/
package org.apache.activemq.transport;
import java.io.IOException;
import javax.management.ObjectName;
import org.apache.activemq.broker.jmx.AnnotatedMBean;
import org.apache.activemq.broker.jmx.ManagementContext;
import org.apache.activemq.util.IOExceptionSupport;
import org.apache.activemq.util.LogWriterFinder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import javax.management.ObjectName;
/**
* Singleton class to create TransportLogger objects.
@ -31,9 +33,9 @@ import javax.management.ObjectName;
* a TransportLoggerControlMBean is created and registered.
* This MBean permits enabling and disabling the logging for
* all TransportLogger objects at once.
*
*
* @author David Martin Clavo david(dot)martin(dot)clavo(at)gmail.com
*
*
* @see TransportLoggerControlMBean
*/
public class TransportLoggerFactory {
@ -50,13 +52,13 @@ public class TransportLoggerFactory {
public static String defaultLogWriterName = "default";
/**
* If transport logging is enabled, it will be possible to control
* the transport loggers or not based on this value
* the transport loggers or not based on this value
*/
private static boolean defaultDynamicManagement = false;
/**
* If transport logging is enabled, the transport loggers will initially
* output or not depending on this value.
* This setting only has a meaning if
* This setting only has a meaning if
*/
private static boolean defaultInitialBehavior = true;
/**
@ -110,7 +112,7 @@ public class TransportLoggerFactory {
int id = getNextId();
return createTransportLogger(next, id, createLog(id), defaultLogWriterName, defaultDynamicManagement, defaultInitialBehavior, defaultJmxPort);
}
/**
* Creates a TransportLogger object, that will be inserted in the Transport Stack.
* Uses the default initial behavior and the default log writer.
@ -150,7 +152,7 @@ public class TransportLoggerFactory {
* @param dynamicManagement Specifies if JMX will be used to switch on/off the TransportLogger to be created.
* @param startLogging Specifies if this TransportLogger should be initially active or not. Only has a meaning if
* dynamicManagement = true.
* @param jmxPort the port to be used by the JMX server. It should only be different from 1099 (broker's default JMX port)
* @param jmxport the port to be used by the JMX server. It should only be different from 1099 (broker's default JMX port)
* when it's a client that is using Transport Logging. In a broker, if the port is different from 1099, 2 JMX servers will
* be created, both identical, with all the MBeans.
* @return A TransportLogger object.
@ -183,7 +185,7 @@ public class TransportLoggerFactory {
private static Logger createLog(int id) {
return LoggerFactory.getLogger(TransportLogger.class.getName()+".Connection:" + id);
}
/**
* Starts the management context.
* Creates and registers a TransportLoggerControl MBean which enables the user
@ -201,7 +203,7 @@ public class TransportLoggerFactory {
try {
this.objectName = new ObjectName(this.managementContext.getJmxDomainName()+":"+ "Type=TransportLoggerControl");
AnnotatedMBean.registerMBean(this.managementContext, new TransportLoggerControl(this.managementContext),this.objectName);
this.transportLoggerControlCreated = true;
} catch (Exception e) {

View File

@ -18,11 +18,11 @@ package org.apache.activemq.util;
/**
* Used to convert to hex from byte arrays and back.
*
*
*
*
*/
public final class HexSupport {
private static final String[] HEX_TABLE = new String[]{
"00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0a", "0b", "0c", "0d", "0e", "0f",
"10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1a", "1b", "1c", "1d", "1e", "1f",
@ -42,15 +42,15 @@ public final class HexSupport {
"f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "fa", "fb", "fc", "fd", "fe", "ff",
};
private static final int[] INT_OFFSETS = new int[]{
24,16,8,0
24,16,8,0
};
private HexSupport() {
}
/**
* @param hex
* @return
* @return array of bytes
*/
public static byte[] toBytesFromHex(String hex) {
byte rc[] = new byte[hex.length() / 2];
@ -64,7 +64,7 @@ public final class HexSupport {
/**
* @param bytes
* @return
* @return string hex value
*/
public static String toHexFromBytes(byte[] bytes) {
StringBuffer rc = new StringBuffer(bytes.length * 2);
@ -75,21 +75,21 @@ public final class HexSupport {
}
/**
*
* @param value
*
* @param value
* @param trim if the leading 0's should be trimmed off.
* @return
* @return string hex value
*/
public static String toHexFromInt(int value, boolean trim) {
StringBuffer rc = new StringBuffer(INT_OFFSETS.length*2);
for (int i = 0; i < INT_OFFSETS.length; i++) {
int b = 0xFF & (value>>INT_OFFSETS[i]);
if( !(trim && b == 0) ) {
rc.append(HEX_TABLE[b]);
trim=false;
}
int b = 0xFF & (value>>INT_OFFSETS[i]);
if( !(trim && b == 0) ) {
rc.append(HEX_TABLE[b]);
trim=false;
}
}
return rc.toString();
}
}

View File

@ -66,7 +66,7 @@ public final class IOHelper {
* and "." characters.
*
* @param name
* @return
* @return safe name of the directory
*/
public static String toFileSystemDirectorySafeName(String name) {
return toFileSystemSafeName(name, true, MAX_DIR_NAME_LENGTH);
@ -84,7 +84,7 @@ public final class IOHelper {
* @param name
* @param dirSeparators
* @param maxFileLength
* @return
* @return file system safe name
*/
public static String toFileSystemSafeName(String name, boolean dirSeparators, int maxFileLength) {
int size = name.length();

View File

@ -19,7 +19,7 @@ package org.apache.activemq.util;
/**
* Provides a base class for you to extend when you want object to maintain a
* doubly linked list to other objects without using a collection class.
*
*
* @author chirino
*/
public class LinkedNode {
@ -103,7 +103,6 @@ public class LinkedNode {
/**
* @param leftHead the node to link after this node.
* @return
* @return this
*/
public LinkedNode linkBefore(LinkedNode leftHead) {
@ -148,11 +147,10 @@ public class LinkedNode {
// Update our links..
reset();
}
public void reset() {
next = this;
prev = this;
tail = true;
}
}

View File

@ -75,9 +75,9 @@ public class Activator implements BundleActivator, SynchronousBundleListener, Ob
debug("activating");
this.bundleContext = bundleContext;
cachePackageCapabilities(Service.class, Transport.class, DiscoveryAgent.class, PersistenceAdapter.class);
debug("checking existing bundles");
bundleContext.addBundleListener(this);
for (Bundle bundle : bundleContext.getBundles()) {
@ -91,7 +91,7 @@ public class Activator implements BundleActivator, SynchronousBundleListener, Ob
/**
* Caches the package capabilities that are needed for a set of interface classes
*
*
* @param classes interfaces we want to track
*/
private void cachePackageCapabilities(Class<?> ... classes) {
@ -100,7 +100,7 @@ public class Activator implements BundleActivator, SynchronousBundleListener, Ob
for (Class<?> clazz: classes) {
packageNames.add(clazz.getPackage().getName());
}
List<BundleCapability> ourExports = ourWiring.getCapabilities(PACKAGE_NAMESPACE);
for (BundleCapability ourExport : ourExports) {
String ourPkgName = (String) ourExport.getAttributes().get(PACKAGE_NAMESPACE);
@ -243,9 +243,9 @@ public class Activator implements BundleActivator, SynchronousBundleListener, Ob
/**
* We consider a bundle to be a candidate for objects if it imports at least
* one of the packages of our interfaces
*
*
* @param bundle
* @return
* @return true if the bundle is improting.
*/
private boolean isImportingUs(Bundle bundle) {
BundleWiring wiring = bundle.adapt(BundleWiring.class);