mirror of https://github.com/apache/activemq.git
Fix some javadoc warnings and spelling errors in the docs.
This commit is contained in:
parent
5e4014a976
commit
61b2f6b40e
|
@ -1246,7 +1246,7 @@ public class ActiveMQConnection implements Connection, TopicConnection, QueueCon
|
|||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @return a newly created ConsumedId unique to this connection session instance.
|
||||
*/
|
||||
private ConsumerId createConsumerId() {
|
||||
return new ConsumerId(connectionSessionId, consumerIdGenerator.getNextSequenceId());
|
||||
|
@ -1316,7 +1316,7 @@ public class ActiveMQConnection implements Connection, TopicConnection, QueueCon
|
|||
* Send a packet through a Connection - for internal use only
|
||||
*
|
||||
* @param command
|
||||
* @return
|
||||
*
|
||||
* @throws JMSException
|
||||
*/
|
||||
public void syncSendPacket(final Command command, final AsyncCallback onComplete) throws JMSException {
|
||||
|
@ -1418,7 +1418,9 @@ public class ActiveMQConnection implements Connection, TopicConnection, QueueCon
|
|||
* Send a packet through a Connection - for internal use only
|
||||
*
|
||||
* @param command
|
||||
* @return
|
||||
*
|
||||
* @return the broker Response for the given Command.
|
||||
*
|
||||
* @throws JMSException
|
||||
*/
|
||||
public Response syncSendPacket(Command command, int timeout) throws JMSException {
|
||||
|
|
|
@ -288,7 +288,7 @@ public class ActiveMQConnectionFactory extends JNDIBaseStorable implements Conne
|
|||
}
|
||||
|
||||
/**
|
||||
* @returns the StatsImpl associated with this ConnectionFactory.
|
||||
* @return the StatsImpl associated with this ConnectionFactory.
|
||||
*/
|
||||
@Override
|
||||
public StatsImpl getStats() {
|
||||
|
|
|
@ -30,8 +30,6 @@ import org.apache.activemq.util.LRUCache;
|
|||
|
||||
/**
|
||||
* Provides basic audit functions for Messages without sync
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class ActiveMQMessageAuditNoSync implements Serializable {
|
||||
|
||||
|
@ -219,8 +217,11 @@ public class ActiveMQMessageAuditNoSync implements Serializable {
|
|||
|
||||
/**
|
||||
* Check the message is in order
|
||||
*
|
||||
* @param msg
|
||||
* @return
|
||||
*
|
||||
* @return true if the id is in order
|
||||
*
|
||||
* @throws JMSException
|
||||
*/
|
||||
public boolean isInOrder(Message msg) throws JMSException {
|
||||
|
@ -229,8 +230,10 @@ public class ActiveMQMessageAuditNoSync implements Serializable {
|
|||
|
||||
/**
|
||||
* Check the message id is in order
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*
|
||||
* @return true if the id is in order
|
||||
*/
|
||||
public boolean isInOrder(final String id) {
|
||||
boolean answer = true;
|
||||
|
@ -251,8 +254,10 @@ public class ActiveMQMessageAuditNoSync implements Serializable {
|
|||
|
||||
/**
|
||||
* Check the MessageId is in order
|
||||
*
|
||||
* @param message
|
||||
* @return
|
||||
*
|
||||
* @return true if the id is in order
|
||||
*/
|
||||
public boolean isInOrder(final MessageReference message) {
|
||||
return isInOrder(message.getMessageId());
|
||||
|
@ -260,8 +265,10 @@ public class ActiveMQMessageAuditNoSync implements Serializable {
|
|||
|
||||
/**
|
||||
* Check the MessageId is in order
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*
|
||||
* @return true if the id is in order
|
||||
*/
|
||||
public boolean isInOrder(final MessageId id) {
|
||||
boolean answer = false;
|
||||
|
|
|
@ -579,7 +579,9 @@ public class ActiveMQMessageConsumer implements MessageAvailableConsumer, StatsC
|
|||
|
||||
/**
|
||||
* @param md
|
||||
* @return
|
||||
* the MessageDispatch that arrived from the Broker.
|
||||
*
|
||||
* @return an ActiveMQMessage initialized from the Message in the dispatch.
|
||||
*/
|
||||
private ActiveMQMessage createActiveMQMessage(final MessageDispatch md) throws JMSException {
|
||||
ActiveMQMessage m = (ActiveMQMessage)md.getMessage().copy();
|
||||
|
@ -1534,7 +1536,8 @@ public class ActiveMQMessageConsumer implements MessageAvailableConsumer, StatsC
|
|||
/**
|
||||
* Delivers a message to the message listener.
|
||||
*
|
||||
* @return
|
||||
* @return true if another execution is needed.
|
||||
*
|
||||
* @throws JMSException
|
||||
*/
|
||||
public boolean iterate() {
|
||||
|
|
|
@ -44,44 +44,43 @@ import org.apache.activemq.command.ConsumerId;
|
|||
* object is recommended for creating new code. The <CODE>QueueReceiver
|
||||
* </CODE>
|
||||
* is provided to support existing code.
|
||||
*
|
||||
*
|
||||
* @see javax.jms.Session#createConsumer(javax.jms.Destination, String)
|
||||
* @see javax.jms.Session#createConsumer(javax.jms.Destination)
|
||||
* @see javax.jms.QueueSession#createReceiver(Queue, String)
|
||||
* @see javax.jms.QueueSession#createReceiver(Queue)
|
||||
* @see javax.jms.MessageConsumer
|
||||
*/
|
||||
|
||||
public class ActiveMQQueueReceiver extends ActiveMQMessageConsumer implements QueueReceiver {
|
||||
|
||||
/**
|
||||
* @param theSession
|
||||
* @param value
|
||||
* @param consumerId
|
||||
* @param destination
|
||||
* @param messageSelector
|
||||
* @param selector
|
||||
* @param prefetch
|
||||
* @param maximumPendingMessageCount
|
||||
* @param asyncDispatch
|
||||
*
|
||||
* @throws JMSException
|
||||
*/
|
||||
protected ActiveMQQueueReceiver(ActiveMQSession theSession, ConsumerId consumerId,
|
||||
ActiveMQDestination destination, String selector, int prefetch,
|
||||
int maximumPendingMessageCount, boolean asyncDispatch)
|
||||
throws JMSException {
|
||||
int maximumPendingMessageCount, boolean asyncDispatch) throws JMSException {
|
||||
super(theSession, consumerId, destination, null, selector, prefetch, maximumPendingMessageCount,
|
||||
false, false, asyncDispatch, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the <CODE>Queue</CODE> associated with this queue receiver.
|
||||
*
|
||||
*
|
||||
* @return this receiver's <CODE>Queue</CODE>
|
||||
* @throws JMSException if the JMS provider fails to get the queue for this
|
||||
* queue receiver due to some internal error.
|
||||
*/
|
||||
|
||||
@Override
|
||||
public Queue getQueue() throws JMSException {
|
||||
checkClosed();
|
||||
return (Queue)super.getDestination();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -45,10 +45,8 @@ import javax.jms.TopicSubscriber;
|
|||
* A QueueSession implementation that throws IllegalStateExceptions when Topic
|
||||
* operations are attempted but which delegates to another QueueSession for all
|
||||
* other operations. The ActiveMQSessions implement both Topic and Queue
|
||||
* Sessions methods but the spec states that Queue session should throw
|
||||
* Sessions methods but the specification states that Queue session should throw
|
||||
* Exceptions if topic operations are attempted on it.
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class ActiveMQQueueSession implements QueueSession {
|
||||
|
||||
|
@ -58,52 +56,32 @@ public class ActiveMQQueueSession implements QueueSession {
|
|||
this.next = next;
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws JMSException
|
||||
*/
|
||||
@Override
|
||||
public void close() throws JMSException {
|
||||
next.close();
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws JMSException
|
||||
*/
|
||||
@Override
|
||||
public void commit() throws JMSException {
|
||||
next.commit();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param queue
|
||||
* @return
|
||||
* @throws JMSException
|
||||
*/
|
||||
@Override
|
||||
public QueueBrowser createBrowser(Queue queue) throws JMSException {
|
||||
return next.createBrowser(queue);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param queue
|
||||
* @param messageSelector
|
||||
* @return
|
||||
* @throws JMSException
|
||||
*/
|
||||
@Override
|
||||
public QueueBrowser createBrowser(Queue queue, String messageSelector) throws JMSException {
|
||||
return next.createBrowser(queue, messageSelector);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @throws JMSException
|
||||
*/
|
||||
@Override
|
||||
public BytesMessage createBytesMessage() throws JMSException {
|
||||
return next.createBytesMessage();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param destination
|
||||
* @return
|
||||
* @throws JMSException
|
||||
*/
|
||||
@Override
|
||||
public MessageConsumer createConsumer(Destination destination) throws JMSException {
|
||||
if (destination instanceof Topic) {
|
||||
throw new InvalidDestinationException("Topics are not supported by a QueueSession");
|
||||
|
@ -111,12 +89,7 @@ public class ActiveMQQueueSession implements QueueSession {
|
|||
return next.createConsumer(destination);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param destination
|
||||
* @param messageSelector
|
||||
* @return
|
||||
* @throws JMSException
|
||||
*/
|
||||
@Override
|
||||
public MessageConsumer createConsumer(Destination destination, String messageSelector) throws JMSException {
|
||||
if (destination instanceof Topic) {
|
||||
throw new InvalidDestinationException("Topics are not supported by a QueueSession");
|
||||
|
@ -124,13 +97,7 @@ public class ActiveMQQueueSession implements QueueSession {
|
|||
return next.createConsumer(destination, messageSelector);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param destination
|
||||
* @param messageSelector
|
||||
* @param noLocal
|
||||
* @return
|
||||
* @throws JMSException
|
||||
*/
|
||||
@Override
|
||||
public MessageConsumer createConsumer(Destination destination, String messageSelector, boolean noLocal) throws JMSException {
|
||||
if (destination instanceof Topic) {
|
||||
throw new InvalidDestinationException("Topics are not supported by a QueueSession");
|
||||
|
@ -138,66 +105,37 @@ public class ActiveMQQueueSession implements QueueSession {
|
|||
return next.createConsumer(destination, messageSelector, noLocal);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param topic
|
||||
* @param name
|
||||
* @return
|
||||
* @throws JMSException
|
||||
*/
|
||||
@Override
|
||||
public TopicSubscriber createDurableSubscriber(Topic topic, String name) throws JMSException {
|
||||
throw new IllegalStateException("Operation not supported by a QueueSession");
|
||||
}
|
||||
|
||||
/**
|
||||
* @param topic
|
||||
* @param name
|
||||
* @param messageSelector
|
||||
* @param noLocal
|
||||
* @return
|
||||
* @throws JMSException
|
||||
*/
|
||||
@Override
|
||||
public TopicSubscriber createDurableSubscriber(Topic topic, String name, String messageSelector, boolean noLocal) throws JMSException {
|
||||
throw new IllegalStateException("Operation not supported by a QueueSession");
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @throws JMSException
|
||||
*/
|
||||
@Override
|
||||
public MapMessage createMapMessage() throws JMSException {
|
||||
return next.createMapMessage();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @throws JMSException
|
||||
*/
|
||||
@Override
|
||||
public Message createMessage() throws JMSException {
|
||||
return next.createMessage();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @throws JMSException
|
||||
*/
|
||||
@Override
|
||||
public ObjectMessage createObjectMessage() throws JMSException {
|
||||
return next.createObjectMessage();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param object
|
||||
* @return
|
||||
* @throws JMSException
|
||||
*/
|
||||
@Override
|
||||
public ObjectMessage createObjectMessage(Serializable object) throws JMSException {
|
||||
return next.createObjectMessage(object);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param destination
|
||||
* @return
|
||||
* @throws JMSException
|
||||
*/
|
||||
@Override
|
||||
public MessageProducer createProducer(Destination destination) throws JMSException {
|
||||
if (destination instanceof Topic) {
|
||||
throw new InvalidDestinationException("Topics are not supported by a QueueSession");
|
||||
|
@ -205,98 +143,57 @@ public class ActiveMQQueueSession implements QueueSession {
|
|||
return next.createProducer(destination);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param queueName
|
||||
* @return
|
||||
* @throws JMSException
|
||||
*/
|
||||
@Override
|
||||
public Queue createQueue(String queueName) throws JMSException {
|
||||
return next.createQueue(queueName);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param queue
|
||||
* @return
|
||||
* @throws JMSException
|
||||
*/
|
||||
@Override
|
||||
public QueueReceiver createReceiver(Queue queue) throws JMSException {
|
||||
return next.createReceiver(queue);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param queue
|
||||
* @param messageSelector
|
||||
* @return
|
||||
* @throws JMSException
|
||||
*/
|
||||
@Override
|
||||
public QueueReceiver createReceiver(Queue queue, String messageSelector) throws JMSException {
|
||||
return next.createReceiver(queue, messageSelector);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param queue
|
||||
* @return
|
||||
* @throws JMSException
|
||||
*/
|
||||
@Override
|
||||
public QueueSender createSender(Queue queue) throws JMSException {
|
||||
return next.createSender(queue);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @throws JMSException
|
||||
*/
|
||||
@Override
|
||||
public StreamMessage createStreamMessage() throws JMSException {
|
||||
return next.createStreamMessage();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @throws JMSException
|
||||
*/
|
||||
@Override
|
||||
public TemporaryQueue createTemporaryQueue() throws JMSException {
|
||||
return next.createTemporaryQueue();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @throws JMSException
|
||||
*/
|
||||
@Override
|
||||
public TemporaryTopic createTemporaryTopic() throws JMSException {
|
||||
throw new IllegalStateException("Operation not supported by a QueueSession");
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @throws JMSException
|
||||
*/
|
||||
@Override
|
||||
public TextMessage createTextMessage() throws JMSException {
|
||||
return next.createTextMessage();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param text
|
||||
* @return
|
||||
* @throws JMSException
|
||||
*/
|
||||
@Override
|
||||
public TextMessage createTextMessage(String text) throws JMSException {
|
||||
return next.createTextMessage(text);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param topicName
|
||||
* @return
|
||||
* @throws JMSException
|
||||
*/
|
||||
@Override
|
||||
public Topic createTopic(String topicName) throws JMSException {
|
||||
throw new IllegalStateException("Operation not supported by a QueueSession");
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object arg0) {
|
||||
if(this != arg0) {
|
||||
return next.equals(arg0);
|
||||
|
@ -305,81 +202,52 @@ public class ActiveMQQueueSession implements QueueSession {
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @throws JMSException
|
||||
*/
|
||||
@Override
|
||||
public int getAcknowledgeMode() throws JMSException {
|
||||
return next.getAcknowledgeMode();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @throws JMSException
|
||||
*/
|
||||
@Override
|
||||
public MessageListener getMessageListener() throws JMSException {
|
||||
return next.getMessageListener();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @throws JMSException
|
||||
*/
|
||||
@Override
|
||||
public boolean getTransacted() throws JMSException {
|
||||
return next.getTransacted();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return next.hashCode();
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws JMSException
|
||||
*/
|
||||
@Override
|
||||
public void recover() throws JMSException {
|
||||
next.recover();
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws JMSException
|
||||
*/
|
||||
@Override
|
||||
public void rollback() throws JMSException {
|
||||
next.rollback();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
public void run() {
|
||||
next.run();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param listener
|
||||
* @throws JMSException
|
||||
*/
|
||||
@Override
|
||||
public void setMessageListener(MessageListener listener) throws JMSException {
|
||||
next.setMessageListener(listener);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return next.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param name
|
||||
* @throws JMSException
|
||||
*/
|
||||
@Override
|
||||
public void unsubscribe(String name) throws JMSException {
|
||||
throw new IllegalStateException("Operation not supported by a QueueSession");
|
||||
}
|
||||
|
@ -387,5 +255,4 @@ public class ActiveMQQueueSession implements QueueSession {
|
|||
public QueueSession getNext() {
|
||||
return next;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1552,7 +1552,7 @@ public class ActiveMQSession implements Session, QueueSession, TopicSession, Sta
|
|||
* the specified queue.
|
||||
*
|
||||
* @param queue the <CODE>Queue</CODE> to access
|
||||
* @return
|
||||
* @return a new QueueBrowser instance.
|
||||
* @throws JMSException if the session fails to create a receiver due to
|
||||
* some internal error.
|
||||
* @throws JMSException
|
||||
|
@ -1874,14 +1874,14 @@ public class ActiveMQSession implements Session, QueueSession, TopicSession, Sta
|
|||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @return a unique ConsumerId instance.
|
||||
*/
|
||||
protected ConsumerId getNextConsumerId() {
|
||||
return new ConsumerId(info.getSessionId(), consumerIdGenerator.getNextSequenceId());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @return a unique ProducerId instance.
|
||||
*/
|
||||
protected ProducerId getNextProducerId() {
|
||||
return new ProducerId(info.getSessionId(), producerIdGenerator.getNextSequenceId());
|
||||
|
@ -1890,11 +1890,10 @@ public class ActiveMQSession implements Session, QueueSession, TopicSession, Sta
|
|||
/**
|
||||
* Sends the message for dispatch by the broker.
|
||||
*
|
||||
*
|
||||
* @param producer - message producer.
|
||||
* @param destination - message destination.
|
||||
* @param message - message to be sent.
|
||||
* @param deliveryMode - JMS messsage delivery mode.
|
||||
* @param deliveryMode - JMS message delivery mode.
|
||||
* @param priority - message priority.
|
||||
* @param timeToLive - message expiration.
|
||||
* @param producerWindow
|
||||
|
@ -2066,7 +2065,7 @@ public class ActiveMQSession implements Session, QueueSession, TopicSession, Sta
|
|||
}
|
||||
|
||||
/**
|
||||
* Send the asynchronus command.
|
||||
* Send the asynchronous command.
|
||||
*
|
||||
* @param command - command to be executed.
|
||||
* @throws JMSException
|
||||
|
@ -2076,7 +2075,7 @@ public class ActiveMQSession implements Session, QueueSession, TopicSession, Sta
|
|||
}
|
||||
|
||||
/**
|
||||
* Send the synchronus command.
|
||||
* Send the synchronous command.
|
||||
*
|
||||
* @param command - command to be executed.
|
||||
* @return Response
|
||||
|
|
|
@ -39,12 +39,10 @@ import org.apache.activemq.command.ActiveMQTopic;
|
|||
|
||||
/**
|
||||
* A factory of the ActiveMQ InitialContext which contains
|
||||
* {@link ConnectionFactory} instances as well as a child context called
|
||||
* {@link javax.jms.ConnectionFactory} instances as well as a child context called
|
||||
* <i>destinations</i> which contain all of the current active destinations, in
|
||||
* child context depending on the QoS such as transient or durable and queue or
|
||||
* topic.
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class ActiveMQInitialContextFactory implements InitialContextFactory {
|
||||
|
||||
|
@ -54,6 +52,7 @@ public class ActiveMQInitialContextFactory implements InitialContextFactory {
|
|||
private String queuePrefix = "queue.";
|
||||
private String topicPrefix = "topic.";
|
||||
|
||||
@Override
|
||||
public Context getInitialContext(Hashtable environment) throws NamingException {
|
||||
// lets create a factory
|
||||
Map<String, Object> data = new ConcurrentHashMap<String, Object>();
|
||||
|
@ -85,6 +84,7 @@ public class ActiveMQInitialContextFactory implements InitialContextFactory {
|
|||
data.put("dynamicQueues", new LazyCreateContext() {
|
||||
private static final long serialVersionUID = 6503881346214855588L;
|
||||
|
||||
@Override
|
||||
protected Object createEntry(String name) {
|
||||
return new ActiveMQQueue(name);
|
||||
}
|
||||
|
@ -92,6 +92,7 @@ public class ActiveMQInitialContextFactory implements InitialContextFactory {
|
|||
data.put("dynamicTopics", new LazyCreateContext() {
|
||||
private static final long serialVersionUID = 2019166796234979615L;
|
||||
|
||||
@Override
|
||||
protected Object createEntry(String name) {
|
||||
return new ActiveMQTopic(name);
|
||||
}
|
||||
|
@ -224,5 +225,4 @@ public class ActiveMQInitialContextFactory implements InitialContextFactory {
|
|||
public void setConnectionPrefix(String connectionPrefix) {
|
||||
this.connectionPrefix = connectionPrefix;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -21,9 +21,8 @@ import java.util.Properties;
|
|||
import javax.naming.Referenceable;
|
||||
|
||||
/**
|
||||
* Faciliates objects to be stored in JNDI as properties
|
||||
* Facilitates objects to be stored in JNDI as properties
|
||||
*/
|
||||
|
||||
public interface JNDIStorableInterface extends Referenceable {
|
||||
|
||||
/**
|
||||
|
@ -31,15 +30,13 @@ public interface JNDIStorableInterface extends Referenceable {
|
|||
*
|
||||
* @param properties
|
||||
*/
|
||||
|
||||
void setProperties(Properties properties);
|
||||
|
||||
/**
|
||||
* Get the properties from this instance for storing in JNDI
|
||||
*
|
||||
* @return
|
||||
* @return the properties that should be stored in JNDI
|
||||
*/
|
||||
|
||||
Properties getProperties();
|
||||
|
||||
}
|
||||
|
|
|
@ -69,7 +69,8 @@ public interface TransportServer extends Service {
|
|||
/**
|
||||
* Some protocols allow link stealing by default (if 2 connections have the same clientID - the youngest wins).
|
||||
* This is the default for AMQP and MQTT. However, JMS 1.1 spec requires the opposite
|
||||
* @return
|
||||
*
|
||||
* @return true if allow link stealing is enabled.
|
||||
*/
|
||||
boolean isAllowLinkStealing();
|
||||
}
|
||||
|
|
|
@ -17,12 +17,10 @@
|
|||
package org.apache.activemq.transport.tcp;
|
||||
|
||||
/**
|
||||
* Thrown to indicate that the {@link TcpTransportServer#maximumConnections}
|
||||
* property has been exceeded.
|
||||
*
|
||||
* @see {@link TcpTransportServer#maximumConnections}
|
||||
* @author bsnyder
|
||||
* Thrown to indicate that the {@link TcpTransportServer#maximumConnections}
|
||||
* property has been exceeded.
|
||||
*
|
||||
* @see TcpTransportServer#maximumConnections
|
||||
*/
|
||||
public class ExceededMaximumConnectionsException extends Exception {
|
||||
|
||||
|
@ -34,5 +32,4 @@ public class ExceededMaximumConnectionsException extends Exception {
|
|||
public ExceededMaximumConnectionsException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,10 +19,8 @@ package org.apache.activemq.transport.udp;
|
|||
import java.nio.ByteBuffer;
|
||||
|
||||
/**
|
||||
* A simple implementation of {@link BufferPool} which does no pooling and just
|
||||
* A simple implementation of {@link ByteBufferPool} which does no pooling and just
|
||||
* creates new buffers each time
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class SimpleBufferPool implements ByteBufferPool {
|
||||
|
||||
|
@ -37,13 +35,16 @@ public class SimpleBufferPool implements ByteBufferPool {
|
|||
this.useDirect = useDirect;
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized ByteBuffer borrowBuffer() {
|
||||
return createBuffer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void returnBuffer(ByteBuffer buffer) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDefaultSize(int defaultSize) {
|
||||
this.defaultSize = defaultSize;
|
||||
}
|
||||
|
@ -59,9 +60,11 @@ public class SimpleBufferPool implements ByteBufferPool {
|
|||
this.useDirect = useDirect;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start() throws Exception {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop() throws Exception {
|
||||
}
|
||||
|
||||
|
@ -72,5 +75,4 @@ public class SimpleBufferPool implements ByteBufferPool {
|
|||
return ByteBuffer.allocate(defaultSize);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -17,12 +17,8 @@
|
|||
package org.apache.activemq.util;
|
||||
|
||||
/**
|
||||
* A simple callback object used by the
|
||||
* {@link org.apache.activemq.util.TransactionTemplate}
|
||||
* and {@link org.apache.activemq.util.ExceptionTemplate}
|
||||
objects to provide automatic transactional or exception handling blocks.
|
||||
*
|
||||
*
|
||||
* A simple callback object used by objects to provide automatic
|
||||
* transactional or exception handling blocks.
|
||||
*/
|
||||
public interface Callback {
|
||||
|
||||
|
@ -30,6 +26,7 @@ public interface Callback {
|
|||
* Executes some piece of code within a transaction
|
||||
* performing a commit if there is no exception thrown
|
||||
* else a rollback is performed
|
||||
*
|
||||
* @throws Exception TODO
|
||||
*/
|
||||
void execute() throws Exception;
|
||||
|
|
|
@ -20,8 +20,6 @@ package org.apache.activemq.util;
|
|||
* A very simple stop watch.
|
||||
* <p/>
|
||||
* This implementation is not thread safe and can only time one task at any given time.
|
||||
*
|
||||
* @version
|
||||
*/
|
||||
public final class StopWatch {
|
||||
|
||||
|
@ -57,7 +55,7 @@ public final class StopWatch {
|
|||
/**
|
||||
* Stops the stop watch
|
||||
*
|
||||
* @return the time taken in millis.
|
||||
* @return the time taken in milliseconds.
|
||||
*/
|
||||
public long stop() {
|
||||
stop = System.currentTimeMillis();
|
||||
|
@ -65,9 +63,9 @@ public final class StopWatch {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the time taken in millis.
|
||||
* Returns the time taken in milliseconds.
|
||||
*
|
||||
* @return time in millis
|
||||
* @return time in milliseconds
|
||||
*/
|
||||
public long taken() {
|
||||
if (start > 0 && stop > 0) {
|
||||
|
|
|
@ -22,9 +22,7 @@ import java.text.NumberFormat;
|
|||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* Time utils.
|
||||
*
|
||||
* @version
|
||||
* Time utilities.
|
||||
*/
|
||||
public final class TimeUtils {
|
||||
|
||||
|
@ -34,7 +32,8 @@ public final class TimeUtils {
|
|||
/**
|
||||
* Prints the duration in a human readable format as X days Y hours Z minutes etc.
|
||||
*
|
||||
* @param uptime the uptime in millis
|
||||
* @param uptime the up-time in milliseconds
|
||||
*
|
||||
* @return the time used for displaying on screen or in logs
|
||||
*/
|
||||
public static String printDuration(double uptime) {
|
||||
|
@ -71,7 +70,7 @@ public final class TimeUtils {
|
|||
if (hours != 0) {
|
||||
s += " " + fmtI.format(hours) + (hours > 1 ? " hours" : " hour");
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue