diff options
| author | Robert Greig <rgreig@apache.org> | 2007-04-20 12:51:33 +0000 |
|---|---|---|
| committer | Robert Greig <rgreig@apache.org> | 2007-04-20 12:51:33 +0000 |
| commit | f34a96d370c3f8cba4843a29ec0d8075c1606f68 (patch) | |
| tree | 689b9d0de66fbce26201fd60799c91f4dfd587be /java/common/src | |
| parent | 959cffd1298dc79218182cbcf73d8e494b2b06e3 (diff) | |
| download | qpid-python-f34a96d370c3f8cba4843a29ec0d8075c1606f68.tar.gz | |
Copied some whitespace only differences from M2 to trunk.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@530779 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/common/src')
4 files changed, 31 insertions, 80 deletions
diff --git a/java/common/src/main/java/org/apache/qpid/AMQException.java b/java/common/src/main/java/org/apache/qpid/AMQException.java index 3e93243a1d..2f04a01f53 100644 --- a/java/common/src/main/java/org/apache/qpid/AMQException.java +++ b/java/common/src/main/java/org/apache/qpid/AMQException.java @@ -7,9 +7,9 @@ * 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 @@ -20,7 +20,6 @@ */ package org.apache.qpid; -import org.apache.log4j.Logger; import org.apache.qpid.protocol.AMQConstant; /** @@ -61,7 +60,7 @@ public class AMQException extends Exception public AMQException(String message) { super(message); - //fixme This method needs removed and all AMQExceptions need a valid error code + // fixme This method needs removed and all AMQExceptions need a valid error code _errorCode = AMQConstant.getConstant(-1); } @@ -74,7 +73,7 @@ public class AMQException extends Exception public AMQException(String msg, Throwable t) { super(msg, t); - //fixme This method needs removed and all AMQExceptions need a valid error code + // fixme This method needs removed and all AMQExceptions need a valid error code _errorCode = AMQConstant.getConstant(-1); } @@ -90,26 +89,6 @@ public class AMQException extends Exception _errorCode = errorCode; } - /* - public AMQException(Logger logger, String msg, Throwable t) - { - this(msg, t); - logger.error(getMessage(), this); - } - - public AMQException(Logger logger, String msg) - { - this(msg); - logger.error(getMessage(), this); - } - - public AMQException(Logger logger, AMQConstant errorCode, String msg) - { - this(errorCode, msg); - logger.error(getMessage(), this); - } - */ - /** * Gets the AMQ protocol exception code associated with this exception. * diff --git a/java/common/src/main/java/org/apache/qpid/configuration/PropertyException.java b/java/common/src/main/java/org/apache/qpid/configuration/PropertyException.java index 7c85a08e11..022e7b8a76 100644 --- a/java/common/src/main/java/org/apache/qpid/configuration/PropertyException.java +++ b/java/common/src/main/java/org/apache/qpid/configuration/PropertyException.java @@ -1,4 +1,3 @@ -/* Copyright Rupert Smith, 2005 to 2006, all rights reserved. */ /* * * Licensed to the Apache Software Foundation (ASF) under one @@ -21,8 +20,6 @@ */ package org.apache.qpid.configuration; -import org.apache.log4j.Logger; - import org.apache.qpid.AMQException; import org.apache.qpid.protocol.AMQConstant; @@ -50,19 +47,4 @@ public class PropertyException extends AMQException { super(errorCode, msg); } - - /*public PropertyException(Logger logger, String msg, Throwable t) - { - super(logger, msg, t); - } - - public PropertyException(Logger logger, String msg) - { - super(logger, msg); - } - - public PropertyException(Logger logger, AMQConstant errorCode, String msg) - { - super(logger, errorCode, msg); - }*/ } diff --git a/java/common/src/main/java/org/apache/qpid/framing/AMQFrameDecodingException.java b/java/common/src/main/java/org/apache/qpid/framing/AMQFrameDecodingException.java index c462dec2a3..171da76771 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/AMQFrameDecodingException.java +++ b/java/common/src/main/java/org/apache/qpid/framing/AMQFrameDecodingException.java @@ -1,4 +1,3 @@ -/* Copyright Rupert Smith, 2005 to 2006, all rights reserved. */ /* * * Licensed to the Apache Software Foundation (ASF) under one @@ -21,8 +20,6 @@ */ package org.apache.qpid.framing; -import org.apache.log4j.Logger; - import org.apache.qpid.AMQException; import org.apache.qpid.protocol.AMQConstant; @@ -37,14 +34,4 @@ public class AMQFrameDecodingException extends AMQException { super(errorCode, message, t); } - - /*public AMQFrameDecodingException(Logger log, String message) - { - super(log, message); - } - - public AMQFrameDecodingException(Logger log, String message, Throwable t) - { - super(log, message, t); - }*/ } diff --git a/java/common/src/main/java/org/apache/qpid/framing/VersionSpecificRegistry.java b/java/common/src/main/java/org/apache/qpid/framing/VersionSpecificRegistry.java index faa7cc1e82..916b476185 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/VersionSpecificRegistry.java +++ b/java/common/src/main/java/org/apache/qpid/framing/VersionSpecificRegistry.java @@ -20,16 +20,16 @@ */
package org.apache.qpid.framing;
-import org.apache.qpid.framing.abstraction.ProtocolVersionMethodConverter;
-
import org.apache.log4j.Logger;
+
import org.apache.mina.common.ByteBuffer;
+import org.apache.qpid.framing.abstraction.ProtocolVersionMethodConverter;
+
public class VersionSpecificRegistry
{
private static final Logger _log = Logger.getLogger(VersionSpecificRegistry.class);
-
private final byte _protocolMajorVersion;
private final byte _protocolMinorVersion;
@@ -48,26 +48,31 @@ public class VersionSpecificRegistry _protocolVersionConverter = loadProtocolVersionConverters(major, minor);
}
- private static ProtocolVersionMethodConverter loadProtocolVersionConverters(byte protocolMajorVersion, byte protocolMinorVersion)
+ private static ProtocolVersionMethodConverter loadProtocolVersionConverters(byte protocolMajorVersion,
+ byte protocolMinorVersion)
{
try
{
Class<ProtocolVersionMethodConverter> versionMethodConverterClass =
- (Class<ProtocolVersionMethodConverter>) Class.forName("org.apache.qpid.framing.MethodConverter_"+protocolMajorVersion + "_" + protocolMinorVersion);
+ (Class<ProtocolVersionMethodConverter>) Class.forName("org.apache.qpid.framing.MethodConverter_"
+ + protocolMajorVersion + "_" + protocolMinorVersion);
+
return versionMethodConverterClass.newInstance();
}
catch (ClassNotFoundException e)
{
_log.warn("Could not find protocol conversion classes for " + protocolMajorVersion + "-" + protocolMinorVersion);
- if(protocolMinorVersion != 0)
+ if (protocolMinorVersion != 0)
{
protocolMinorVersion--;
+
return loadProtocolVersionConverters(protocolMajorVersion, protocolMinorVersion);
}
else if (protocolMajorVersion != 0)
{
protocolMajorVersion--;
+
return loadProtocolVersionConverters(protocolMajorVersion, protocolMinorVersion);
}
else
@@ -75,7 +80,6 @@ public class VersionSpecificRegistry return null;
}
-
}
catch (IllegalAccessException e)
{
@@ -83,7 +87,7 @@ public class VersionSpecificRegistry }
catch (InstantiationException e)
{
- throw new IllegalStateException("Unable to load protocol version converter: ", e);
+ throw new IllegalStateException("Unable to load protocol version converter: ", e);
}
}
@@ -115,69 +119,68 @@ public class VersionSpecificRegistry public void registerMethod(final short classID, final short methodID, final AMQMethodBodyInstanceFactory instanceFactory)
{
- if(_registry.length <= classID)
+ if (_registry.length <= classID)
{
AMQMethodBodyInstanceFactory[][] oldRegistry = _registry;
- _registry = new AMQMethodBodyInstanceFactory[classID+1][];
+ _registry = new AMQMethodBodyInstanceFactory[classID + 1][];
System.arraycopy(oldRegistry, 0, _registry, 0, oldRegistry.length);
}
- if(_registry[classID] == null)
+ if (_registry[classID] == null)
{
- _registry[classID] = new AMQMethodBodyInstanceFactory[methodID > DEFAULT_MAX_METHOD_ID ? methodID + 1 : DEFAULT_MAX_METHOD_ID + 1];
+ _registry[classID] =
+ new AMQMethodBodyInstanceFactory[(methodID > DEFAULT_MAX_METHOD_ID) ? (methodID + 1)
+ : (DEFAULT_MAX_METHOD_ID + 1)];
}
- else if(_registry[classID].length <= methodID)
+ else if (_registry[classID].length <= methodID)
{
AMQMethodBodyInstanceFactory[] oldMethods = _registry[classID];
- _registry[classID] = new AMQMethodBodyInstanceFactory[methodID+1];
- System.arraycopy(oldMethods,0,_registry[classID],0,oldMethods.length);
+ _registry[classID] = new AMQMethodBodyInstanceFactory[methodID + 1];
+ System.arraycopy(oldMethods, 0, _registry[classID], 0, oldMethods.length);
}
_registry[classID][methodID] = instanceFactory;
}
-
- public AMQMethodBody get(short classID, short methodID, ByteBuffer in, long size)
- throws AMQFrameDecodingException
+ public AMQMethodBody get(short classID, short methodID, ByteBuffer in, long size) throws AMQFrameDecodingException
{
AMQMethodBodyInstanceFactory bodyFactory;
try
{
bodyFactory = _registry[classID][methodID];
}
- catch(NullPointerException e)
+ catch (NullPointerException e)
{
throw new AMQFrameDecodingException(null, "Class " + classID + " unknown in AMQP version " + _protocolMajorVersion
+ "-" + _protocolMinorVersion + " (while trying to decode class " + classID + " method " + methodID + ".", e);
}
- catch(IndexOutOfBoundsException e)
+ catch (IndexOutOfBoundsException e)
{
- if(classID >= _registry.length)
+ if (classID >= _registry.length)
{
throw new AMQFrameDecodingException(null, "Class " + classID + " unknown in AMQP version " + _protocolMajorVersion
+ "-" + _protocolMinorVersion + " (while trying to decode class " + classID + " method " + methodID
+ ".", e);
+
}
else
{
throw new AMQFrameDecodingException(null, "Method " + methodID + " unknown in AMQP version "
+ _protocolMajorVersion + "-" + _protocolMinorVersion + " (while trying to decode class " + classID
+ " method " + methodID + ".", e);
+
}
}
-
if (bodyFactory == null)
{
throw new AMQFrameDecodingException(null, "Method " + methodID + " unknown in AMQP version " + _protocolMajorVersion
+ "-" + _protocolMinorVersion + " (while trying to decode class " + classID + " method " + methodID + ".", null);
}
-
return bodyFactory.newInstance(_protocolMajorVersion, _protocolMinorVersion, classID, methodID, in, size);
-
}
public ProtocolVersionMethodConverter getProtocolVersionMethodConverter()
|
