JBoss hornetq SVN: r12011 - trunk.
by do-not-reply@jboss.org
Author: borges
Date: 2012-01-12 07:07:32 -0500 (Thu, 12 Jan 2012)
New Revision: 12011
Modified:
trunk/.gitignore
Log:
Update .gitignore
Modified: trunk/.gitignore
===================================================================
--- trunk/.gitignore 2012-01-12 12:07:21 UTC (rev 12010)
+++ trunk/.gitignore 2012-01-12 12:07:32 UTC (rev 12011)
@@ -1,3 +1,4 @@
+*~
target
tests/jms-tests/data
org.eclipse.jdt.core.prefs
@@ -638,37 +639,6 @@
# /examples/soak/tx-restarts/
/examples/soak/tx-restarts/build
-# /hornetq-bootstrap/
-/hornetq-bootstrap/target
-/hornetq-bootstrap/.project
-
-# /hornetq-core/
-/hornetq-core/target
-/hornetq-core/.project
-
-# /hornetq-core-client/
-/hornetq-core-client/target
-/hornetq-core-client/.project
-
-# /hornetq-jboss-as-integration/
-/hornetq-jboss-as-integration/target
-/hornetq-jboss-as-integration/.project
-
-# /hornetq-jms/
-/hornetq-jms/target
-/hornetq-jms/.project
-
-# /hornetq-jms-client/
-/hornetq-jms-client/target
-/hornetq-jms-client/.project
-
-# /hornetq-logging/
-/hornetq-logging/target
-/hornetq-logging/.project
-
-# /hornetq-ra/
-/hornetq-ra/.project
-
# /hornetq-ra/hornetq-ra-jar/
/hornetq-ra/hornetq-ra-jar/target
/hornetq-ra/hornetq-ra-jar/.project
@@ -677,9 +647,6 @@
/hornetq-ra/hornetq-ra-rar/target
/hornetq-ra/hornetq-ra-rar/.project
-# /hornetq-rest/
-/hornetq-rest/.project
-
# /hornetq-rest/docbook/
/hornetq-rest/docbook/target
@@ -687,26 +654,14 @@
/hornetq-rest/hornetq-rest/target
/hornetq-rest/hornetq-rest/.project
-# /hornetq-service-sar/
-/hornetq-service-sar/target
-/hornetq-service-sar/.project
+# /hornetq-rest/
+/hornetq-*/.project
+/hornetq-*/target
-# /hornetq-spring-integration/
-/hornetq-spring-integration/target
-/hornetq-spring-integration/.project
-
-# /hornetq-twitter-integration/
-/hornetq-twitter-integration/target
-/hornetq-twitter-integration/.project
-/tests/concurrent-tests/.project
-/tests/integration-tests/.project
-/tests/jms-tests/.project
-/tests/joram-tests/.project
-/tests/performance-tests/.project
/tests/.project
-/tests/soak-tests/.project
-/tests/stress-tests/.project
-/tests/timing-tests/.project
-/tests/unit-tests/.project
+/tests/*-tests/.project
+
/docs/rest-manual/.project
/docs/quickstart-guide/.project
+
+native/autom4te.cache
12 years, 11 months
JBoss hornetq SVN: r12010 - trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/jms.
by do-not-reply@jboss.org
Author: borges
Date: 2012-01-12 07:07:21 -0500 (Thu, 12 Jan 2012)
New Revision: 12010
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/jms/HornetQConnectionFactoryTest.java
Log:
Silence test, and only catch JMSException
Modified: trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/jms/HornetQConnectionFactoryTest.java
===================================================================
--- trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/jms/HornetQConnectionFactoryTest.java 2012-01-11 22:42:54 UTC (rev 12009)
+++ trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/jms/HornetQConnectionFactoryTest.java 2012-01-12 12:07:21 UTC (rev 12010)
@@ -19,6 +19,7 @@
import java.util.Map;
import javax.jms.Connection;
+import javax.jms.JMSException;
import javax.jms.Session;
import junit.framework.Assert;
@@ -30,7 +31,6 @@
import org.hornetq.api.jms.JMSFactoryType;
import org.hornetq.core.config.BroadcastGroupConfiguration;
import org.hornetq.core.config.Configuration;
-import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.HornetQServers;
@@ -39,7 +39,7 @@
import org.hornetq.tests.util.UnitTestCase;
/**
- *
+ *
* A HornetQConnectionFactoryTest
*
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
@@ -60,7 +60,7 @@
public void testDefaultConstructor() throws Exception
{
- HornetQConnectionFactory cf = (HornetQConnectionFactory) HornetQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF);
+ HornetQConnectionFactory cf = HornetQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF);
assertFactoryParams(cf,
null,
null,
@@ -98,9 +98,8 @@
Assert.fail("Should throw exception");
}
- catch (Exception e)
+ catch (JMSException e)
{
- e.printStackTrace();
// Ok
}
if (conn != null)
@@ -115,7 +114,7 @@
public void testDefaultConstructorAndSetConnectorPairs() throws Exception
{
- HornetQConnectionFactory cf = (HornetQConnectionFactory) HornetQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, liveTC);
+ HornetQConnectionFactory cf = HornetQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, liveTC);
assertFactoryParams(cf,
new TransportConfiguration[]{liveTC},
@@ -157,7 +156,7 @@
public void testDiscoveryConstructor() throws Exception
{
DiscoveryGroupConfiguration groupConfiguration = new DiscoveryGroupConfiguration(groupAddress, groupPort);
- HornetQConnectionFactory cf = (HornetQConnectionFactory) HornetQJMSClient.createConnectionFactoryWithoutHA(groupConfiguration, JMSFactoryType.CF);
+ HornetQConnectionFactory cf = HornetQJMSClient.createConnectionFactoryWithoutHA(groupConfiguration, JMSFactoryType.CF);
assertFactoryParams(cf,
null,
groupConfiguration,
@@ -196,7 +195,7 @@
public void testStaticConnectorListConstructor() throws Exception
{
- HornetQConnectionFactory cf = (HornetQConnectionFactory) HornetQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, liveTC);
+ HornetQConnectionFactory cf = HornetQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, liveTC);
assertFactoryParams(cf,
new TransportConfiguration[]{liveTC},
null,
@@ -236,7 +235,7 @@
public void testStaticConnectorLiveConstructor() throws Exception
{
- HornetQConnectionFactory cf = (HornetQConnectionFactory) HornetQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, liveTC);
+ HornetQConnectionFactory cf = HornetQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, liveTC);
assertFactoryParams(cf,
new TransportConfiguration[]{liveTC},
null,
@@ -278,7 +277,7 @@
public void testGettersAndSetters()
{
- HornetQConnectionFactory cf = (HornetQConnectionFactory) HornetQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, liveTC);
+ HornetQConnectionFactory cf = HornetQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, liveTC);
long clientFailureCheckPeriod = RandomUtil.randomPositiveLong();
long connectionTTL = RandomUtil.randomPositiveLong();
12 years, 11 months
JBoss hornetq SVN: r12009 - in branches/Branch_2_2_EAP/src/main/org/hornetq: core/protocol/stomp and 2 other directories.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2012-01-11 17:42:54 -0500 (Wed, 11 Jan 2012)
New Revision: 12009
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/core/impl/RemotingConnectionImpl.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/stomp/StompConnection.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java
branches/Branch_2_2_EAP/src/main/org/hornetq/spi/core/protocol/RemotingConnection.java
Log:
https://issues.jboss.org/browse/JBPAPP-7205 - fixing test on shutdown server after critical IO failure
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/core/impl/RemotingConnectionImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/core/impl/RemotingConnectionImpl.java 2012-01-11 21:25:18 UTC (rev 12008)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/core/impl/RemotingConnectionImpl.java 2012-01-11 22:42:54 UTC (rev 12009)
@@ -361,7 +361,7 @@
callClosingListeners();
}
- public void disconnect()
+ public void disconnect(final boolean criticalError)
{
Channel channel0 = getChannel(0, -1);
@@ -371,13 +371,23 @@
Set<Channel> allChannels = new HashSet<Channel>(channels.values());
- removeAllChannels();
+ if (!criticalError)
+ {
+ removeAllChannels();
+ }
+ else
+ {
+ channels.clear();
+ }
// Now we are 100% sure that no more packets will be processed we can flush then send the disconnect
- for (Channel channel: allChannels)
+ if (!criticalError)
{
- channel.flushConfirmations();
+ for (Channel channel: allChannels)
+ {
+ channel.flushConfirmations();
+ }
}
Packet disconnect = new DisconnectMessage(nodeID);
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/stomp/StompConnection.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/stomp/StompConnection.java 2012-01-11 21:25:18 UTC (rev 12008)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/stomp/StompConnection.java 2012-01-11 22:42:54 UTC (rev 12009)
@@ -209,7 +209,7 @@
manager.cleanup(this);
}
- public void disconnect()
+ public void disconnect(final boolean criticalError)
{
}
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java 2012-01-11 21:25:18 UTC (rev 12008)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java 2012-01-11 22:42:54 UTC (rev 12009)
@@ -306,7 +306,7 @@
log.trace("Sending connection.disconnection packet to " + conn);
}
- conn.disconnect();
+ conn.disconnect(criticalError);
}
for (Acceptor acceptor : acceptors)
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/spi/core/protocol/RemotingConnection.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/spi/core/protocol/RemotingConnection.java 2012-01-11 21:25:18 UTC (rev 12008)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/spi/core/protocol/RemotingConnection.java 2012-01-11 22:42:54 UTC (rev 12009)
@@ -151,7 +151,7 @@
/**
* Disconnect the connection, closing all channels
*/
- void disconnect();
+ void disconnect(boolean criticalError);
/**
* returns true if any data has been received since the last time this method was called.
12 years, 11 months
JBoss hornetq SVN: r12008 - in branches/Branch_2_2_AS7: src/main/org/hornetq/core/client/impl and 7 other directories.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2012-01-11 16:25:18 -0500 (Wed, 11 Jan 2012)
New Revision: 12008
Modified:
branches/Branch_2_2_AS7/src/main/org/hornetq/api/core/SimpleString.java
branches/Branch_2_2_AS7/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java
branches/Branch_2_2_AS7/src/main/org/hornetq/core/remoting/server/RemotingService.java
branches/Branch_2_2_AS7/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java
branches/Branch_2_2_AS7/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
branches/Branch_2_2_AS7/src/main/org/hornetq/core/server/impl/QueueImpl.java
branches/Branch_2_2_AS7/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java
branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/ConsumerWindowSizeTest.java
branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/ExpiryLargeMessageTest.java
branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/PagingTest.java
branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/clientcrash/ClientTestBase.java
branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/management/QueueControlTest.java
branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/unit/util/LinkedListTest.java
branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/unit/util/SimpleStringTest.java
Log:
merging changes from EAP
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/api/core/SimpleString.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/api/core/SimpleString.java 2012-01-11 15:24:12 UTC (rev 12007)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/api/core/SimpleString.java 2012-01-11 21:25:18 UTC (rev 12008)
@@ -25,7 +25,7 @@
* this minimises expensive copying between String objects.
*
* This object is used heavily throughout HornetQ for performance reasons.
- *
+ *
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
*
*/
@@ -116,7 +116,7 @@
}
pos <<= 1;
- return (char)(data[pos] | data[pos + 1] << 8);
+ return (char)((data[pos] & 0xFF) | (data[pos + 1] << 8) & 0xFF00);
}
public CharSequence subSequence(final int start, final int end)
@@ -215,7 +215,7 @@
{
return true;
}
-
+
if (other instanceof SimpleString)
{
SimpleString s = (SimpleString)other;
@@ -258,9 +258,8 @@
}
/**
- * splits this SimpleString into an array of SimpleString using the char param as the delimeter.
- *
- * i.e. "a.b" would return "a" and "b" if . was the delimeter
+ * Splits this SimpleString into an array of SimpleString using the char param as the delimiter.
+ * i.e. "a.b" would return "a" and "b" if . was the delimiter
* @param delim
*/
public SimpleString[] split(final char delim)
@@ -272,11 +271,13 @@
else
{
List<SimpleString> all = new ArrayList<SimpleString>();
+
+ byte low = (byte)(delim & 0xFF); // low byte
+ byte high = (byte)(delim >> 8 & 0xFF); // high byte
+
int lasPos = 0;
for (int i = 0; i < data.length; i += 2)
{
- byte low = (byte)(delim & 0xFF); // low byte
- byte high = (byte)(delim >> 8 & 0xFF); // high byte
if (data[i] == low && data[i + 1] == high)
{
byte[] bytes = new byte[i - lasPos];
@@ -301,10 +302,11 @@
*/
public boolean contains(final char c)
{
+ final byte low = (byte)(c & 0xFF); // low byte
+ final byte high = (byte)(c >> 8 & 0xFF); // high byte
+
for (int i = 0; i < data.length; i += 2)
{
- byte low = (byte)(c & 0xFF); // low byte
- byte high = (byte)(c >> 8 & 0xFF); // high byte
if (data[i] == low && data[i + 1] == high)
{
return true;
@@ -314,10 +316,9 @@
}
/**
- * concatanates a SimpleString and a String
- *
- * @param toAdd the String to concate with.
- * @return the concatanated SimpleString
+ * Concatenates a SimpleString and a String
+ * @param toAdd the String to concatenate with.
+ * @return the concatenated SimpleString
*/
public SimpleString concat(final String toAdd)
{
@@ -325,10 +326,9 @@
}
/**
- * concatanates 2 SimpleString's
- *
- * @param toAdd the SimpleString to concate with.
- * @return the concatanated SimpleString
+ * Concatenates 2 SimpleString's
+ * @param toAdd the SimpleString to concatenate with.
+ * @return the concatenated SimpleString
*/
public SimpleString concat(final SimpleString toAdd)
{
@@ -339,10 +339,9 @@
}
/**
- * concatanates a SimpleString and a char
- *
+ * Concatenates a SimpleString and a char
* @param c the char to concate with.
- * @return the concatanated SimpleString
+ * @return the concatenated SimpleString
*/
public SimpleString concat(final char c)
{
@@ -390,7 +389,7 @@
}
/**
- *
+ *
* @param srcBegin
* @param srcEnd
* @param dst
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java 2012-01-11 15:24:12 UTC (rev 12007)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java 2012-01-11 21:25:18 UTC (rev 12008)
@@ -1146,8 +1146,15 @@
}
}
+ HashMap<String, String> metaDataToSend;
+
+ synchronized (metadata)
+ {
+ metaDataToSend = new HashMap<String, String>(metadata);
+ }
+
// Resetting the metadata after failover
- for (Map.Entry<String, String> entries : metadata.entrySet())
+ for (Map.Entry<String, String> entries : metaDataToSend.entrySet())
{
sendPacketWithoutLock(new SessionAddMetaDataMessageV2(entries.getKey(), entries.getValue(), false));
}
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/remoting/server/RemotingService.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/remoting/server/RemotingService.java 2012-01-11 15:24:12 UTC (rev 12007)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/remoting/server/RemotingService.java 2012-01-11 21:25:18 UTC (rev 12008)
@@ -16,7 +16,6 @@
import java.util.Set;
import org.hornetq.api.core.Interceptor;
-import org.hornetq.core.server.HornetQComponent;
import org.hornetq.spi.core.protocol.RemotingConnection;
/**
@@ -25,7 +24,7 @@
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
* @version <tt>$Revision$</tt>
*/
-public interface RemotingService extends HornetQComponent
+public interface RemotingService
{
/**
* Remove a connection from the connections held by the remoting service.
@@ -41,7 +40,13 @@
void addInterceptor(Interceptor interceptor);
boolean removeInterceptor(Interceptor interceptor);
+
+ void stop(boolean criticalError) throws Exception;
+
+ void start() throws Exception;
+ boolean isStarted();
+
void freeze();
RemotingConnection getServerSideReplicatingConnection();
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java 2012-01-11 15:24:12 UTC (rev 12007)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java 2012-01-11 21:25:18 UTC (rev 12008)
@@ -263,7 +263,7 @@
}
}
- public void stop() throws Exception
+ public void stop(final boolean criticalError) throws Exception
{
if (!started)
{
@@ -275,7 +275,7 @@
return;
}
- failureCheckAndFlushThread.close();
+ failureCheckAndFlushThread.close(criticalError);
// We need to stop them accepting first so no new connections are accepted after we send the disconnect message
for (Acceptor acceptor : acceptors)
@@ -292,9 +292,13 @@
log.debug("Sending disconnect on live connections");
}
+ HashSet<ConnectionEntry> connectionEntries = new HashSet<ConnectionEntry>();
+
+ connectionEntries.addAll(connections.values());
+
// Now we ensure that no connections will process any more packets after this method is complete
// then send a disconnect packet
- for (ConnectionEntry entry : connections.values())
+ for (ConnectionEntry entry : connectionEntries)
{
RemotingConnection conn = entry.connection;
@@ -321,12 +325,15 @@
}
threadPool.shutdown();
-
- boolean ok = threadPool.awaitTermination(10000, TimeUnit.MILLISECONDS);
-
- if (!ok)
+
+ if (!criticalError)
{
- log.warn("Timed out waiting for remoting thread pool to terminate");
+ boolean ok = threadPool.awaitTermination(10000, TimeUnit.MILLISECONDS);
+
+ if (!ok)
+ {
+ log.warn("Timed out waiting for remoting thread pool to terminate");
+ }
}
started = false;
@@ -535,7 +542,7 @@
this.pauseInterval = pauseInterval;
}
- public void close()
+ public void close(final boolean criticalError)
{
closed = true;
@@ -544,13 +551,16 @@
notify();
}
- try
+ if (!criticalError)
{
- join();
+ try
+ {
+ join();
+ }
+ catch (InterruptedException ignore)
+ {
+ }
}
- catch (InterruptedException ignore)
- {
- }
}
@Override
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java 2012-01-11 15:24:12 UTC (rev 12007)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java 2012-01-11 21:25:18 UTC (rev 12008)
@@ -493,7 +493,7 @@
}
- remotingService.stop();
+ remotingService.stop(criticalIOError);
// We close all the exception in an attempt to let any pending IO to finish
// to avoid scenarios where the send or ACK got to disk but the response didn't get to the client
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/server/impl/QueueImpl.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/server/impl/QueueImpl.java 2012-01-11 15:24:12 UTC (rev 12007)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/server/impl/QueueImpl.java 2012-01-11 21:25:18 UTC (rev 12008)
@@ -1222,6 +1222,7 @@
try
{
+ boolean expired = false;
while (iter.hasNext())
{
MessageReference ref = iter.next();
@@ -1230,6 +1231,7 @@
if (ref.getMessage().isExpired())
{
deliveringCount.incrementAndGet();
+ expired = true;
expire(ref);
iter.remove();
refRemoved(ref);
@@ -1240,6 +1242,11 @@
log.warn("Error expiring reference " + ref, e);
}
}
+
+ if (expired && pageIterator != null && pageIterator.hasNext())
+ {
+ scheduleDepage();
+ }
}
finally
{
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java 2012-01-11 15:24:12 UTC (rev 12007)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java 2012-01-11 21:25:18 UTC (rev 12008)
@@ -1105,12 +1105,17 @@
public void send(final ServerMessage message, final boolean direct) throws Exception
{
long id = storageManager.generateUniqueID();
-
+
SimpleString address = message.getAddress();
message.setMessageID(id);
message.encodeMessageIDToBuffer();
+ if (defaultAddress == null && address != null)
+ {
+ defaultAddress = address;
+ }
+
if (address == null)
{
if (message.isDurable())
@@ -1131,6 +1136,12 @@
log.trace("send(message=" + message + ", direct=" + direct + ") being called");
}
+ if (message.getAddress() == null)
+ {
+ // This could happen with some tests that are ignoring messages
+ throw new HornetQException(HornetQException.ILLEGAL_STATE, "You don't have an address at the Server's Session");
+ }
+
if (message.getAddress().equals(managementAddress))
{
// It's a management message
@@ -1141,11 +1152,6 @@
{
doSend(message, direct);
}
-
- if (defaultAddress == null)
- {
- defaultAddress = address;
- }
}
public void sendContinuations(final int packetSize,
Modified: branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/ConsumerWindowSizeTest.java
===================================================================
--- branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/ConsumerWindowSizeTest.java 2012-01-11 15:24:12 UTC (rev 12007)
+++ branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/ConsumerWindowSizeTest.java 2012-01-11 21:25:18 UTC (rev 12008)
@@ -303,7 +303,7 @@
consumers.add(consumer);
session1.start();
sessions.add(session1);
- consumer.receive(10);
+ assertNull(consumer.receive(10));
}
@@ -321,7 +321,7 @@
senderSession.start();
ClientConsumer consumer = consumers.get(2);
- ClientMessage received = consumer.receiveImmediate();
+ ClientMessage received = consumer.receive(5000);
assertNotNull(received);
for (ClientSession tmpSess : sessions)
Modified: branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/ExpiryLargeMessageTest.java
===================================================================
--- branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/ExpiryLargeMessageTest.java 2012-01-11 15:24:12 UTC (rev 12007)
+++ branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/ExpiryLargeMessageTest.java 2012-01-11 21:25:18 UTC (rev 12008)
@@ -23,7 +23,9 @@
import org.hornetq.api.core.client.ClientSession;
import org.hornetq.api.core.client.ClientSessionFactory;
import org.hornetq.api.core.client.ServerLocator;
+import org.hornetq.core.logging.Logger;
import org.hornetq.core.server.HornetQServer;
+import org.hornetq.core.server.Queue;
import org.hornetq.core.settings.impl.AddressFullMessagePolicy;
import org.hornetq.core.settings.impl.AddressSettings;
import org.hornetq.tests.util.ServiceTestBase;
@@ -38,6 +40,8 @@
public class ExpiryLargeMessageTest extends ServiceTestBase
{
+ private static final Logger log = Logger.getLogger(ExpiryLargeMessageTest.class);
+
// Constants -----------------------------------------------------
final SimpleString EXPIRY = new SimpleString("my-expiry");
@@ -129,25 +133,32 @@
producer.send(message);
}
+
+ session.close();
server.stop();
server.start();
+
+ Queue queueExpiry = server.locateQueue(EXPIRY);
+ Queue myQueue = server.locateQueue(MY_QUEUE);
sf = locator.createSessionFactory();
-
- session = sf.createSession(true, true, 0);
-
+
Thread.sleep(1500);
- // just to try expiring
- ClientConsumer cons = session.createConsumer(MY_QUEUE);
- assertNull(cons.receive(1000));
+ long timeout = System.currentTimeMillis() + 5000;
+ while (timeout > System.currentTimeMillis() && queueExpiry.getMessageCount() != numberOfMessages)
+ {
+ // What the Expiry Scan would be doing
+ myQueue.expireReferences();
+ Thread.sleep(50);
+ }
+
+ assertEquals(50, queueExpiry.getMessageCount());
- session.close();
-
session = sf.createSession(false, false);
- cons = session.createConsumer(EXPIRY);
+ ClientConsumer cons = session.createConsumer(EXPIRY);
session.start();
// Consume half of the messages to make sure all the messages are paging (on the second try)
@@ -167,7 +178,7 @@
cons = session.createConsumer(EXPIRY);
session.start();
- System.out.println("Trying " + rep);
+ log.info("Trying " + rep);
for (int i = 0; i < numberOfMessages / 2; i++)
{
ClientMessage message = cons.receive(5000);
Modified: branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/PagingTest.java
===================================================================
--- branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/PagingTest.java 2012-01-11 15:24:12 UTC (rev 12007)
+++ branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/PagingTest.java 2012-01-11 21:25:18 UTC (rev 12008)
@@ -4350,26 +4350,7 @@
session.start();
- // ClientConsumer consumer = session.createConsumer(PagingTest.ADDRESS.concat("=1"));
- //
- // for (int i = 0; i < numberOfMessages; i++)
- // {
- // message = consumer.receive(500000);
- // assertNotNull(message);
- // message.acknowledge();
- //
- // // assertEquals(msg, message.getIntProperty("propTest").intValue());
- //
- // System.out.println("i = " + i + " msg = " + message.getIntProperty("propTest"));
- // }
- //
- // session.commit();
-
- // consumer.close();
-
session.deleteQueue(PagingTest.ADDRESS.concat("=1"));
- // server.stop();
- // server.start();
sf = locator.createSessionFactory();
@@ -4385,8 +4366,6 @@
assertNotNull(message);
message.acknowledge();
- // assertEquals(msg, message.getIntProperty("propTest").intValue());
-
System.out.println("i = " + i + " msg = " + message.getIntProperty("propTest"));
}
@@ -4395,8 +4374,17 @@
assertNull(consumer.receiveImmediate());
consumer.close();
+
+ long timeout = System.currentTimeMillis() + 10000;
+
+ PagingStore store = server.getPagingManager().getPageStore(ADDRESS);
// It's async, so need to wait a bit for it happening
+ while (timeout > System.currentTimeMillis() && store.isPaging())
+ {
+ Thread.sleep(100);
+ }
+
assertFalse(server.getPagingManager().getPageStore(ADDRESS).isPaging());
server.stop();
Modified: branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/clientcrash/ClientTestBase.java
===================================================================
--- branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/clientcrash/ClientTestBase.java 2012-01-11 15:24:12 UTC (rev 12007)
+++ branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/clientcrash/ClientTestBase.java 2012-01-11 21:25:18 UTC (rev 12008)
@@ -68,11 +68,21 @@
protected void assertActiveConnections(final int expectedActiveConnections) throws Exception
{
+ long timeout = System.currentTimeMillis() + 5000;
+ while (timeout > System.currentTimeMillis() && server.getHornetQServerControl().getConnectionCount() != expectedActiveConnections)
+ {
+ Thread.sleep(100);
+ }
Assert.assertEquals(expectedActiveConnections, server.getHornetQServerControl().getConnectionCount());
}
protected void assertActiveSession(final int expectedActiveSession) throws Exception
{
+ long timeout = System.currentTimeMillis() + 5000;
+ while (timeout > System.currentTimeMillis() && server.getSessions().size() != expectedActiveSession)
+ {
+ Thread.sleep(100);
+ }
Assert.assertEquals(expectedActiveSession, server.getSessions().size());
}
Modified: branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/management/QueueControlTest.java
===================================================================
--- branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/management/QueueControlTest.java 2012-01-11 15:24:12 UTC (rev 12007)
+++ branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/management/QueueControlTest.java 2012-01-11 21:25:18 UTC (rev 12008)
@@ -291,6 +291,12 @@
ClientMessage message = session.createMessage(false);
message.putLongProperty(Message.HDR_SCHEDULED_DELIVERY_TIME, System.currentTimeMillis() + delay);
producer.send(message);
+
+ long timeout = System.currentTimeMillis() + 5000;
+ while (timeout > System.currentTimeMillis() && queueControl.getScheduledCount() != 1)
+ {
+ Thread.sleep(100);
+ }
Assert.assertEquals(1, queueControl.getScheduledCount());
ManagementTestBase.consumeMessages(0, session, queue);
Modified: branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/unit/util/LinkedListTest.java
===================================================================
--- branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/unit/util/LinkedListTest.java 2012-01-11 15:24:12 UTC (rev 12007)
+++ branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/unit/util/LinkedListTest.java 2012-01-11 21:25:18 UTC (rev 12008)
@@ -13,6 +13,8 @@
package org.hornetq.tests.unit.util;
+import java.lang.ref.WeakReference;
+import java.util.LinkedList;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.concurrent.atomic.AtomicInteger;
@@ -90,28 +92,12 @@
if (i % 1000 == 0)
{
System.out.println("Checking on " + i);
-
- for (int gcLoop = 0 ; gcLoop < 5; gcLoop++)
- {
- forceGC();
- if (count.get() == 1000)
- {
- break;
- }
- else
- {
- System.out.println("Trying a GC again");
- }
- }
-
- assertEquals(1000, count.get());
+ assertCount(1000, count);
}
}
- forceGC();
+ assertCount(1000, count);
- assertEquals(1000, count.get());
-
int removed = 0;
while (iter.hasNext())
{
@@ -119,11 +105,44 @@
iter.next();
iter.remove();
}
+
+ assertCount(0, count);
- forceGC();
+ }
- assertEquals(0, count.get());
+ /**
+ * @param count
+ */
+ private void assertCount(final int expected, final AtomicInteger count)
+ {
+ long timeout = System.currentTimeMillis() + 15000;
+
+ int seqCount = 0;
+ while (timeout > System.currentTimeMillis() && count.get() != expected)
+ {
+ seqCount ++;
+ if (seqCount > 5)
+ {
+ LinkedList<String> toOME = new LinkedList<String>();
+ int someCount = 0;
+ try
+ {
+ WeakReference<Object> ref = new WeakReference<Object>(new Object());
+ while (ref.get() != null)
+ {
+ toOME.add("sdlfkjshadlfkjhas dlfkjhas dlfkjhads lkjfhads lfkjhads flkjashdf " + someCount++);
+ }
+ }
+ catch (Throwable expectedThrowable)
+ {
+ }
+
+ toOME.clear();
+ }
+ forceGC();
+ }
+ assertEquals(expected, count.get());
}
public void testAddTail()
Modified: branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/unit/util/SimpleStringTest.java
===================================================================
--- branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/unit/util/SimpleStringTest.java 2012-01-11 15:24:12 UTC (rev 12007)
+++ branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/unit/util/SimpleStringTest.java 2012-01-11 21:25:18 UTC (rev 12008)
@@ -23,14 +23,56 @@
import org.hornetq.utils.DataConstants;
/**
- *
+ *
* A SimpleStringTest
- *
+ *
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
*
*/
public class SimpleStringTest extends UnitTestCase
{
+ /**
+ * Converting back and forth between char and byte requires care as char is unsigned.
+ * @see SimpleString#getChars(int, int, char[], int)
+ * @see SimpleString#charAt(int)
+ * @see SimpleString#split(char)
+ */
+ public void testGetChar()
+ {
+ SimpleString p1 = new SimpleString("foo");
+ SimpleString p2 = new SimpleString("bar");
+ for (int i = 0; i < 1 << 16; i++)
+ {
+ String msg = "expecting " + i;
+ char c = (char)i;
+ SimpleString s = new SimpleString(String.valueOf(c));
+
+ char[] c1 = new char[1];
+ s.getChars(0, 1, c1, 0);
+ assertEquals(msg, c, c1[0]);
+ assertEquals(msg, c, s.charAt(0));
+ SimpleString s2 = s.concat(c);
+ assertEquals(msg, c, s2.charAt(1));
+
+ // test splitting with chars
+ SimpleString sSplit = new SimpleString("foo" + String.valueOf(c) + "bar");
+ SimpleString[] chunks = sSplit.split(c);
+ SimpleString[] split1 = p1.split(c);
+ SimpleString[] split2 = p2.split(c);
+ assertEquals(split1.length + split2.length, chunks.length);
+ int j = 0;
+
+ for (SimpleString iS : split1)
+ {
+ assertEquals(iS.toString(), iS, chunks[j++]);
+ }
+ for (SimpleString iS : split2)
+ {
+ assertEquals(iS.toString(), iS, chunks[j++]);
+ }
+ }
+ }
+
public void testString() throws Exception
{
final String str = "hello123ABC__524`16254`6125!%^$!%$!%$!%$!%!$%!$$!\uA324";
12 years, 11 months
JBoss hornetq SVN: r12007 - branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/management.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2012-01-11 10:24:12 -0500 (Wed, 11 Jan 2012)
New Revision: 12007
Modified:
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/management/QueueControlTest.java
Log:
small fix on test
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/management/QueueControlTest.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/management/QueueControlTest.java 2012-01-09 11:44:01 UTC (rev 12006)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/management/QueueControlTest.java 2012-01-11 15:24:12 UTC (rev 12007)
@@ -291,6 +291,12 @@
ClientMessage message = session.createMessage(false);
message.putLongProperty(Message.HDR_SCHEDULED_DELIVERY_TIME, System.currentTimeMillis() + delay);
producer.send(message);
+
+ long timeout = System.currentTimeMillis() + 5000;
+ while (timeout > System.currentTimeMillis() && queueControl.getScheduledCount() != 1)
+ {
+ Thread.sleep(100);
+ }
Assert.assertEquals(1, queueControl.getScheduledCount());
ManagementTestBase.consumeMessages(0, session, queue);
12 years, 11 months
JBoss hornetq SVN: r12006 - in trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest: util and 1 other directory.
by do-not-reply@jboss.org
Author: borges
Date: 2012-01-09 06:44:01 -0500 (Mon, 09 Jan 2012)
New Revision: 12006
Modified:
trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/topic/SubscriptionsResource.java
trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/util/HttpMessageHelper.java
Log:
Fix findbugs warnings
Modified: trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/topic/SubscriptionsResource.java
===================================================================
--- trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/topic/SubscriptionsResource.java 2012-01-09 11:43:40 UTC (rev 12005)
+++ trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/topic/SubscriptionsResource.java 2012-01-09 11:44:01 UTC (rev 12006)
@@ -1,15 +1,7 @@
package org.hornetq.rest.topic;
-import org.hornetq.api.core.HornetQException;
-import org.hornetq.api.core.SimpleString;
-import org.hornetq.api.core.client.ClientSession;
-import org.hornetq.api.core.client.ClientSessionFactory;
-import org.hornetq.core.logging.Logger;
-import org.hornetq.rest.queue.AcknowledgedQueueConsumer;
-import org.hornetq.rest.queue.Acknowledgement;
-import org.hornetq.rest.queue.DestinationServiceManager;
-import org.hornetq.rest.queue.QueueConsumer;
-import org.hornetq.rest.util.TimeoutTask;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.atomic.AtomicLong;
import javax.ws.rs.DELETE;
import javax.ws.rs.DefaultValue;
@@ -24,9 +16,18 @@
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriBuilder;
import javax.ws.rs.core.UriInfo;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.atomic.AtomicLong;
+import org.hornetq.api.core.HornetQException;
+import org.hornetq.api.core.SimpleString;
+import org.hornetq.api.core.client.ClientSession;
+import org.hornetq.api.core.client.ClientSessionFactory;
+import org.hornetq.core.logging.Logger;
+import org.hornetq.rest.queue.AcknowledgedQueueConsumer;
+import org.hornetq.rest.queue.Acknowledgement;
+import org.hornetq.rest.queue.DestinationServiceManager;
+import org.hornetq.rest.queue.QueueConsumer;
+import org.hornetq.rest.util.TimeoutTask;
+
/**
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
* @version $Revision: 1 $
@@ -131,7 +132,8 @@
@Context UriInfo uriInfo)
{
- if (timeout == null) timeout = new Long(consumerTimeoutSeconds * 1000);
+ if (timeout == null)
+ timeout = Long.valueOf(consumerTimeoutSeconds * 1000);
boolean deleteWhenIdle = !durable; // default is true if non-durable
if (destroyWhenIdle != null) deleteWhenIdle = destroyWhenIdle.booleanValue();
@@ -202,11 +204,11 @@
Response.ResponseBuilder builder = Response.created(location.build());
if (autoAck)
{
- SubscriptionResource.setConsumeNextLink(serviceManager.getLinkStrategy(), builder, uriInfo, uriInfo.getMatchedURIs().get(1) + "/auto-ack/" + consumer.getId(), "-1");
+ QueueConsumer.setConsumeNextLink(serviceManager.getLinkStrategy(), builder, uriInfo, uriInfo.getMatchedURIs().get(1) + "/auto-ack/" + consumer.getId(), "-1");
}
else
{
- AcknowledgedSubscriptionResource.setAcknowledgeNextLink(serviceManager.getLinkStrategy(), builder, uriInfo, uriInfo.getMatchedURIs().get(1) + "/acknowledged/" + consumer.getId(), "-1");
+ AcknowledgedQueueConsumer.setAcknowledgeNextLink(serviceManager.getLinkStrategy(), builder, uriInfo, uriInfo.getMatchedURIs().get(1) + "/acknowledged/" + consumer.getId(), "-1");
}
return builder.build();
@@ -425,7 +427,6 @@
if (consumer == null)
{
String msg = "Failed to match a subscription to URL " + consumerId;
- //System.out.println(msg);
throw new WebApplicationException(Response.status(Response.Status.NOT_FOUND)
.entity(msg)
.type("text/plain").build());
Modified: trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/util/HttpMessageHelper.java
===================================================================
--- trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/util/HttpMessageHelper.java 2012-01-09 11:43:40 UTC (rev 12005)
+++ trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/util/HttpMessageHelper.java 2012-01-09 11:44:01 UTC (rev 12006)
@@ -1,17 +1,19 @@
package org.hornetq.rest.util;
-import org.hornetq.api.core.SimpleString;
-import org.hornetq.api.core.client.ClientMessage;
-import org.jboss.resteasy.client.ClientRequest;
-import org.hornetq.rest.HttpHeaderProperty;
+import java.io.ByteArrayInputStream;
+import java.io.ObjectInputStream;
+import java.util.List;
+import java.util.Map.Entry;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.Response;
-import java.io.ByteArrayInputStream;
-import java.io.ObjectInputStream;
-import java.util.List;
+import org.hornetq.api.core.SimpleString;
+import org.hornetq.api.core.client.ClientMessage;
+import org.hornetq.rest.HttpHeaderProperty;
+import org.jboss.resteasy.client.ClientRequest;
+
/**
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
* @version $Revision: 1 $
@@ -116,11 +118,12 @@
{
MultivaluedMap<String, String> hdrs = headers.getRequestHeaders();
- for (String key : hdrs.keySet())
+ for (Entry<String, List<String>> entry : hdrs.entrySet())
{
+ String key = entry.getKey();
if (isTransferableHttpHeader(key))
{
- List<String> vals = hdrs.get(key);
+ List<String> vals = entry.getValue();
String value = concatenateHeaderValue(vals);
message.putStringProperty(HttpHeaderProperty.toPropertyName(key), value);
}
@@ -132,21 +135,12 @@
public static String concatenateHeaderValue(List<String> vals)
{
if (vals == null) return "";
- StringBuffer val = null;
+ StringBuilder val = new StringBuilder();
for (String v : vals)
{
- if (val == null)
- {
- val = new StringBuffer(v);
- }
- else
- {
val.append(",").append(v);
- }
}
- String value = "";
- if (val != null) value = val.toString();
- return value;
+ return val.toString();
}
}
12 years, 11 months
JBoss hornetq SVN: r12005 - trunk/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/persistence/impl.
by do-not-reply@jboss.org
Author: borges
Date: 2012-01-09 06:43:40 -0500 (Mon, 09 Jan 2012)
New Revision: 12005
Modified:
trunk/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/persistence/impl/BatchIDGeneratorUnitTest.java
Log:
silence test
Modified: trunk/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/persistence/impl/BatchIDGeneratorUnitTest.java
===================================================================
--- trunk/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/persistence/impl/BatchIDGeneratorUnitTest.java 2012-01-09 11:19:04 UTC (rev 12004)
+++ trunk/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/persistence/impl/BatchIDGeneratorUnitTest.java 2012-01-09 11:43:40 UTC (rev 12005)
@@ -92,7 +92,6 @@
{
if (i % 1000 == 0)
{
- System.out.println("lastId = " + lastId);
// interchanging closes and simulated crashes
if (close)
{
12 years, 11 months
JBoss hornetq SVN: r12004 - trunk/hornetq-core/src/main/java/org/hornetq/core/message/impl.
by do-not-reply@jboss.org
Author: borges
Date: 2012-01-09 06:19:04 -0500 (Mon, 09 Jan 2012)
New Revision: 12004
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/message/impl/MessageImpl.java
Log:
Make address synchronization consistent
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/message/impl/MessageImpl.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/message/impl/MessageImpl.java 2012-01-09 11:18:48 UTC (rev 12003)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/message/impl/MessageImpl.java 2012-01-09 11:19:04 UTC (rev 12004)
@@ -52,12 +52,12 @@
private static final Logger log = Logger.getLogger(MessageImpl.class);
public static final SimpleString HDR_ROUTE_TO_IDS = new SimpleString("_HQ_ROUTE_TO");
-
- // used by the bridges to set duplicates
+
+ // used by the bridges to set duplicates
public static final SimpleString HDR_BRIDGE_DUPLICATE_ID = new SimpleString("_HQ_BRIDGE_DUP");
public static final int BUFFER_HEADER_SPACE = PacketImpl.PACKET_HEADERS_SIZE;
-
+
public static final int BODY_OFFSET = BUFFER_HEADER_SPACE + DataConstants.SIZE_INT;
@@ -91,7 +91,7 @@
private boolean copied = true;
private boolean bufferUsed;
-
+
private UUID userID;
// Constructors --------------------------------------------------
@@ -201,7 +201,7 @@
{
return DataConstants.SIZE_LONG + // Message ID
DataConstants.SIZE_BYTE + // user id null?
- (userID == null ? 0 : 16) +
+ (userID == null ? 0 : 16) +
/* address */SimpleString.sizeofNullableString(address) +
DataConstants./* Type */SIZE_BYTE +
DataConstants./* Durable */SIZE_BOOLEAN +
@@ -210,8 +210,8 @@
DataConstants./* Priority */SIZE_BYTE +
/* PropertySize and Properties */properties.getEncodeSize();
}
-
+
public void encodeHeadersAndProperties(final HornetQBuffer buffer)
{
buffer.writeLong(messageID);
@@ -254,7 +254,7 @@
priority = buffer.readByte();
properties.decode(buffer);
}
-
+
public void copyHeadersAndProperties(final MessageInternal msg)
{
messageID = msg.getMessageID();
@@ -267,7 +267,7 @@
priority = msg.getPriority();
properties = msg.getTypedProperties();
}
-
+
public HornetQBuffer getBodyBuffer()
{
if (bodyBuffer == null)
@@ -282,18 +282,18 @@
{
return messageID;
}
-
+
public UUID getUserID()
{
return userID;
}
-
+
public void setUserID(final UUID userID)
{
this.userID = userID;
}
- public SimpleString getAddress()
+ public synchronized SimpleString getAddress()
{
return address;
}
@@ -502,7 +502,7 @@
return buffer;
}
}
-
+
public void setAddressTransient(final SimpleString address)
{
this.address = address;
@@ -574,7 +574,7 @@
bufferValid = false;
}
-
+
public void putObjectProperty(final SimpleString key, final Object value) throws PropertyConversionException
{
if (value == null)
@@ -815,7 +815,7 @@
{
return properties.getSimpleStringProperty(new SimpleString(key));
}
-
+
public Object getObjectProperty(final String key)
{
return properties.getProperty(new SimpleString(key));
@@ -859,7 +859,7 @@
{
return new DecodingContext();
}
-
+
public TypedProperties getTypedProperties()
{
return this.properties;
12 years, 11 months
JBoss hornetq SVN: r12003 - in trunk: hornetq-core/src/main/java/org/hornetq/core/persistence and 1 other directories.
by do-not-reply@jboss.org
Author: borges
Date: 2012-01-09 06:18:48 -0500 (Mon, 09 Jan 2012)
New Revision: 12003
Modified:
trunk/etc/findbugs-exclude.xml
trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/OperationContext.java
trunk/hornetq-core/src/main/javacc/FilterParser.jj
Log:
Fix and filter findbugs warnings
Modified: trunk/etc/findbugs-exclude.xml
===================================================================
--- trunk/etc/findbugs-exclude.xml 2012-01-09 11:18:25 UTC (rev 12002)
+++ trunk/etc/findbugs-exclude.xml 2012-01-09 11:18:48 UTC (rev 12003)
@@ -38,4 +38,10 @@
<Class name="org.hornetq.utils.MemorySize"/>
<bug pattern="DM_GC"/>
</Match>
+
+ <match>
+ <!-- Ignore naming convention violations in generated code -->
+ <class name="org.hornetq.core.filter.impl.FilterParser"/>
+ <bug pattern="NM_METHOD_NAMING_CONVENTION"/>
+ </match>
</FindBugsFilter>
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/OperationContext.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/OperationContext.java 2012-01-09 11:18:25 UTC (rev 12002)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/OperationContext.java 2012-01-09 11:18:48 UTC (rev 12003)
@@ -17,12 +17,10 @@
import org.hornetq.core.journal.IOCompletion;
/**
- * This represents a set of operations done as part of replication.
- * When the entire set is done a group of Runnables can be executed.
- *
+ * This represents a set of operations done as part of replication.
+ * <p>
+ * When the entire set is done, a group of Runnables can be executed.
* @author <mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
- *
- *
*/
public interface OperationContext extends IOCompletion
{
@@ -34,9 +32,9 @@
void replicationLineUp();
void replicationDone();
-
+
void pageSyncLineUp();
-
+
void pageSyncDone();
void waitCompletion() throws Exception;
Modified: trunk/hornetq-core/src/main/javacc/FilterParser.jj
===================================================================
--- trunk/hornetq-core/src/main/javacc/FilterParser.jj 2012-01-09 11:18:25 UTC (rev 12002)
+++ trunk/hornetq-core/src/main/javacc/FilterParser.jj 2012-01-09 11:18:48 UTC (rev 12003)
@@ -570,7 +570,7 @@
{
literal=<FLOATING_POINT_LITERAL>
{
- return new Double(literal.image);
+ return Double.valueOf(literal.image);
}
|
literal=<INTEGER_LITERAL>
@@ -581,7 +581,7 @@
if (number.endsWith(LOFFER_L) || number.endsWith(UPPER_L))
{
// chop off the suffix
- return new Long(number.substring(0, number.length() - 1));
+ return Long.valueOf(number.substring(0, number.length() - 1));
}
// hex
@@ -596,7 +596,7 @@
if (first >= 8)
{
number = Ox + (first - 8) + number.substring(3);
- return new Long(Long.decode(number).longValue() - Long.MAX_VALUE - 1);
+ return Long.valueOf(Long.decode(number).longValue() - Long.MAX_VALUE - 1);
}
}
}
@@ -612,7 +612,7 @@
if (number.charAt(1) == '1')
{
number = ZERRO + number.substring(2);
- return new Long(Long.decode(number).longValue() - Long.MAX_VALUE - 1);
+ return Long.valueOf(Long.decode(number).longValue() - Long.MAX_VALUE - 1);
}
}
}
12 years, 11 months
JBoss hornetq SVN: r12002 - trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl.
by do-not-reply@jboss.org
Author: borges
Date: 2012-01-09 06:18:25 -0500 (Mon, 09 Jan 2012)
New Revision: 12002
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/HornetQServerImpl.java
Log:
The correct method to call here is #start(), #run() would not execute in separate thread.
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/HornetQServerImpl.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/HornetQServerImpl.java 2012-01-09 11:18:03 UTC (rev 12001)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/HornetQServerImpl.java 2012-01-09 11:18:25 UTC (rev 12002)
@@ -2012,7 +2012,7 @@
log.warn(e.getMessage(), e);
}
}
- }.run();
+ }.start();
}
}
}
12 years, 11 months