diff options
author | Robert Greig <rgreig@apache.org> | 2007-04-09 11:25:32 +0000 |
---|---|---|
committer | Robert Greig <rgreig@apache.org> | 2007-04-09 11:25:32 +0000 |
commit | b8b2e032a4a6a6ad796ce6247c581a0498b5c264 (patch) | |
tree | 88a0d86fd30edcae6f50ad96e857b939d4ada67c /java/client/example/src | |
parent | da5b82c87e2487c1e3beb9260bad5b8e39f1639f (diff) | |
download | qpid-python-b8b2e032a4a6a6ad796ce6247c581a0498b5c264.tar.gz |
Purged logging from exception constructors.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/M2@526714 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/client/example/src')
5 files changed, 35 insertions, 104 deletions
diff --git a/java/client/example/src/main/java/org/apache/qpid/example/publisher/MessageFactoryException.java b/java/client/example/src/main/java/org/apache/qpid/example/publisher/MessageFactoryException.java index 34360d6708..0a4231c977 100644 --- a/java/client/example/src/main/java/org/apache/qpid/example/publisher/MessageFactoryException.java +++ b/java/client/example/src/main/java/org/apache/qpid/example/publisher/MessageFactoryException.java @@ -1,4 +1,5 @@ /* + * * 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 @@ -6,21 +7,21 @@ * 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. + * */ package org.apache.qpid.example.publisher; -import org.apache.log4j.Logger; - -public class MessageFactoryException extends Exception { +public class MessageFactoryException extends Exception +{ private int _errorCode; @@ -46,27 +47,8 @@ public class MessageFactoryException extends Exception { _errorCode = errorCode; } - public MessageFactoryException(Logger logger, String msg, Throwable t) - { - this(msg, t); - logger.error(getMessage(), this); - } - - public MessageFactoryException(Logger logger, String msg) - { - this(msg); - logger.error(getMessage(), this); - } - - public MessageFactoryException(Logger logger, int errorCode, String msg) - { - this(errorCode, msg); - logger.error(getMessage(), this); - } - public int getErrorCode() { return _errorCode; } } - diff --git a/java/client/example/src/main/java/org/apache/qpid/example/publisher/UndeliveredMessageException.java b/java/client/example/src/main/java/org/apache/qpid/example/publisher/UndeliveredMessageException.java index 3335833c2d..399cbc9427 100644 --- a/java/client/example/src/main/java/org/apache/qpid/example/publisher/UndeliveredMessageException.java +++ b/java/client/example/src/main/java/org/apache/qpid/example/publisher/UndeliveredMessageException.java @@ -1,4 +1,5 @@ /* + * * 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 @@ -6,24 +7,24 @@ * 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. + * */ package org.apache.qpid.example.publisher; -import org.apache.log4j.Logger; - /** * Exception thrown by monitor when cannot send a message marked for immediate delivery */ -public class UndeliveredMessageException extends Exception { +public class UndeliveredMessageException extends Exception +{ private int _errorCode; @@ -49,24 +50,6 @@ public class UndeliveredMessageException extends Exception { _errorCode = errorCode; } - public UndeliveredMessageException(Logger logger, String msg, Throwable t) - { - this(msg, t); - logger.error(getMessage(), this); - } - - public UndeliveredMessageException(Logger logger, String msg) - { - this(msg); - logger.error(getMessage(), this); - } - - public UndeliveredMessageException(Logger logger, int errorCode, String msg) - { - this(errorCode, msg); - logger.error(getMessage(), this); - } - public int getErrorCode() { return _errorCode; diff --git a/java/client/example/src/main/java/org/apache/qpid/example/shared/ConnectionException.java b/java/client/example/src/main/java/org/apache/qpid/example/shared/ConnectionException.java index 8723983862..6eb847ea9d 100644 --- a/java/client/example/src/main/java/org/apache/qpid/example/shared/ConnectionException.java +++ b/java/client/example/src/main/java/org/apache/qpid/example/shared/ConnectionException.java @@ -1,4 +1,5 @@ /* + * * 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 @@ -6,21 +7,21 @@ * 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. + * */ package org.apache.qpid.example.shared; -import org.apache.log4j.Logger; - -public class ConnectionException extends Exception { +public class ConnectionException extends Exception +{ private int _errorCode; @@ -46,24 +47,6 @@ public class ConnectionException extends Exception { _errorCode = errorCode; } - public ConnectionException(Logger logger, String msg, Throwable t) - { - this(msg, t); - logger.error(getMessage(), this); - } - - public ConnectionException(Logger logger, String msg) - { - this(msg); - logger.error(getMessage(), this); - } - - public ConnectionException(Logger logger, int errorCode, String msg) - { - this(errorCode, msg); - logger.error(getMessage(), this); - } - public int getErrorCode() { return _errorCode; diff --git a/java/client/example/src/main/java/org/apache/qpid/example/shared/ContextException.java b/java/client/example/src/main/java/org/apache/qpid/example/shared/ContextException.java index 787cecd541..bf805ab817 100644 --- a/java/client/example/src/main/java/org/apache/qpid/example/shared/ContextException.java +++ b/java/client/example/src/main/java/org/apache/qpid/example/shared/ContextException.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,9 +20,8 @@ */ package org.apache.qpid.example.shared; -import org.apache.log4j.Logger; - -public class ContextException extends Exception { +public class ContextException extends Exception +{ private int _errorCode; @@ -48,24 +47,6 @@ public class ContextException extends Exception { _errorCode = errorCode; } - public ContextException(Logger logger, String msg, Throwable t) - { - this(msg, t); - logger.error(getMessage(), this); - } - - public ContextException(Logger logger, String msg) - { - this(msg); - logger.error(getMessage(), this); - } - - public ContextException(Logger logger, int errorCode, String msg) - { - this(errorCode, msg); - logger.error(getMessage(), this); - } - public int getErrorCode() { return _errorCode; diff --git a/java/client/example/src/main/java/org/apache/qpid/example/shared/InitialContextHelper.java b/java/client/example/src/main/java/org/apache/qpid/example/shared/InitialContextHelper.java index b39892b688..8505d1d457 100644 --- a/java/client/example/src/main/java/org/apache/qpid/example/shared/InitialContextHelper.java +++ b/java/client/example/src/main/java/org/apache/qpid/example/shared/InitialContextHelper.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,18 +20,20 @@ */ package org.apache.qpid.example.shared; -import org.apache.log4j.Logger; +import java.io.IOException; +import java.io.InputStream; +import java.util.Properties; import javax.naming.InitialContext; import javax.naming.NamingException; -import java.util.Properties; -import java.io.InputStream; -import java.io.IOException; + +import org.apache.log4j.Logger; /** * Class that provides helper methods for JNDI */ -public class InitialContextHelper { +public class InitialContextHelper +{ public static final String _defaultPropertiesName = "example.properties"; protected static Properties _fileProperties; @@ -42,7 +44,7 @@ public class InitialContextHelper { { try { - if (propertiesName == null || propertiesName.length() == 0) + if ((propertiesName == null) || (propertiesName.length() == 0)) { propertiesName = _defaultPropertiesName; } @@ -50,18 +52,18 @@ public class InitialContextHelper { _fileProperties = new Properties(); ClassLoader cl = this.getClass().getClassLoader(); - //NB: Need to change path to reflect package if moving classes around ! + // NB: Need to change path to reflect package if moving classes around ! InputStream is = cl.getResourceAsStream("org/apache/qpid/example/shared/" + propertiesName); _fileProperties.load(is); _initialContext = new InitialContext(_fileProperties); } catch (IOException e) { - throw new ContextException(_log, e.toString()); + throw new ContextException(e.toString()); } catch (NamingException n) { - throw new ContextException(_log, n.toString()); + throw new ContextException(n.toString()); } } |