Skip to content
Browse files

SWITCHYARD-1928 Remove JBoss logging messages from .toString() methods.

  • Loading branch information...
1 parent 8c43c31 commit 27c04f86623718114c96ad01fcfdf95b9426e543 @cunningt cunningt committed with kcbabo Jan 14, 2014
View
23 admin/src/main/java/org/switchyard/admin/AdminMessages.java
@@ -1,7 +1,6 @@
package org.switchyard.admin;
import org.jboss.logging.Messages;
-import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageBundle;
/**
@@ -17,26 +16,4 @@
*/
AdminMessages MESSAGES = Messages.getBundle(AdminMessages.class);
- /**
- * messageMetricsString method definition.
- * @param successCount successCount
- * @param faultCount faultCount
- * @param totalCount totalCount
- * @param averageProcessingTime averageProcessingTime
- * @param minProcessingTime minProcessingTime
- * @param maxProcessingTime maxProcessingTime
- * @param totalProcessingTime totalProcessingTime
- * @return localized message
- */
- @Message(id = 10400, value = "Success Count : %s "
- + "Fault Count : %s"
- + "Total Count : %s"
- + "Avg Time MS : %s"
- + "Min Time MS : %s"
- + "Max Time MS : %s"
- + "Total Time MS : %s")
- String messageMetricsString(String successCount, String faultCount, String totalCount,
- String averageProcessingTime, String minProcessingTime, String maxProcessingTime,
- String totalProcessingTime);
-
}
View
15 admin/src/main/java/org/switchyard/admin/base/MessageMetricsSupport.java
@@ -20,7 +20,6 @@
import org.switchyard.Exchange;
import org.switchyard.ExchangeState;
import org.switchyard.Property;
-import org.switchyard.admin.AdminMessages;
import org.switchyard.admin.MessageMetrics;
import org.switchyard.runtime.event.ExchangeCompletionEvent;
@@ -114,9 +113,15 @@ public int getMinProcessingTime() {
@Override
public String toString() {
- return AdminMessages.MESSAGES.messageMetricsString(getSuccessCount() + NL,
- getFaultCount() + NL, getTotalCount() + NL, getAverageProcessingTime() + NL,
- getMinProcessingTime() + NL, getMaxProcessingTime() + NL,
- getTotalProcessingTime() + NL);
+ return String.format("Success Count : %s%n"
+ + "Fault Count : %s%n"
+ + "Total Count : %s%n"
+ + "Avg Time MS : %s%n"
+ + "Min Time MS : %s%n"
+ + "Max Time MS : %s%n"
+ + "Total Time MS : %s%n", getSuccessCount(),
+ getFaultCount(), getTotalCount(), getAverageProcessingTime(),
+ getMinProcessingTime(), getMaxProcessingTime(),
+ getTotalProcessingTime());
}
}
View
29 api/src/main/java/org/switchyard/APIMessages.java
@@ -1,15 +1,9 @@
package org.switchyard;
-import java.util.Set;
-
-import javax.xml.namespace.QName;
-
import org.jboss.logging.Messages;
import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageBundle;
-import org.switchyard.metadata.ServiceOperation;
-
/**
* <p/>
* This file is using the subset 10000-10199 for logger messages.
@@ -51,28 +45,7 @@
*/
@Message(id = 10006, value = "Invalid policy name: %s doesn't exist.")
Exception invalidPolicyName(String name);
-
- /**
- * baseInterfaceString method definition.
- * @param type type
- * @param operations operations
- * @return String
- */
- @Message(id = 10007, value = "BaseServiceInterface [type=%s, operations=%s]")
- String baseInterfaceString(String type, Set<ServiceOperation> operations);
-
- /**
- * @param name name
- * @param pattern pattern
- * @param inputType inputType
- * @param outputType outputType
- * @param faultType faultType
- * @return String
- */
- @Message(id = 10008, value = "%s : %s : [%s, %s, %s]")
- String baseServiceOperationString(String name, ExchangePattern pattern, QName inputType,
- QName outputType, QName faultType);
-
+
/**
* nullTypeNamePassed method definition.
* @return IllegalArgumentException
View
4 api/src/main/java/org/switchyard/metadata/BaseService.java
@@ -17,8 +17,6 @@
import java.util.HashSet;
import java.util.Set;
-import org.switchyard.APIMessages;
-
/**
* Base implementation of ServiceInterface. Specific interface types such as
* Java and WSDL will extend this class or provide their own implementation of
@@ -108,7 +106,7 @@ public String getType() {
@Override
public String toString() {
- return APIMessages.MESSAGES.baseInterfaceString(_type, _operations);
+ return String.format("BaseServiceInterface [type=%s, operations=%s]", _type, _operations);
}
protected void setType(String type) {
View
3 api/src/main/java/org/switchyard/metadata/BaseServiceOperation.java
@@ -16,7 +16,6 @@
import javax.xml.namespace.QName;
-import org.switchyard.APIMessages;
import org.switchyard.ExchangePattern;
/**
@@ -114,7 +113,7 @@ public String getName() {
@Override
public String toString() {
- return APIMessages.MESSAGES.baseServiceOperationString(_name, _pattern, getInputType(),
+ return String.format("%s : %s : [%s, %s, %s]", _name, _pattern, getInputType(),
getOutputType(), getFaultType());
}
View
27 bus/camel/src/main/java/org/switchyard/bus/camel/BusMessages.java
@@ -1,15 +1,12 @@
package org.switchyard.bus.camel;
-import java.util.List;
import java.util.Set;
import javax.xml.namespace.QName;
-import org.apache.camel.Processor;
import org.jboss.logging.Messages;
import org.jboss.logging.annotations.Cause;
import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageBundle;
-import org.switchyard.ExchangeHandler;
import org.switchyard.SwitchYardException;
/**
@@ -59,30 +56,6 @@
SwitchYardException failedToCreateRoute(QName name, @Cause Exception e);
/**
- * faultProcessorString method definition.
- * @param processor processor
- * @return String
- */
- @Message(id = 10804, value = "FaultProcessor [%s]")
- String faultProcessorString(Processor processor);
-
- /**
- * handlerProcessorString method definition.
- * @param handlers handlers
- * @return String
- */
- @Message(id = 10805, value = "HandlerProcessor [%s]")
- String handlerProcessorString(List<ExchangeHandler> handlers);
-
- /**
- * providerProcessorString method definition.
- * @param hashCode hashCode
- * @return String
- */
- @Message(id = 10806, value = "ProviderProcessor@ %d")
- String providerProcessorString(int hashCode);
-
- /**
* methodMustBeOverridden method definition.
* @return AbstractMethodError
*/
View
3 bus/camel/src/main/java/org/switchyard/bus/camel/audit/FaultProcessor.java
@@ -20,7 +20,6 @@
import org.jboss.logging.Logger;
import org.switchyard.bus.camel.CamelExchange;
import org.switchyard.bus.camel.BusLogger;
-import org.switchyard.bus.camel.BusMessages;
/**
* This processor catches exceptions from camel thrown during handling fault replies
@@ -74,7 +73,7 @@ protected void handle(Throwable throwable, Exchange exchange) {
@Override
public String toString() {
- return BusMessages.MESSAGES.faultProcessorString(getProcessor());
+ return String.format("FaultProcessor [%s]", getProcessor());
}
}
View
3 bus/camel/src/main/java/org/switchyard/bus/camel/processors/HandlerProcessor.java
@@ -21,7 +21,6 @@
import org.switchyard.ExchangeHandler;
import org.switchyard.ExchangeState;
import org.switchyard.bus.camel.CamelExchange;
-import org.switchyard.bus.camel.BusMessages;
/**
* Processor wrapping SwitchYard {@link ExchangeHandler} invocation.
@@ -66,7 +65,7 @@ public void process(Exchange ex) throws Exception {
@Override
public String toString() {
- return BusMessages.MESSAGES.handlerProcessorString(_handlers);
+ return String.format("HandlerProcessor [%s]", _handlers);
}
}
View
3 bus/camel/src/main/java/org/switchyard/bus/camel/processors/ProviderProcessor.java
@@ -16,7 +16,6 @@
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.switchyard.bus.camel.CamelExchange;
-import org.switchyard.bus.camel.BusMessages;
/**
* Processor calling service provider.
@@ -31,7 +30,7 @@ public void process(Exchange ex) throws Exception {
@Override
public String toString() {
- return BusMessages.MESSAGES.providerProcessorString(System.identityHashCode(this));
+ return String.format("ProviderProcessor@ %d", System.identityHashCode(this));
}
}
View
42 common/core/src/main/java/org/switchyard/common/CommonCoreMessages.java
@@ -1,7 +1,6 @@
package org.switchyard.common;
import java.io.IOException;
-import java.util.Collection;
import org.jboss.logging.Messages;
import org.jboss.logging.annotations.Message;
@@ -28,47 +27,6 @@
IllegalArgumentException nameNull();
/**
- * compoundClassLoaderString method definition.
- * @param loaders loaders
- * @return Localized string
- */
- @Message(id = 11401, value = "CompoundClassloader %s")
- String compoundClassLoaderString(Collection<ClassLoader> loaders);
-
- /**
- * methodAccessString method definition.
- * @param name name
- * @param klass klass
- * @param readable readable
- * @param writeable writeable
- * @return Localized string
- */
- @Message(id = 11402, value = "MethodAccess(name=%s, type=%s, readable=%b, writeable=%b)")
- String methodAccessString(String name, String klass, boolean readable, boolean writeable);
-
- /**
- * fieldAccessString method definition.
- * @param name name
- * @param klass klass
- * @param readable readable
- * @param writeable writeable
- * @return Localized string
- */
- @Message(id = 11403, value = "FieldAccess(name=%s, type=%s, readable=%b, writeable=%b)")
- String fieldAccessString(String name, String klass, boolean readable, boolean writeable);
-
- /**
- * beanAccessString method definition.
- * @param name name
- * @param klass klass
- * @param readable readable
- * @param writeable writeable
- * @return Localized string
- */
- @Message(id = 11404, value = "BeanAccess(name=%s, type=%s, readable=%b, writeable=%b)")
- String beanAccessString(String name, String klass, boolean readable, boolean writeable);
-
- /**
* invalidCall method definition.
* @return RuntimeException
*/
View
4 common/core/src/main/java/org/switchyard/common/type/CompoundClassLoader.java
@@ -23,8 +23,6 @@
import java.util.Enumeration;
import java.util.List;
-import org.switchyard.common.CommonCoreMessages;
-
/**
* A ClassLoader implementation that iterates over a collection of other ClassLoaders until it finds everything it's looking for.
*
@@ -136,6 +134,6 @@ public InputStream getResourceAsStream(String name) {
@Override
public String toString() {
- return CommonCoreMessages.MESSAGES.compoundClassLoaderString(_loaders);
+ return String.format("CompoundClassloader %s", _loaders);
}
}
View
5 common/core/src/main/java/org/switchyard/common/type/reflect/BeanAccess.java
@@ -17,8 +17,6 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
-import org.switchyard.common.CommonCoreMessages;
-
/**
* Access via a wrapped PropertyDescriptor.
*
@@ -111,7 +109,8 @@ public void write(Object target, T value) {
public String toString() {
Class<?> clazz = getType();
String type = clazz != null ? clazz.getSimpleName() : null;
- return CommonCoreMessages.MESSAGES.beanAccessString(getName(), type, isReadable(), isWriteable());
+ return String.format("MethodAccess(name=%s, type=%s, readable=%b, writeable=%b)",
+ getName(), type, isReadable(), isWriteable());
}
}
View
4 common/core/src/main/java/org/switchyard/common/type/reflect/FieldAccess.java
@@ -17,7 +17,6 @@
import java.lang.reflect.Modifier;
import org.switchyard.common.lang.Strings;
-import org.switchyard.common.CommonCoreMessages;
/**
* Access via a wrapped Field.
@@ -132,7 +131,8 @@ public void write(Object target, T value) {
public String toString() {
Class<?> clazz = getType();
String type = clazz != null ? clazz.getSimpleName() : null;
- return CommonCoreMessages.MESSAGES.fieldAccessString(getName(), type, isReadable(), isWriteable());
+ return String.format("FieldAccess(name=%s, type=%s, readable=%b, writeable=%b)",
+ getName(), type, isReadable(), isWriteable());
}
}
View
4 common/core/src/main/java/org/switchyard/common/type/reflect/MethodAccess.java
@@ -17,7 +17,6 @@
import java.lang.reflect.Method;
import org.switchyard.common.lang.Strings;
-import org.switchyard.common.CommonCoreMessages;
/**
* Access via wrapped read and write Methods.
@@ -186,7 +185,8 @@ public void write(Object target, T value) {
public String toString() {
Class<?> clazz = getType();
String type = clazz != null ? clazz.getSimpleName() : null;
- return CommonCoreMessages.MESSAGES.methodAccessString(getName(), type, isReadable(), isWriteable());
+ return String.format("MethodAccess(name=%s, type=%s, readable=%b, writeable=%b)",
+ getName(), type, isReadable(), isWriteable());
}
}
View
13 config/src/main/java/org/switchyard/config/ConfigMessages.java
@@ -1,9 +1,5 @@
package org.switchyard.config;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
import org.jboss.logging.Messages;
import org.jboss.logging.annotations.Cause;
import org.jboss.logging.annotations.Message;
@@ -23,15 +19,6 @@
ConfigMessages MESSAGES = Messages.getBundle(ConfigMessages.class);
/**
- * configurationString method definition.
- * @param qname qname
- * @param ids ids
- * @return Localized string
- */
- @Message(id = 11600, value = "Key [_qname=%s, _ids=%s]")
- String configurationString(QName qname, Map<String,Object> ids);
-
- /**
* cannotFindMarshaller method definition.
* @param marshaller marshaller
* @param loader loader
View
2 config/src/main/java/org/switchyard/config/Configurations.java
@@ -233,7 +233,7 @@ private Key(Configuration config) {
*/
@Override
public String toString() {
- return ConfigMessages.MESSAGES.configurationString(_qname, _ids);
+ return String.format("Key [_qname=%s, _ids=%s]", _qname, _ids);
}
/**

0 comments on commit 27c04f8

Please sign in to comment.
Something went wrong with that request. Please try again.