diff options
author | Robert Greig <rgreig@apache.org> | 2006-12-21 17:53:13 +0000 |
---|---|---|
committer | Robert Greig <rgreig@apache.org> | 2006-12-21 17:53:13 +0000 |
commit | 40c09bcfed642399d4b88d2994f46fad78deecb9 (patch) | |
tree | 8c169ffa3bb24240abd7ea4ce87672b8755bc685 | |
parent | c8150aa5966cc3283b84ac842c4e502fcaf35877 (diff) | |
download | qpid-python-40c09bcfed642399d4b88d2994f46fad78deecb9.tar.gz |
Merge from trunk up to revision 486648
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/new_persistence@489421 13f79535-47bb-0310-9956-ffa450edef68
25 files changed, 171 insertions, 107 deletions
diff --git a/java/broker/src/main/java/org/apache/qpid/server/queue/ConcurrentDeliveryManager.java b/java/broker/src/main/java/org/apache/qpid/server/queue/ConcurrentDeliveryManager.java index 7f8b3d25c5..4f6173fa2a 100644 --- a/java/broker/src/main/java/org/apache/qpid/server/queue/ConcurrentDeliveryManager.java +++ b/java/broker/src/main/java/org/apache/qpid/server/queue/ConcurrentDeliveryManager.java @@ -278,7 +278,12 @@ public class ConcurrentDeliveryManager implements DeliveryManager //are we already running? if so, don't re-run if (_processing.compareAndSet(false, true)) { - executor.execute(asyncDelivery); + // Do we need this? + // This executor is created via Executors in AsyncDeliveryConfig which only returns a TPE so cast is ok. + //if (executor != null && !((ThreadPoolExecutor) executor).isShutdown()) + { + executor.execute(asyncDelivery); + } } } } diff --git a/java/broker/src/main/java/org/apache/qpid/server/queue/SynchronizedDeliveryManager.java b/java/broker/src/main/java/org/apache/qpid/server/queue/SynchronizedDeliveryManager.java index 6cf5a384b8..c8715f263f 100644 --- a/java/broker/src/main/java/org/apache/qpid/server/queue/SynchronizedDeliveryManager.java +++ b/java/broker/src/main/java/org/apache/qpid/server/queue/SynchronizedDeliveryManager.java @@ -208,7 +208,12 @@ class SynchronizedDeliveryManager implements DeliveryManager //are we already running? if so, don't re-run if (_processing.compareAndSet(false, true)) { - executor.execute(new Runner()); + // Do we need this? + // This executor is created via Executors in AsyncDeliveryConfig which only returns a TPE so cast is ok. + //if (executor != null && !((ThreadPoolExecutor) executor).isShutdown()) + { + executor.execute(new Runner()); + } } } } diff --git a/java/client/src/main/java/org/apache/qpid/client/AMQDestination.java b/java/client/src/main/java/org/apache/qpid/client/AMQDestination.java index 6401e3b23f..5c13e7861f 100644 --- a/java/client/src/main/java/org/apache/qpid/client/AMQDestination.java +++ b/java/client/src/main/java/org/apache/qpid/client/AMQDestination.java @@ -99,7 +99,10 @@ public abstract class AMQDestination implements Destination, Referenceable _queueName = queueName; } - public abstract String getEncodedName(); + public String getEncodedName() + { + return toURL(); + } public boolean isDurable() { @@ -244,7 +247,7 @@ public abstract class AMQDestination implements Destination, Referenceable return false; } if ((_queueName == null && that._queueName != null) || - (_queueName != null && !_queueName.equals(that._queueName))) + (_queueName != null && !_queueName.equals(that._queueName))) { return false; } @@ -282,4 +285,26 @@ public abstract class AMQDestination implements Destination, Referenceable AMQConnectionFactory.class.getName(), null); // factory location } + + public static Destination createDestination(BindingURL binding) + { + String type = binding.getExchangeClass(); + + if (type.equals(ExchangeDefaults.DIRECT_EXCHANGE_CLASS)) + { + return new AMQQueue(binding); + } + else if (type.equals(ExchangeDefaults.TOPIC_EXCHANGE_CLASS)) + { + return new AMQTopic(binding); + } + else if (type.equals(ExchangeDefaults.HEADERS_EXCHANGE_CLASS)) + { + return new AMQHeadersExchange(binding); + } + else + { + throw new IllegalArgumentException("Unknown Exchange Class:" + type + " in binding:" + binding); + } + } } diff --git a/java/client/src/main/java/org/apache/qpid/client/AMQHeadersExchange.java b/java/client/src/main/java/org/apache/qpid/client/AMQHeadersExchange.java index c5bae6e1fa..c6d21c0ea7 100644 --- a/java/client/src/main/java/org/apache/qpid/client/AMQHeadersExchange.java +++ b/java/client/src/main/java/org/apache/qpid/client/AMQHeadersExchange.java @@ -38,11 +38,6 @@ public class AMQHeadersExchange extends AMQDestination super(queueName, ExchangeDefaults.HEADERS_EXCHANGE_CLASS, queueName, true, true, null); } - public String getEncodedName() - { - return getDestinationName(); - } - public String getRoutingKey() { return getDestinationName(); diff --git a/java/client/src/main/java/org/apache/qpid/client/AMQQueue.java b/java/client/src/main/java/org/apache/qpid/client/AMQQueue.java index 8304a29e4d..6c0da6112a 100644 --- a/java/client/src/main/java/org/apache/qpid/client/AMQQueue.java +++ b/java/client/src/main/java/org/apache/qpid/client/AMQQueue.java @@ -75,11 +75,7 @@ public class AMQQueue extends AMQDestination implements Queue autoDelete, queueName); } - public String getEncodedName() - { - return 'Q' + getQueueName(); - } - + public String getRoutingKey() { return getQueueName(); diff --git a/java/client/src/main/java/org/apache/qpid/client/AMQTemporaryQueue.java b/java/client/src/main/java/org/apache/qpid/client/AMQTemporaryQueue.java index 0b12bfb728..6b41ea0112 100644 --- a/java/client/src/main/java/org/apache/qpid/client/AMQTemporaryQueue.java +++ b/java/client/src/main/java/org/apache/qpid/client/AMQTemporaryQueue.java @@ -26,22 +26,25 @@ import javax.jms.TemporaryQueue; /** * AMQ implementation of a TemporaryQueue. */ -final class AMQTemporaryQueue extends AMQQueue implements TemporaryQueue { +final class AMQTemporaryQueue extends AMQQueue implements TemporaryQueue +{ + /** * Create a new instance of an AMQTemporaryQueue */ - public AMQTemporaryQueue() { - super("TempQueue" + Long.toString(System.currentTimeMillis()), - null, true, true); + public AMQTemporaryQueue() + { + super("TempQueue" + Long.toString(System.currentTimeMillis()), true); } /** * @see javax.jms.TemporaryQueue#delete() */ - public void delete() throws JMSException { + public void delete() throws JMSException + { throw new UnsupportedOperationException("Delete not supported, " + - "will auto-delete when connection closed"); + "will auto-delete when connection closed"); } - + } diff --git a/java/client/src/main/java/org/apache/qpid/client/AMQTopic.java b/java/client/src/main/java/org/apache/qpid/client/AMQTopic.java index 89727f65b7..4dd38eea18 100644 --- a/java/client/src/main/java/org/apache/qpid/client/AMQTopic.java +++ b/java/client/src/main/java/org/apache/qpid/client/AMQTopic.java @@ -61,11 +61,6 @@ public class AMQTopic extends AMQDestination implements Topic return super.getDestinationName(); } - public String getEncodedName() - { - return 'T' + getDestinationName(); - } - public String getRoutingKey() { return getDestinationName(); diff --git a/java/client/src/main/java/org/apache/qpid/client/message/AbstractJMSMessage.java b/java/client/src/main/java/org/apache/qpid/client/message/AbstractJMSMessage.java index 279d861cc2..41eb21a415 100644 --- a/java/client/src/main/java/org/apache/qpid/client/message/AbstractJMSMessage.java +++ b/java/client/src/main/java/org/apache/qpid/client/message/AbstractJMSMessage.java @@ -23,6 +23,9 @@ package org.apache.qpid.client.message; import org.apache.commons.collections.map.ReferenceMap; import org.apache.mina.common.ByteBuffer; import org.apache.qpid.AMQException; +import org.apache.qpid.url.BindingURL; +import org.apache.qpid.url.AMQBindingURL; +import org.apache.qpid.url.URLSyntaxException; import org.apache.qpid.client.AMQDestination; import org.apache.qpid.client.AMQQueue; import org.apache.qpid.client.AMQTopic; @@ -136,19 +139,16 @@ public abstract class AbstractJMSMessage extends AMQMessage implements javax.jms Destination dest = (Destination) _destinationCache.get(replyToEncoding); if (dest == null) { - char destType = replyToEncoding.charAt(0); - if (destType == 'Q') + try { - dest = new AMQQueue(replyToEncoding.substring(1)); + BindingURL binding = new AMQBindingURL(replyToEncoding); + dest = AMQDestination.createDestination(binding); } - else if (destType == 'T') - { - dest = new AMQTopic(replyToEncoding.substring(1)); - } - else + catch (URLSyntaxException e) { throw new JMSException("Illegal value in JMS_ReplyTo property: " + replyToEncoding); } + _destinationCache.put(replyToEncoding, dest); } return dest; @@ -163,7 +163,7 @@ public abstract class AbstractJMSMessage extends AMQMessage implements javax.jms } if (!(destination instanceof AMQDestination)) { - throw new IllegalArgumentException("ReplyTo destination my be an AMQ destination - passed argument was type " + + throw new IllegalArgumentException("ReplyTo destination may only be an AMQDestination - passed argument was type " + destination.getClass()); } final AMQDestination amqd = (AMQDestination) destination; @@ -389,9 +389,10 @@ public abstract class AbstractJMSMessage extends AMQMessage implements javax.jms // is not specified. In our case, we only set the session field where client acknowledge mode is specified. if (_session != null) { - if (_session.getAMQConnection().isClosed()){ - throw new javax.jms.IllegalStateException("Connection is already closed"); - } + if (_session.getAMQConnection().isClosed()) + { + throw new javax.jms.IllegalStateException("Connection is already closed"); + } // we set multiple to true here since acknowledgement implies acknowledge of all previous messages // received on the session diff --git a/java/client/src/main/java/org/apache/qpid/client/state/StateWaiter.java b/java/client/src/main/java/org/apache/qpid/client/state/StateWaiter.java index 42ae5a7b17..18e1fdad82 100644 --- a/java/client/src/main/java/org/apache/qpid/client/state/StateWaiter.java +++ b/java/client/src/main/java/org/apache/qpid/client/state/StateWaiter.java @@ -46,7 +46,7 @@ public class StateWaiter implements StateListener public void waituntilStateHasChanged() throws AMQException { - synchronized (_monitor) + synchronized(_monitor) { // // The guard is required in case we are woken up by a spurious @@ -71,22 +71,22 @@ public class StateWaiter implements StateListener _logger.debug("Throwable reached state waiter: " + _throwable); if (_throwable instanceof AMQException) { - throw (AMQException) _throwable; + throw(AMQException) _throwable; } else { - throw new AMQException("Error: " + _throwable, _throwable); // FIXME: this will wrap FailoverException in throwable which will prevent it being caught. + throw new AMQException("Error: " + _throwable, _throwable); // FIXME: this will wrap FailoverException in throwable which will prevent it being caught. } } } public void stateChanged(AMQState oldState, AMQState newState) { - synchronized (_monitor) + synchronized(_monitor) { if (_logger.isDebugEnabled()) { - _logger.debug("stateChanged called"); + _logger.debug("stateChanged called changing from :" + oldState + " to :" + newState); } if (_state == newState) { @@ -103,7 +103,7 @@ public class StateWaiter implements StateListener public void error(Throwable t) { - synchronized (_monitor) + synchronized(_monitor) { if (_logger.isDebugEnabled()) { diff --git a/java/client/src/main/java/org/apache/qpid/client/transport/SocketTransportConnection.java b/java/client/src/main/java/org/apache/qpid/client/transport/SocketTransportConnection.java index 78d937f453..2e47ed2666 100644 --- a/java/client/src/main/java/org/apache/qpid/client/transport/SocketTransportConnection.java +++ b/java/client/src/main/java/org/apache/qpid/client/transport/SocketTransportConnection.java @@ -60,6 +60,7 @@ public class SocketTransportConnection implements ITransportConnection // once more testing of the performance of the simple allocator has been done if (!Boolean.getBoolean("amqj.enablePooledAllocator")) { + _logger.warn("Using SimpleByteBufferAllocator"); ByteBuffer.setAllocator(new SimpleByteBufferAllocator()); } diff --git a/java/client/src/main/java/org/apache/qpid/client/transport/TransportConnection.java b/java/client/src/main/java/org/apache/qpid/client/transport/TransportConnection.java index 58507a75ca..e9e23aefdb 100644 --- a/java/client/src/main/java/org/apache/qpid/client/transport/TransportConnection.java +++ b/java/client/src/main/java/org/apache/qpid/client/transport/TransportConnection.java @@ -268,7 +268,7 @@ public class TransportConnection Object[] params = {port}; provider = (IoHandlerAdapter) Class.forName(protocolProviderClass).getConstructor(cnstr).newInstance(params); //Give the broker a second to create - _logger.info("Created Instance"); + _logger.info("Created VMBroker Instance:" + port); } catch (Exception e) { diff --git a/java/client/src/main/java/org/apache/qpid/jndi/PropertiesFileInitialContextFactory.java b/java/client/src/main/java/org/apache/qpid/jndi/PropertiesFileInitialContextFactory.java index b0641350ad..0759113667 100644 --- a/java/client/src/main/java/org/apache/qpid/jndi/PropertiesFileInitialContextFactory.java +++ b/java/client/src/main/java/org/apache/qpid/jndi/PropertiesFileInitialContextFactory.java @@ -25,6 +25,7 @@ import org.apache.qpid.client.AMQConnectionFactory; import org.apache.qpid.client.AMQHeadersExchange; import org.apache.qpid.client.AMQQueue; import org.apache.qpid.client.AMQTopic; +import org.apache.qpid.client.AMQDestination; import org.apache.qpid.exchange.ExchangeDefaults; import org.apache.qpid.url.AMQBindingURL; import org.apache.qpid.url.BindingURL; @@ -177,21 +178,15 @@ public class PropertiesFileInitialContextFactory implements InitialContextFactor return null; } - if (binding.getExchangeClass().equals(ExchangeDefaults.TOPIC_EXCHANGE_CLASS)) - { - return createTopic(binding); - } - else if (binding.getExchangeClass().equals(ExchangeDefaults.DIRECT_EXCHANGE_CLASS)) + try { - return createQueue(binding); + return AMQDestination.createDestination(binding); } - else if (binding.getExchangeClass().equals(ExchangeDefaults.HEADERS_EXCHANGE_CLASS)) + catch (IllegalArgumentException iaw) { - return createHeaderExchange(binding); + _logger.warn("Binding: '" + binding + "' not supported"); + return null; } - - _logger.warn("Binding: '" + binding + "' not supported"); - return null; } /** diff --git a/java/client/src/test/java/org/apache/qpid/test/unit/basic/PropertyValueTest.java b/java/client/src/test/java/org/apache/qpid/test/unit/basic/PropertyValueTest.java index fdf50a7609..7f76baa157 100644 --- a/java/client/src/test/java/org/apache/qpid/test/unit/basic/PropertyValueTest.java +++ b/java/client/src/test/java/org/apache/qpid/test/unit/basic/PropertyValueTest.java @@ -119,8 +119,17 @@ public class PropertyValueTest extends TestCase implements MessageListener m.setJMSPriority(100); // Queue - Queue q = //_session.createTemporaryQueue(); - q = new AMQQueue("TestReply"); + Queue q; + + if (i / 2 == 0) + { + q = _session.createTemporaryQueue(); + } + else + { + q = new AMQQueue("TestReply"); + } + m.setJMSReplyTo(q); m.setStringProperty("TempQueue", q.toString()); @@ -173,6 +182,8 @@ public class PropertyValueTest extends TestCase implements MessageListener (int) Integer.MAX_VALUE, m.getIntProperty("Int")); Assert.assertEquals("Check CorrelationID properties are correctly transported", "Correlation", m.getJMSCorrelationID()); + + _logger.warn("getJMSPriority not being verified."); // Assert.assertEquals("Check Priority properties are correctly transported", // 100, m.getJMSPriority()); @@ -180,8 +191,9 @@ public class PropertyValueTest extends TestCase implements MessageListener Assert.assertEquals("Check ReplyTo properties are correctly transported", m.getStringProperty("TempQueue"), m.getJMSReplyTo().toString()); -// Assert.assertEquals("Check Type properties are correctly transported", -// "Test", m.getJMSType()); + Assert.assertEquals("Check Type properties are correctly transported", + "Test", m.getJMSType()); + Assert.assertEquals("Check Short properties are correctly transported", (short) Short.MAX_VALUE, m.getShortProperty("Short")); Assert.assertEquals("Check UnsignedInt properties are correctly transported", diff --git a/java/common/src/main/java/org/apache/qpid/framing/EncodingUtils.java b/java/common/src/main/java/org/apache/qpid/framing/EncodingUtils.java index 2efdb88fd9..61a0787fcd 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/EncodingUtils.java +++ b/java/common/src/main/java/org/apache/qpid/framing/EncodingUtils.java @@ -609,8 +609,22 @@ public class EncodingUtils } } - public static long encodedCharacterLength() + //CHAR_PROPERTY + public static long encodedCharLength() { - return encodedShortStringLength("c"); + return encodedByteLength(); } + + public static char readChar(ByteBuffer buffer) + { + //This is valid as we know that the Character is ASCII 0..127 + return (char) buffer.get(); + } + + public static void writeChar(ByteBuffer buffer, char character) + { + //This is valid as we know that the Character is ASCII 0..127 + writeByte(buffer, (byte) character); + } + } diff --git a/java/common/src/main/java/org/apache/qpid/framing/PropertyFieldTable.java b/java/common/src/main/java/org/apache/qpid/framing/PropertyFieldTable.java index e6f5196434..b6556b2468 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/PropertyFieldTable.java +++ b/java/common/src/main/java/org/apache/qpid/framing/PropertyFieldTable.java @@ -41,9 +41,11 @@ public class PropertyFieldTable implements FieldTable, Map public static final char AMQP_UNSIGNEDINT_PROPERTY_PREFIX = 'I'; public static final char AMQP_TIMESTAMP_PROPERTY_PREFIX = 'T'; public static final char AMQP_STRING_PROPERTY_PREFIX = 'S'; + public static final char AMQP_ASCII_CHARACTER_PROPERTY_PREFIX = 'k'; public static final char AMQP_ASCII_STRING_PROPERTY_PREFIX = 'c'; public static final char AMQP_WIDE_STRING_PROPERTY_PREFIX = 'C'; public static final char AMQP_BINARY_PROPERTY_PREFIX = 'x'; + public static final char AMQP_NULL_STRING_PROPERTY_PREFIX = 'n'; public static final char BOOLEAN_PROPERTY_PREFIX = 't'; public static final char BYTE_PROPERTY_PREFIX = 'b'; @@ -52,10 +54,10 @@ public class PropertyFieldTable implements FieldTable, Map public static final char LONG_PROPERTY_PREFIX = 'l'; public static final char FLOAT_PROPERTY_PREFIX = 'f'; public static final char DOUBLE_PROPERTY_PREFIX = 'd'; - public static final char NULL_STRING_PROPERTY_PREFIX = 'n'; + public static final char NULL_STRING_PROPERTY_PREFIX = AMQP_NULL_STRING_PROPERTY_PREFIX; public static final char STRING_PROPERTY_PREFIX = AMQP_STRING_PROPERTY_PREFIX; - public static final char CHAR_PROPERTY_PREFIX = AMQP_ASCII_STRING_PROPERTY_PREFIX; + public static final char CHAR_PROPERTY_PREFIX = AMQP_ASCII_CHARACTER_PROPERTY_PREFIX; public static final char BYTES_PROPERTY_PREFIX = AMQP_BINARY_PROPERTY_PREFIX; //Our custom prefix for encoding across the wire @@ -1180,26 +1182,26 @@ public class PropertyFieldTable implements FieldTable, Map case NULL_STRING_PROPERTY_PREFIX: buffer.put((byte) NULL_STRING_PROPERTY_PREFIX); break; + case AMQP_WIDE_STRING_PROPERTY_PREFIX: - //case AMQP_STRING_PROPERTY_PREFIX: - case STRING_PROPERTY_PREFIX: // TODO: look at using proper charset encoder buffer.put((byte) STRING_PROPERTY_PREFIX); EncodingUtils.writeLongStringBytes(buffer, (String) value); break; - - //case AMQP_ASCII_STRING_PROPERTY_PREFIX: + case AMQP_ASCII_STRING_PROPERTY_PREFIX: + case STRING_PROPERTY_PREFIX: // AMQP_STRING_PROPERTY_PREFIX: + //This is a simple ASCII string + buffer.put((byte) STRING_PROPERTY_PREFIX); + EncodingUtils.writeLongStringBytes(buffer, (String) value); + break; case CHAR_PROPERTY_PREFIX: - // TODO: look at using proper charset encoder buffer.put((byte) CHAR_PROPERTY_PREFIX); - EncodingUtils.writeShortStringBytes(buffer, "" + (Character) value); + EncodingUtils.writeChar(buffer, (Character) value); break; - case BYTES_PROPERTY_PREFIX: buffer.put((byte) BYTES_PROPERTY_PREFIX); EncodingUtils.writeBytes(buffer, (byte[]) value); break; - case XML_PROPERTY_PREFIX: // Encode as XML buffer.put((byte) XML_PROPERTY_PREFIX); @@ -1271,16 +1273,15 @@ public class PropertyFieldTable implements FieldTable, Map // TODO: use proper charset decoder case AMQP_WIDE_STRING_PROPERTY_PREFIX: - //case AMQP_STRING_PROPERTY_PREFIX: - case STRING_PROPERTY_PREFIX: + case AMQP_ASCII_STRING_PROPERTY_PREFIX: + case STRING_PROPERTY_PREFIX: // AMQP_STRING_PROPERTY_PREFIX: value = EncodingUtils.readLongString(buffer); break; case NULL_STRING_PROPERTY_PREFIX: value = null; break; - //case AMQP_ASCII_STRING_PROPERTY_PREFIX: case CHAR_PROPERTY_PREFIX: - value = EncodingUtils.readShortString(buffer).charAt(0); + value = EncodingUtils.readChar((buffer)); break; case BYTES_PROPERTY_PREFIX: value = EncodingUtils.readBytes(buffer); @@ -1356,16 +1357,15 @@ public class PropertyFieldTable implements FieldTable, Map encodingSize += EncodingUtils.encodedDoubleLength(); break; case AMQP_WIDE_STRING_PROPERTY_PREFIX: - //case AMQP_STRING_PROPERTY_PREFIX: - case STRING_PROPERTY_PREFIX: + case AMQP_ASCII_STRING_PROPERTY_PREFIX: + case STRING_PROPERTY_PREFIX: //AMQP_STRING_PROPERTY_PREFIX: encodingSize += EncodingUtils.encodedLongStringLength((String) value); break; case NULL_STRING_PROPERTY_PREFIX: - // There is no need for additiona size beyond the prefix + // There is no need for additional size beyond the prefix break; - //case AMQP_ASCII_STRING_PROPERTY_PREFIX: case CHAR_PROPERTY_PREFIX: - encodingSize += EncodingUtils.encodedShortStringLength("" + (Character) value); + encodingSize += EncodingUtils.encodedCharLength(); break; case BYTES_PROPERTY_PREFIX: encodingSize += 1 + ((byte[]) value).length; @@ -1374,7 +1374,7 @@ public class PropertyFieldTable implements FieldTable, Map encodingSize += EncodingUtils.encodedLongStringLength(valueAsXML(name, value)); break; default: - //encodingSize = 1 + EncodingUtils.encodedLongStringLength(String.valueOf(value)); + //encodingSize = 1 + EncodingUtils.encodedLongstrLength(String.valueOf(value)); // We are using XML String encoding throw new IllegalArgumentException("Unsupported type in field table: " + value.getClass()); } diff --git a/java/common/src/main/java/org/apache/qpid/pool/PoolingFilter.java b/java/common/src/main/java/org/apache/qpid/pool/PoolingFilter.java index 2ace2b8348..38cfa68c78 100644 --- a/java/common/src/main/java/org/apache/qpid/pool/PoolingFilter.java +++ b/java/common/src/main/java/org/apache/qpid/pool/PoolingFilter.java @@ -58,6 +58,9 @@ public class PoolingFilter extends IoFilterAdapter implements Job.JobCompletionH Job job = getJobForSession(session); job.acquire(); //prevents this job being removed from _jobs job.add(event); + + //Additional checks on pool to check that it hasn't shutdown. + // The alternative is to catch the RejectedExecutionException that will result from executing on a shutdown pool if (job.activate() && _poolReference.getPool() != null && !_poolReference.getPool().isShutdown()) { _poolReference.getPool().execute(job); @@ -100,7 +103,9 @@ public class PoolingFilter extends IoFilterAdapter implements Job.JobCompletionH } else { - if (job.activate()) + // ritchiem : 2006-12-13 Do we need to perform the additional checks here? + // Can the pool be shutdown at this point? + if (job.activate() && _poolReference.getPool() != null && !_poolReference.getPool().isShutdown()) { _poolReference.getPool().execute(job); } @@ -184,3 +189,4 @@ public class PoolingFilter extends IoFilterAdapter implements Job.JobCompletionH _poolReference.releaseExecutorService(); } } + diff --git a/java/common/src/test/java/org/apache/qpid/framing/PropertyFieldTableTest.java b/java/common/src/test/java/org/apache/qpid/framing/PropertyFieldTableTest.java index e41487ba4b..f2067a5649 100644 --- a/java/common/src/test/java/org/apache/qpid/framing/PropertyFieldTableTest.java +++ b/java/common/src/test/java/org/apache/qpid/framing/PropertyFieldTableTest.java @@ -26,8 +26,6 @@ import junit.framework.TestCase; import java.util.Enumeration; import org.apache.mina.common.ByteBuffer; -import org.apache.mina.common.ByteBufferProxy; -import org.apache.mina.common.support.BaseByteBuffer; public class PropertyFieldTableTest extends TestCase { @@ -402,7 +400,7 @@ public class PropertyFieldTableTest extends TestCase Assert.assertEquals(size, result.getEncodedSize()); result.setChar("char", (char) 'c'); - size += 1 + EncodingUtils.encodedShortStringLength("char") + EncodingUtils.encodedCharacterLength(); + size += 1 + EncodingUtils.encodedShortStringLength("char") + EncodingUtils.encodedCharLength(); Assert.assertEquals(size, result.getEncodedSize()); result.setDouble("double", (double) Double.MAX_VALUE); @@ -444,7 +442,7 @@ public class PropertyFieldTableTest extends TestCase Assert.assertEquals(size, result.getEncodedSize()); result.setObject("object-char", 'c'); - size += 1 + EncodingUtils.encodedShortStringLength("object-char") + EncodingUtils.encodedCharacterLength(); + size += 1 + EncodingUtils.encodedShortStringLength("object-char") + EncodingUtils.encodedCharLength(); Assert.assertEquals(size, result.getEncodedSize()); result.setObject("object-double", Double.MAX_VALUE); diff --git a/java/management/eclipse-plugin/bin/qpidmc.bat b/java/management/eclipse-plugin/bin/qpidmc.bat index 4ed55df644..6250b53e68 100644 --- a/java/management/eclipse-plugin/bin/qpidmc.bat +++ b/java/management/eclipse-plugin/bin/qpidmc.bat @@ -52,4 +52,4 @@ goto exit rem Slurp the command line arguments. This loop allows for an unlimited number
rem of agruments (up to the command line limit, anyway).
-"%JAVA_HOME%\bin\java" -Xms40m -Xmx256m -Declipse.consoleLog=true -jar %QPIDMC_HOME%\startup.jar org.eclipse.core.launcher.Main -launcher %QPIDMC_HOME%\qpidmc.exe -name "Qpid Management Console" -showsplash 600 -data %QPIDMC_HOME%\data -configuration "file:%QPIDMC_HOME%/configuration" -os win32 -ws win32 -arch x86
+"%JAVA_HOME%\bin\java" -Xms40m -Xmx256m -Declipse.consoleLog=true -jar %QPIDMC_HOME%\eclipse\startup.jar org.eclipse.core.launcher.Main -launcher %QPIDMC_HOME%\eclipse\eclipse -name "Qpid Management Console" -showsplash 600 -configuration "file:%QPIDMC_HOME%\configuration" -os win32 -ws win32 -arch x86
diff --git a/java/management/eclipse-plugin/bin/qpidmc.sh b/java/management/eclipse-plugin/bin/qpidmc.sh index aa99635d83..c9ab423fdd 100755 --- a/java/management/eclipse-plugin/bin/qpidmc.sh +++ b/java/management/eclipse-plugin/bin/qpidmc.sh @@ -1,21 +1,3 @@ #!/bin/bash -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -"$JAVA_HOME/bin/java" -Xms40m -Xmx256m -Declipse.consoleLog=true -jar $QPIDMC_HOME/startup.jar org.eclipse.core.launcher.Main -launcher $QPIDMC_HOME/qpidmc.exe -name "Qpid Management Console" -showsplash 600 -data $QPIDMC_HOME/data -configuration "file:$QPIDMC_HOME/configuration"
\ No newline at end of file +"$JAVA_HOME/bin/java" -Xms40m -Xmx256m -Declipse.consoleLog=false -jar $QPIDMC_HOME/eclipse/startup.jar org.eclipse.core.launcher.Main -launcher $QPIDMC_HOME/eclipse/eclipse -name "Qpid Management Console" -showsplash 600 -configuration "file:$QPIDMC_HOME/configuration" diff --git a/java/management/eclipse-plugin/src/main/resources/.eclipseproduct b/java/management/eclipse-plugin/src/main/resources/.eclipseproduct new file mode 100644 index 0000000000..728766577f --- /dev/null +++ b/java/management/eclipse-plugin/src/main/resources/.eclipseproduct @@ -0,0 +1,5 @@ +#Eclipse Product File
+#Fri Nov 03 14:47:54 GMT 2006
+version=1.0-incubating-M2-SNAPSHOT
+name=Qpid Management Console
+id=org.apache.qpid.manager.gui.product
diff --git a/java/management/eclipse-plugin/src/main/resources/qpidmc.exe b/java/management/eclipse-plugin/src/main/resources/eclipse.exe Binary files differindex 7826d1ed80..7826d1ed80 100644 --- a/java/management/eclipse-plugin/src/main/resources/qpidmc.exe +++ b/java/management/eclipse-plugin/src/main/resources/eclipse.exe diff --git a/java/management/eclipse-plugin/src/main/resources/qpidmc.ini b/java/management/eclipse-plugin/src/main/resources/eclipse.ini index 6a4ecb5b5d..6a4ecb5b5d 100644 --- a/java/management/eclipse-plugin/src/main/resources/qpidmc.ini +++ b/java/management/eclipse-plugin/src/main/resources/eclipse.ini diff --git a/java/management/eclipse-plugin/src/main/resources/unix/configuration/config.ini b/java/management/eclipse-plugin/src/main/resources/unix/configuration/config.ini new file mode 100644 index 0000000000..d50b06cbcf --- /dev/null +++ b/java/management/eclipse-plugin/src/main/resources/unix/configuration/config.ini @@ -0,0 +1,26 @@ +###############################################################################
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+###############################################################################
+
+#Product Runtime Configuration File
+
+osgi.splashPath=platform:/base/plugins/org.apache.qpid.management.ui
+eclipse.product=org.apache.qpid.management.ui.product
+eclipse.application=org.apache.qpid.management.ui.application
+osgi.bundles=org.eclipse.equinox.common@2:start,org.eclipse.core.runtime@start,com.ibm.icu,org.apache.qpid.management.ui,org.eclipse.core.commands,org.eclipse.core.contenttype,org.eclipse.core.expressions,org.eclipse.core.jobs,org.eclipse.core.runtime.compatibility.auth,org.eclipse.core.runtime.compatibility.registry,org.eclipse.equinox.preferences,org.eclipse.equinox.registry,org.eclipse.help,org.eclipse.jface,org.eclipse.swt,org.eclipse.swt.motif.linux.x86,org.eclipse.swt.gtk.linux.x86_64,org.eclipse.swt.gtk.linux.x86,org.eclipse.swt.gtk.linux.ppc,org.eclipse.swt.motif.hpux.PA_RISC,org.eclipse.swt.gtk.solaris.sparc,org.eclipse.swt.motif.solaris.sparc,org.eclipse.swt.carbon.macocx,org.eclipse.ui,org.eclipse.ui.forms,org.eclipse.ui.workbench
+osgi.bundles.defaultStartLevel=4
diff --git a/java/management/eclipse-plugin/src/main/resources/configuration/config.ini b/java/management/eclipse-plugin/src/main/resources/win32/configuration/config.ini index dbe3f23fe9..dbe3f23fe9 100644 --- a/java/management/eclipse-plugin/src/main/resources/configuration/config.ini +++ b/java/management/eclipse-plugin/src/main/resources/win32/configuration/config.ini diff --git a/java/management/eclipse-plugin/src/main/resources/configuration/org.eclipse.osgi/bundles/16/1/.cp/swt-win32-3232.dll b/java/management/eclipse-plugin/src/main/resources/win32/configuration/org.eclipse.osgi/bundles/16/1/.cp/swt-win32-3232.dll Binary files differindex f028cec28d..f028cec28d 100644 --- a/java/management/eclipse-plugin/src/main/resources/configuration/org.eclipse.osgi/bundles/16/1/.cp/swt-win32-3232.dll +++ b/java/management/eclipse-plugin/src/main/resources/win32/configuration/org.eclipse.osgi/bundles/16/1/.cp/swt-win32-3232.dll |