diff --git a/build.third_step1-jdk11.gradle b/build.third_step1-jdk11.gradle index 99b7f7e7d..c318d35b8 100644 --- a/build.third_step1-jdk11.gradle +++ b/build.third_step1-jdk11.gradle @@ -34,7 +34,6 @@ sourceSets{ "${srcDir}/fine-deprecated-utils/src/main/java", "${srcDir}/fine-asm/src/main/java", "${srcDir}/fine-aspectj/src/main/java", - "${srcDir}/fine-classmate/src/main/java", "${srcDir}/fine-commons-math3/src/main/java", "${srcDir}/fine-commons-pool/src/main/java", "${srcDir}/fine-cssparser/src/main/java", @@ -75,8 +74,6 @@ def resourceDirs = [ "${srcDir}/fine-asm/src/main/resources", "${srcDir}/fine-aspectj/src/main/java", "${srcDir}/fine-aspectj/src/main/resources", - "${srcDir}/fine-classmate/src/main/java", - "${srcDir}/fine-classmate/src/main/resources", "${srcDir}/fine-commons-math3/src/main/java", "${srcDir}/fine-commons-math3/src/main/resources", "${srcDir}/fine-commons-pool/src/main/java", diff --git a/build.third_step1.gradle b/build.third_step1.gradle index 9c621d145..ba3d7181d 100644 --- a/build.third_step1.gradle +++ b/build.third_step1.gradle @@ -35,7 +35,6 @@ sourceSets{ "${srcDir}/fine-deprecated-utils/src/main/java", "${srcDir}/fine-asm/src/main/java", "${srcDir}/fine-aspectj/src/main/java", - "${srcDir}/fine-classmate/src/main/java", "${srcDir}/fine-commons-math3/src/main/java", "${srcDir}/fine-commons-pool/src/main/java", "${srcDir}/fine-cssparser/src/main/java", @@ -125,8 +124,6 @@ task copyFiles(type:Copy,dependsOn:'compileJava'){ with dataContent.call("${srcDir}/fine-asm/src/main/resources") with dataContent.call("${srcDir}/fine-aspectj/src/main/java") with dataContent.call("${srcDir}/fine-aspectj/src/main/resources") - with dataContent.call("${srcDir}/fine-classmate/src/main/java") - with dataContent.call("${srcDir}/fine-classmate/src/main/resources") with dataContent.call("${srcDir}/fine-commons-math3/src/main/java") with dataContent.call("${srcDir}/fine-commons-math3/src/main/resources") with dataContent.call("${srcDir}/fine-commons-pool/src/main/java") diff --git a/build.third_step3-jdk11.gradle b/build.third_step3-jdk11.gradle index fc3ae0ee1..b2e032bb7 100644 --- a/build.third_step3-jdk11.gradle +++ b/build.third_step3-jdk11.gradle @@ -31,8 +31,7 @@ sourceSets{ java{ srcDirs=[ "${srcDir}/fine-itext/src/main/java", - "${srcDir}/fine-jedis/src/main/java", - "${srcDir}/fine-jboss-logging/src/main/java" + "${srcDir}/fine-jedis/src/main/java" ] } } @@ -43,9 +42,7 @@ def resourceDirs = [ "${srcDir}/fine-itext/src/main/java", "${srcDir}/fine-itext/src/main/resources", "${srcDir}/fine-jedis/src/main/java", - "${srcDir}/fine-jedis/src/main/resources", - "${srcDir}/fine-jboss-logging/src/main/java", - "${srcDir}/fine-jboss-logging/src/main/resources" + "${srcDir}/fine-jedis/src/main/resources" ] sourceSets.main.java.outputDir = file('build/classes/3') @@ -78,7 +75,6 @@ String essentialVersion = findProperty("essentialVersion") //指定依赖 dependencies{ compileOnly "com.fr.essential:fine-essential:${essentialVersion}" - compile fileTree(dir:"${srcDir}/fine-jboss-logging/lib",include:'**/*.jar') compile fileTree(dir:"${srcDir}/build/libs/",include:'**/*.jar') compile fileTree(dir:System.getenv("JAVA_HOME"),include:"lib/tools.jar") compile group: "com.fr.third.server", name: "servlet-api", version: "3.0" diff --git a/build.third_step3.gradle b/build.third_step3.gradle index cb237ec7f..29309dd53 100644 --- a/build.third_step3.gradle +++ b/build.third_step3.gradle @@ -25,8 +25,7 @@ sourceSets{ java{ srcDirs=[ "${srcDir}/fine-itext/src/main/java", - "${srcDir}/fine-jedis/src/main/java", - "${srcDir}/fine-jboss-logging/src/main/java" + "${srcDir}/fine-jedis/src/main/java" ] } } @@ -59,7 +58,6 @@ String essentialVersion = findProperty("essentialVersion") //指定依赖 dependencies{ compileOnly "com.fr.essential:fine-essential:${essentialVersion}" - compile fileTree(dir:"${srcDir}/fine-jboss-logging/lib",include:'**/*.jar') compile fileTree(dir:"${srcDir}/build/libs/",include:'**/*.jar') compile fileTree(dir:System.getenv("JAVA_HOME"),include:"lib/tools.jar") compile group: "javax.servlet", name: "javax.servlet-api", version: "3.0.1" @@ -85,8 +83,6 @@ task copyFiles(type:Copy,dependsOn:'compileJava'){ with dataContent.call("${srcDir}/fine-itext/src/main/resources") with dataContent.call("${srcDir}/fine-jedis/src/main/java") with dataContent.call("${srcDir}/fine-jedis/src/main/resources") - with dataContent.call("${srcDir}/fine-jboss-logging/src/main/java") - with dataContent.call("${srcDir}/fine-jboss-logging/src/main/resources") into "${classesDir}" } } diff --git a/fine-classmate/.gitignore b/fine-classmate/.gitignore deleted file mode 100644 index 5d453cd8b..000000000 --- a/fine-classmate/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -*.iml -.idea/ -.DS_Store -.project -.classpath -*.gradle \ No newline at end of file diff --git a/fine-classmate/README.md b/fine-classmate/README.md deleted file mode 100644 index a8396408a..000000000 --- a/fine-classmate/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# fine-classmate - -改包名的classmate(1.3.0),以下模块需要依赖该模块: - -- fine-hibernate - diff --git a/fine-classmate/pom.xml b/fine-classmate/pom.xml deleted file mode 100644 index 7acef86fe..000000000 --- a/fine-classmate/pom.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - 4.0.0 - - - com.fr.third - step1 - ${revision} - ../base-third-project/base-third-step1 - - - fine-classmate - ${revision} - - - \ No newline at end of file diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/AnnotationConfiguration.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/AnnotationConfiguration.java deleted file mode 100644 index bffd21384..000000000 --- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/AnnotationConfiguration.java +++ /dev/null @@ -1,115 +0,0 @@ -package com.fr.third.com.fasterxml.classmate; - -import java.io.Serializable; -import java.lang.annotation.Annotation; -import java.util.*; - -import com.fr.third.com.fasterxml.classmate.util.ClassKey; - -/** - * Interface for object that determines handling of annotations in regards - * to inheritance, overrides. - */ -@SuppressWarnings("serial") -public abstract class AnnotationConfiguration implements Serializable -{ - /** - * Method called to figure out how to handle instances of specified annotation - * type when used as class annotation. - */ - public abstract AnnotationInclusion getInclusionForClass(Class annotationType); - - /** - * Method called to figure out how to handle instances of specified annotation - * type when used as constructor annotation. - *

- * Note that constructor annotations can never be inherited so this just determines - * between inclusion or non-inclusion. - */ - public abstract AnnotationInclusion getInclusionForConstructor(Class annotationType); - - /** - * Method called to figure out how to handle instances of specified annotation - * type when used as field annotation. - *

- * Note that field annotations can never be inherited so this just determines - * between inclusion or non-inclusion. - */ - public abstract AnnotationInclusion getInclusionForField(Class annotationType); - - /** - * Method called to figure out how to handle instances of specified annotation - * type when used as method annotation. - *

- * Note that method annotations can be inherited for member methods, but not for static - * methods; for static methods thereby this just determines between inclusion and - * non-inclusion. - */ - public abstract AnnotationInclusion getInclusionForMethod(Class annotationType); - - /** - * Method called to figure out how to handle instances of specified annotation - * type when used as parameter annotation. - *

- * Note that parameter annotations can be inherited for member methods, but not for static - * methods; for static methods thereby this just determines between inclusion and - * non-inclusion. - */ - public abstract AnnotationInclusion getInclusionForParameter(Class annotationType); - - /** - * Simple implementation that can be configured with default behavior - * for unknown annotations, as well as explicit behaviors for - * enumerated annotation types. Same default is used for both class and - * member method annotations (constructor, field and static method - * annotations are never inherited) - */ - public static class StdConfiguration extends AnnotationConfiguration implements Serializable - { - protected final AnnotationInclusion _defaultInclusion; - - protected final HashMap _inclusions = new HashMap(); - - public StdConfiguration(AnnotationInclusion defaultBehavior) - { - _defaultInclusion = defaultBehavior; - } - - @Override - public AnnotationInclusion getInclusionForClass(Class annotationType) { - return _inclusionFor(annotationType); - } - - @Override - public AnnotationInclusion getInclusionForConstructor(Class annotationType) { - return _inclusionFor(annotationType); - } - - @Override - public AnnotationInclusion getInclusionForField(Class annotationType) { - return getInclusionForClass(annotationType); - } - - @Override - public AnnotationInclusion getInclusionForMethod(Class annotationType) { - return getInclusionForClass(annotationType); - } - - @Override - public AnnotationInclusion getInclusionForParameter(Class annotationType) { - return getInclusionForClass(annotationType); - } - - public void setInclusion(Class annotationType, AnnotationInclusion incl) - { - _inclusions.put(new ClassKey(annotationType), incl); - } - - protected AnnotationInclusion _inclusionFor(Class annotationType) - { - ClassKey key = new ClassKey(annotationType); - AnnotationInclusion beh = _inclusions.get(key); - return (beh == null) ? _defaultInclusion : beh; - } - } -} diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/AnnotationInclusion.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/AnnotationInclusion.java deleted file mode 100644 index d8be03f3a..000000000 --- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/AnnotationInclusion.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.fr.third.com.fasterxml.classmate; - -/** - * Enumeration that defines different settings for handling behavior - * of individual annotations - */ -public enum AnnotationInclusion -{ - /** - * Value that indicates that annotation is to be ignored, not included - * in resolved bean information. - * Applicable to all member types. - */ - DONT_INCLUDE, - - /** - * Value that indicates that annotation is to be included in results, but - * only if directly associated with included member (or attached mix-in); - * will not inherit from supertypes. - * Applicable only to member methods; if used with other members will - * mean basic inclusion. - */ - INCLUDE_BUT_DONT_INHERIT, - - /** - * Value that indicates that annotation is to be included in results, and - * values from overridden members are inherited only if the annotation is - * marked with the {@link java.lang.annotation.Inherited} annotation. - * Applicable only to member methods; if used with other members will - * mean basic inclusion. - */ - INCLUDE_AND_INHERIT_IF_INHERITED, - - /** - * Value that indicates that annotation is to be included in results; and - * values from overridden members are also inherited if not overridden - * by members of subtypes. - * Note that inheritance only matters with member methods; for other types - * it just means "include". - */ - INCLUDE_AND_INHERIT - ; - -} diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/AnnotationOverrides.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/AnnotationOverrides.java deleted file mode 100644 index 74a0f6c7c..000000000 --- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/AnnotationOverrides.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.fr.third.com.fasterxml.classmate; - -import java.io.Serializable; -import java.util.*; - -import com.fr.third.com.fasterxml.classmate.util.ClassKey; - -/** - * Interface for object that can provide mix-ins to override annotations. - */ -@SuppressWarnings("serial") -public abstract class AnnotationOverrides implements Serializable -{ - /* - /********************************************************************** - /* Public API - /********************************************************************** - */ - - /** - * Method called to find out which class(es) are to be used as source - * for annotations to mix in for given type. - * - * @return List of mix-in sources (starting with highest priority); - * can be null or empty list if no mix-ins are to be used. - */ - public List> mixInsFor(Class beanClass) { - return mixInsFor(new ClassKey(beanClass)); - } - - public abstract List> mixInsFor(ClassKey beanClass); - - /** - * Method for constructing builder for creating simple overrides provider - * that just uses direct assignments (target-to-override classes) - */ - public static StdBuilder builder() { - return new StdBuilder(); - } - - /* - /********************************************************************** - /* Helper types - /********************************************************************** - */ - - /** - * To make it easy to use simple override implementation (where overrides - * are direct and explicit), here is a build that allow constructing - * such override instance. - */ - public static class StdBuilder - { - protected final HashMap>> _targetsToOverrides = new HashMap>>(); - - public StdBuilder() { } - - public StdBuilder add(Class target, Class mixin) { - return add(new ClassKey(target), mixin); - } - - public StdBuilder add(ClassKey target, Class mixin) - { - List> mixins = _targetsToOverrides.get(target); - if (mixins == null) { - mixins = new ArrayList>(); - _targetsToOverrides.put(target, mixins); - } - mixins.add(mixin); - return this; - } - - /** - * Method that will construct a {@link AnnotationOverrides} instance using - * mappings that have been added using this builder - */ - public AnnotationOverrides build() { - return new StdImpl(_targetsToOverrides); - } - } - - /** - * Simple implementation configured with explicit associations with - * target class as key, and overrides as ordered list of classes - * (with first entry having precedence over later ones). - */ - public static class StdImpl extends AnnotationOverrides - { - protected final HashMap>> _targetsToOverrides; - - public StdImpl(HashMap>> overrides) { - _targetsToOverrides = new HashMap>>(overrides); - } - - @Override - public List> mixInsFor(ClassKey target) { - return _targetsToOverrides.get(target); - } - } -} diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/Annotations.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/Annotations.java deleted file mode 100644 index 3a5261ccf..000000000 --- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/Annotations.java +++ /dev/null @@ -1,132 +0,0 @@ -package com.fr.third.com.fasterxml.classmate; - -import java.io.Serializable; -import java.lang.annotation.Annotation; -import java.util.*; - -/** - * Container class used for storing set of annotations resolved for types (classes) - * as members (methods, fields, constructors). - * - * @author tatu - */ -@SuppressWarnings("serial") -public class Annotations implements Serializable, Iterable -{ - private final Annotation[] NO_ANNOTATIONS = new Annotation[0]; - - protected LinkedHashMap,Annotation> _annotations; - - /* - /********************************************************************** - /* Life-cycle - /********************************************************************** - */ - - public Annotations() { } - - /** - * Method for adding specified annotation, overriding existing value - * for the annotation type. - */ - public void add(Annotation override) - { - if (_annotations == null) { - _annotations = new LinkedHashMap,Annotation>(); - } - _annotations.put(override.annotationType(), override); - } - - /** - * Method for adding all annotations from specified set, as overrides - * to annotations this set has - */ - public void addAll(Annotations overrides) - { - if (_annotations == null) { - _annotations = new LinkedHashMap,Annotation>(); - } - for (Annotation override : overrides._annotations.values()) { - _annotations.put(override.annotationType(), override); - } - } - - /** - * Method for adding specified annotation if and only if no value - * exists for the annotation type. - */ - public void addAsDefault(Annotation defValue) - { - Class type = defValue.annotationType(); - if (_annotations == null) { - _annotations = new LinkedHashMap,Annotation>(); - _annotations.put(type, defValue); - } else if (!_annotations.containsKey(type)) { - _annotations.put(type, defValue); - } - } - - /* - /********************************************************************** - /* Accessors - /********************************************************************** - */ - - @Override - public Iterator iterator() - { - if (_annotations == null) { - _annotations = new LinkedHashMap,Annotation>(); - } - return _annotations.values().iterator(); - } - - public int size() { - return (_annotations == null) ? 0 : _annotations.size(); - } - - @SuppressWarnings("unchecked") - public A get(Class cls) - { - if (_annotations == null) { - return null; - } - return (A) _annotations.get(cls); - } - - /** - * @since 1.1.1 - */ - public Annotation[] asArray() { - if (_annotations == null || _annotations.isEmpty()) { - return NO_ANNOTATIONS; - } - return _annotations.values().toArray(new Annotation[_annotations.size()]); - } - - /** - * @since 1.1.1 - */ - public List asList() { - if (_annotations == null || _annotations.isEmpty()) { - return Collections.emptyList(); - } - List l = new ArrayList(_annotations.size()); - l.addAll(_annotations.values()); - return l; - } - - /* - /********************************************************************** - /* Standard method overrides - /********************************************************************** - */ - - @Override public String toString() - { - if (_annotations == null) { - return "[null]"; - } - return _annotations.toString(); - } -} diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/Filter.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/Filter.java deleted file mode 100644 index 721cd26bb..000000000 --- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/Filter.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.fr.third.com.fasterxml.classmate; - -/** - * Interface that defines API for basic filtering objects, used to prune set - * of things to include in result sets like flattened member lists. - */ -public interface Filter -{ - public boolean include(T element); -} diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/GenericType.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/GenericType.java deleted file mode 100644 index a2aae0db1..000000000 --- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/GenericType.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.fr.third.com.fasterxml.classmate; - -import java.io.Serializable; - -/** - * This class is used to pass full generics type information, and - * avoid problems with type erasure (that basically removes most - * usable type references from runtime Class objects). - * It is based on ideas from - * http://gafter.blogspot.com/2006/12/super-type-tokens.html, - *

- * Usage is by sub-classing: here is one way to instantiate reference - * to generic type List<Integer>: - *

- *  GenericType type = new GenericType<List<Integer>>() { };
- *
- * which can be passed to methods that accept GenericReference. - */ -@SuppressWarnings("serial") -public abstract class GenericType - implements Serializable, java.lang.reflect.Type -{ - protected GenericType() { } -} diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/MemberResolver.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/MemberResolver.java deleted file mode 100644 index 9fedb3cc6..000000000 --- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/MemberResolver.java +++ /dev/null @@ -1,238 +0,0 @@ -package com.fr.third.com.fasterxml.classmate; - -import java.io.Serializable; -import java.util.*; - -import com.fr.third.com.fasterxml.classmate.members.RawField; -import com.fr.third.com.fasterxml.classmate.util.ClassKey; -import com.fr.third.com.fasterxml.classmate.members.HierarchicType; -import com.fr.third.com.fasterxml.classmate.members.RawConstructor; -import com.fr.third.com.fasterxml.classmate.members.RawMethod; - -/** - * Builder class used to completely resolve members (fields, methods, - * constructors) of {@link ResolvedType}s (generics-aware classes). - */ -@SuppressWarnings("serial") -public class MemberResolver implements Serializable -{ - - /** - * Type resolved needed for resolving types of member objects - * (method argument and return; field types; constructor argument types) - */ - protected final TypeResolver _typeResolver; - - /* - /********************************************************************** - /* Modifiable configuration - /********************************************************************** - */ - - /** - * Configuration setting that determines whether members from - * {@link java.lang.Object} are included or not; by default - * false meaning that they are not. - */ - protected boolean _cfgIncludeLangObject; - - /** - * Filter used for determining whether given - * field (static or member) - * is to be included in aggregation of all - * fields. - */ - protected Filter _fieldFilter; - - /** - * Filter used for determining whether given - * method (static or member) - * is to be included in aggregation of all - * methods. - */ - protected Filter _methodFilter; - - /** - * Filter used for determining whether given - * constructor - * is to be included in aggregation of all - * constructors. - */ - protected Filter _constructorFilter; - - /* - /********************************************************************** - /* Life cycle (construct and config) - /********************************************************************** - */ - - /** - * Constructor for resolver that does not include java.lang.Object - * in type hierarchy - */ - public MemberResolver(TypeResolver typeResolver) - { - _typeResolver = typeResolver; - } - - /** - * Configuration method for specifying whether members of java.lang.Object - * are to be included in resolution; if false, no members from {@link java.lang.Object} - * are to be included; if true, will be included. - */ - public MemberResolver setIncludeLangObject(boolean state) { - _cfgIncludeLangObject = state; - return this; - } - - public MemberResolver setFieldFilter(Filter f) { - _fieldFilter = f; - return this; - } - - public MemberResolver setMethodFilter(Filter f) { - _methodFilter = f; - return this; - } - - public MemberResolver setConstructorFilter(Filter f) { - _constructorFilter = f; - return this; - } - - /* - /********************************************************************** - /* Public API - /********************************************************************** - */ - - /** - * Method for constructing hierarchy object needed to fully resolve - * member information, including basic type flattening as well as - * addition of mix-in types in appropriate positions. - * - * @param mainType Resolved type that is the starting point (i.e. the leaf class) - * for member resolution. - * @param annotationConfig Configuration of annotation types; which ones to include, how to inherit - * @param annotationOverrides Definitions of annotation overrides to use, if any (may be null) - */ - public ResolvedTypeWithMembers resolve(final ResolvedType mainType, - AnnotationConfiguration annotationConfig, - AnnotationOverrides annotationOverrides) - { - // First: flatten basic type hierarchy (highest to lowest precedence) - HashSet seenTypes = new HashSet(); - ArrayList types = new ArrayList(); - _gatherTypes(mainType, seenTypes, types); - - // Second step: inject mix-ins (keeping order from highest to lowest) - HierarchicType[] htypes; - HierarchicType mainHierarchicType = null; - - // Third step: add mix-ins (if any), reverse order (lowest to highest precedence) - if (annotationOverrides == null) { // just create hierarchic instances: - int len = types.size(); - htypes = new HierarchicType[len]; - for (int i = 0; i < len; ++i) { - // false -> not a mix-in - htypes[i] = new HierarchicType(types.get(i), false, i); - } - mainHierarchicType = htypes[0]; - } else { // need to add mix-ins, reorder - ArrayList typesWithMixins = new ArrayList(); - for (ResolvedType type : types) { - // First add mix-ins (which override type itself) - List> m = annotationOverrides.mixInsFor(type.getErasedType()); - if (m != null) { - for (Class mixinClass : m) { - _addOverrides(typesWithMixins, seenTypes, mixinClass); - } - } - - // Then actual type: - HierarchicType ht = new HierarchicType(type, false, typesWithMixins.size()); - if (mainHierarchicType == null) { - mainHierarchicType = ht; - } - typesWithMixins.add(ht); - } - htypes = typesWithMixins.toArray(new HierarchicType[typesWithMixins.size()]); - } - // And that's about all we need to do; rest computed lazily - return new ResolvedTypeWithMembers(_typeResolver, annotationConfig, mainHierarchicType, htypes, - _constructorFilter, _fieldFilter, _methodFilter); - } - - private void _addOverrides(List typesWithOverrides, Set seenTypes, Class override) - { - ClassKey key = new ClassKey(override); - if (!seenTypes.contains(key)) { - seenTypes.add(key); - ResolvedType resolvedOverride = _typeResolver.resolve(override); - typesWithOverrides.add(new HierarchicType(resolvedOverride, true, typesWithOverrides.size())); - for (ResolvedType r : resolvedOverride.getImplementedInterfaces()) { // interfaces? - _addOverrides(typesWithOverrides, seenTypes, r); - } - ResolvedType superClass = resolvedOverride.getParentClass(); - _addOverrides(typesWithOverrides, seenTypes, superClass); - } - } - - private void _addOverrides(List typesWithOverrides, Set seenTypes, ResolvedType override) - { - if (override == null) return; - // first: may need to exclude Object.class: - Class raw = override.getErasedType(); - if (!_cfgIncludeLangObject && Object.class == raw) return; - ClassKey key = new ClassKey(raw); - if (!seenTypes.contains(key)) { - seenTypes.add(key); - typesWithOverrides.add(new HierarchicType(override, true, typesWithOverrides.size())); - for (ResolvedType r : override.getImplementedInterfaces()) { // interfaces? - _addOverrides(typesWithOverrides, seenTypes, r); - } - ResolvedType superClass = override.getParentClass(); - if (superClass != null) { - _addOverrides(typesWithOverrides, seenTypes, superClass); - } - } - } - - /* - /********************************************************************** - /* Internal methods - /********************************************************************** - */ - - protected void _gatherTypes(ResolvedType currentType, Set seenTypes, List types) - { - // may get called with null if no parent type - if (currentType == null) { - return; - } - Class raw = currentType.getErasedType(); - // Also, don't include Object.class unless that's ok - if (!_cfgIncludeLangObject && raw == Object.class) { - return; - } - // Finally, only include first instance of an interface, so: - ClassKey key = new ClassKey(currentType.getErasedType()); - if (seenTypes.contains(key)) { - return; - } - // If all good so far, append - seenTypes.add(key); - types.add(currentType); - /* and check supertypes; starting with interfaces. Why interfaces? - * So that "highest" interfaces get priority; otherwise we'd recurse - * super-class stack and actually start with the bottom. Usually makes - * little difference, but in cases where it does this seems like the - * correct order. - */ - for (ResolvedType t : currentType.getImplementedInterfaces()) { - _gatherTypes(t, seenTypes, types); - } - // and then superclass - _gatherTypes(currentType.getParentClass(), seenTypes, types); - } -} diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/ResolvedType.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/ResolvedType.java deleted file mode 100644 index 31196dbe1..000000000 --- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/ResolvedType.java +++ /dev/null @@ -1,403 +0,0 @@ -package com.fr.third.com.fasterxml.classmate; - -import com.fr.third.com.fasterxml.classmate.members.RawConstructor; -import com.fr.third.com.fasterxml.classmate.members.RawField; -import com.fr.third.com.fasterxml.classmate.members.RawMethod; - -import java.lang.reflect.Constructor; -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -public abstract class ResolvedType - implements Type -{ - public final static ResolvedType[] NO_TYPES = new ResolvedType[0]; - - protected final static RawConstructor[] NO_CONSTRUCTORS = new RawConstructor[0]; - protected final static RawField[] NO_FIELDS = new RawField[0]; - protected final static RawMethod[] NO_METHODS = new RawMethod[0]; - - protected final Class _erasedType; - - /** - * Type bindings active when resolving members (methods, fields, - * constructors) of this type - */ - protected final TypeBindings _typeBindings; - - /* - /********************************************************************** - /* Life cycle - /********************************************************************** - */ - - protected ResolvedType(Class cls, TypeBindings bindings) - { - _erasedType = cls; - _typeBindings = (bindings == null) ? TypeBindings.emptyBindings() : bindings; - } - - /** - * Method that can be used to check if call to {@link TypeResolver#resolveSubtype(ResolvedType, Class)} - * may ever succeed; if false, it will fail with an exception, if true, it may succeed. - */ - public abstract boolean canCreateSubtypes(); - - /** - * Method that can be used to check if call to {@link TypeResolver#resolveSubtype(ResolvedType, Class)} - * will succeed for specific type; if false, it will fail with an exception; if tru it - * will succeed. - */ - public final boolean canCreateSubtype(Class subtype) { - return canCreateSubtypes() && _erasedType.isAssignableFrom(subtype); - } - - /* - /********************************************************************** - /* Accessors for related types - /********************************************************************** - */ - - /** - * Returns type-erased Class that this resolved type has. - */ - public Class getErasedType() { return _erasedType; } - - /** - * Returns parent class of this type, if it has one; primitive types - * and interfaces have no parent class, nor does Object type - * {@link java.lang.Object}. - * Also, placeholders for cyclic (recursive) types return null for - * this method. - */ - public abstract ResolvedType getParentClass(); - - /** - * Accessor that must be used to find out actual type in - * case of "self-reference"; case where type refers - * recursive to itself (like, T implements Comparable<T>). - * For all other types returns null but for self-references "real" type. - * Separate accessor is provided to avoid accidental infinite loops. - */ - public abstract ResolvedType getSelfReferencedType(); - - /** - * Method that can be used to access element type of array types; will return - * null for non-array types, and non-null type for array types. - */ - public abstract ResolvedType getArrayElementType(); - - /** - * Returns ordered list of interfaces (in declaration order) that this type - * implements. - * - * @return List of interfaces this type implements, if any; empty list if none - */ - public abstract List getImplementedInterfaces(); - - /** - * Returns list of generic type declarations for this type, in order they - * are declared in class description. - */ - public List getTypeParameters() { - return _typeBindings.getTypeParameters(); - } - - /** - * Method for accessing bindings of type variables to resolved types in context - * of this type. It has same number of entries as return List of - * {@link #getTypeParameters}, accessible using declared name to which they - * bind; for example, {@link java.util.Map} has 2 type bindings; one for - * key type (name "K", from Map.java) and one for value type - * (name "V", from Map.java). - */ - public TypeBindings getTypeBindings() { return _typeBindings; } - - /** - * Method that will try to find type parameterization this type - * has for specified super type - * - * @return List of type parameters for specified supertype (which may - * be empty, if supertype is not a parametric type); null if specified - * type is not a super type of this type - */ - public List typeParametersFor(Class erasedSupertype) - { - ResolvedType type = findSupertype(erasedSupertype); - if (type != null) { - return type.getTypeParameters(); - } - // nope; doesn't look like we extend or implement super type in question - return null; - } - - /** - * Method for finding super type of this type that has specified type - * erased signature. If supertype is an interface which is implemented - * using multiple inheritance paths, preference is given to interfaces - * implemented "highest up the stack" (directly implemented interfaces - * over interfaces superclass implements). - */ - public ResolvedType findSupertype(Class erasedSupertype) - { - if (erasedSupertype == _erasedType) { - return this; - } - // Check super interfaces first: - if (erasedSupertype.isInterface()) { - for (ResolvedType it : getImplementedInterfaces()) { - ResolvedType type = it.findSupertype(erasedSupertype); - if (type != null) { - return type; - } - } - } - // and if not found, super class and its supertypes - ResolvedType pc = getParentClass(); - if (pc != null) { - ResolvedType type = pc.findSupertype(erasedSupertype); - if (type != null) { - return type; - } - } - // nope; doesn't look like we extend or implement super type in question - return null; - } - - /* - /********************************************************************** - /* Accessors for simple properties - /********************************************************************** - */ - - public abstract boolean isInterface(); - public final boolean isConcrete() { return !isAbstract(); } - public abstract boolean isAbstract(); - - /** - * Method that indicates whether this type is an array type. - */ - public abstract boolean isArray(); - - /** - * Method that indicates whether this type is one of small number of primitive - * Java types; not including array types of primitive types but just basic - * primitive types. - */ - public abstract boolean isPrimitive(); - - public final boolean isInstanceOf(Class type) { - return type.isAssignableFrom(_erasedType); - } - - /* - /********************************************************************** - /* Accessors for raw (minimally procesed) members - /********************************************************************** - */ - - public List getConstructors() { return Collections.emptyList(); } - public List getMemberFields() { return Collections.emptyList(); } - public List getMemberMethods() { return Collections.emptyList(); } - public List getStaticFields() { return Collections.emptyList(); } - public List getStaticMethods() { return Collections.emptyList(); } - - /* - /********************************************************************** - /* String representations - /********************************************************************** - */ - - /** - * Method that returns full generic signature of the type; suitable - * as signature for things like ASM package. - */ - public String getSignature() { - StringBuilder sb = new StringBuilder(); - return appendSignature(sb).toString(); - } - - /** - * Method that returns type erased signature of the type; suitable - * as non-generic signature some packages need - */ - public String getErasedSignature() { - StringBuilder sb = new StringBuilder(); - return appendErasedSignature(sb).toString(); - } - - /** - * Human-readable full description of type, which includes specification - * of super types (in brief format) - */ - public String getFullDescription() { - StringBuilder sb = new StringBuilder(); - return appendFullDescription(sb).toString(); - } - - /** - * Human-readable brief description of type, which does not include - * information about super types. - */ - public String getBriefDescription() { - StringBuilder sb = new StringBuilder(); - return appendBriefDescription(sb).toString(); - } - - public abstract StringBuilder appendBriefDescription(StringBuilder sb); - public abstract StringBuilder appendFullDescription(StringBuilder sb); - public abstract StringBuilder appendSignature(StringBuilder sb); - public abstract StringBuilder appendErasedSignature(StringBuilder sb); - - /* - /********************************************************************** - /* Standard methods - /********************************************************************** - */ - - @Override public String toString() { - return getBriefDescription(); - } - - @Override public int hashCode() { - return _erasedType.getName().hashCode() + _typeBindings.hashCode(); - } - - @Override public boolean equals(Object o) - { - if (o == this) return true; - // sub-types must be same: - if (o == null || o.getClass() != getClass()) return false; - // Should be possible to actually implement here... - ResolvedType other = (ResolvedType) o; - if (other._erasedType != _erasedType) { - return false; - } - // and type bindings must match as well - return _typeBindings.equals(other._typeBindings); - } - - /* - /********************************************************************** - /* Helper methods for sub-classes; string construction - /********************************************************************** - */ - - protected StringBuilder _appendClassSignature(StringBuilder sb) - { - sb.append('L'); - sb = _appendClassName(sb); - int count = _typeBindings.size(); - if (count > 0) { - sb.append('<'); - for (int i = 0; i < count; ++i) { - sb = _typeBindings.getBoundType(i).appendErasedSignature(sb); - } - sb.append('>'); - } - sb.append(';'); - return sb; - } - - protected StringBuilder _appendErasedClassSignature(StringBuilder sb) - { - sb.append('L'); - sb = _appendClassName(sb); - sb.append(';'); - return sb; - } - - protected StringBuilder _appendClassDescription(StringBuilder sb) - { - sb.append(_erasedType.getName()); - int count = _typeBindings.size(); - if (count > 0) { - sb.append('<'); - for (int i = 0; i < count; ++i) { - if (i > 0) { - sb.append(','); - } - sb = _typeBindings.getBoundType(i).appendBriefDescription(sb); - } - sb.append('>'); - } - return sb; - } - - protected StringBuilder _appendClassName(StringBuilder sb) - { - String name = _erasedType.getName(); - for (int i = 0, len = name.length(); i < len; ++i) { - char c = name.charAt(i); - if (c == '.') c = '/'; - sb.append(c); - } - return sb; - } - - /* - /********************************************************************** - /* Helper methods for sub-classes; gathering members - /********************************************************************** - */ - - /** - * @param statics Whether to return static methods (true) or member methods (false) - */ - protected RawField[] _getFields(boolean statics) - { - ArrayList fields = new ArrayList(); - for (Field f : _erasedType.getDeclaredFields()) { - // Only skip synthetic fields, which should not really be exposed - if (!f.isSynthetic()) { - if (Modifier.isStatic(f.getModifiers()) == statics) { - fields.add(new RawField(this, f)); - } - } - } - if (fields.isEmpty()) { - return NO_FIELDS; - } - return fields.toArray(new RawField[fields.size()]); - } - - /** - * @param statics Whether to return static methods (true) or member methods (false) - */ - protected RawMethod[] _getMethods(boolean statics) - { - ArrayList methods = new ArrayList(); - for (Method m : _erasedType.getDeclaredMethods()) { - // Only skip synthetic fields, which should not really be exposed - if (!m.isSynthetic()) { - if (Modifier.isStatic(m.getModifiers()) == statics) { - methods.add(new RawMethod(this, m)); - } - } - } - if (methods.isEmpty()) { - return NO_METHODS; - } - return methods.toArray(new RawMethod[methods.size()]); - } - - protected RawConstructor[] _getConstructors() - { - ArrayList ctors = new ArrayList(); - for (Constructor c : _erasedType.getDeclaredConstructors()) { - // Only skip synthetic fields, which should not really be exposed - if (!c.isSynthetic()) { - ctors.add(new RawConstructor(this, c)); - } - } - if (ctors.isEmpty()) { - return NO_CONSTRUCTORS; - } - return ctors.toArray(new RawConstructor[ctors.size()]); - } -} diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/ResolvedTypeWithMembers.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/ResolvedTypeWithMembers.java deleted file mode 100644 index fbfac6cc1..000000000 --- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/ResolvedTypeWithMembers.java +++ /dev/null @@ -1,721 +0,0 @@ -package com.fr.third.com.fasterxml.classmate; - -import java.lang.annotation.Annotation; -import java.lang.annotation.Inherited; -import java.lang.reflect.Constructor; -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.lang.reflect.Type; -import java.util.*; - -import com.fr.third.com.fasterxml.classmate.members.HierarchicType; -import com.fr.third.com.fasterxml.classmate.members.RawConstructor; -import com.fr.third.com.fasterxml.classmate.members.RawField; -import com.fr.third.com.fasterxml.classmate.members.RawMethod; -import com.fr.third.com.fasterxml.classmate.members.ResolvedConstructor; -import com.fr.third.com.fasterxml.classmate.members.ResolvedField; -import com.fr.third.com.fasterxml.classmate.members.ResolvedMethod; -import com.fr.third.com.fasterxml.classmate.util.MethodKey; - -/** - * Class that contains information about fully resolved members of a - * type; resolution meaning that masking is handled for methods, and - * all inheritable annotations are flattened using optional overrides - * as well ("mix-in annotations"). - * Instances are created by {@link MemberResolver}. - *

- * Note that instances are not thread-safe, as the expectation is that instances - * will not be shared (unlike raw members or resolved types) - */ -public class ResolvedTypeWithMembers -{ - private final static ResolvedType[] NO_RESOLVED_TYPES = new ResolvedType[0]; - - private final static ResolvedMethod[] NO_RESOLVED_METHODS = new ResolvedMethod[0]; - private final static ResolvedField[] NO_RESOLVED_FIELDS = new ResolvedField[0]; - private final static ResolvedConstructor[] NO_RESOLVED_CONSTRUCTORS = new ResolvedConstructor[0]; - - /** - * Default annotation configuration is to ignore all annotations types. - */ - protected final static AnnotationConfiguration DEFAULT_ANNOTATION_CONFIG - = new AnnotationConfiguration.StdConfiguration(AnnotationInclusion.DONT_INCLUDE); - - /** - * Need to be able to resolve member types still - */ - protected final TypeResolver _typeResolver; - - /** - * Handler for resolving annotation information - */ - protected final AnnotationHandler _annotationHandler; - - /** - * Leaf of the type hierarchy, i.e. type from which this hierarchy - * was generated. - */ - protected final HierarchicType _mainType; - - /** - * All types that hierarchy contains, in order of increasing precedence - * (that is, later entries override members of earlier members) - */ - protected final HierarchicType[] _types; - - /** - * Filter to use for selecting fields to include - */ - protected Filter _fieldFilter; - - /** - * Filter to use for selecting constructors to include - */ - protected Filter _constructorFilter; - - /** - * Filter to use for selecting methods to include - */ - protected Filter _methodFilter; - - /* - /********************************************************************** - /* Lazily constructed members - /********************************************************************** - */ - - protected ResolvedMethod[] _staticMethods = null; - - protected ResolvedField[] _staticFields = null; - - protected ResolvedMethod[] _memberMethods = null; - - protected ResolvedField[] _memberFields = null; - - protected ResolvedConstructor[] _constructors = null; - - /* - /********************************************************************** - /* Life cycle at this point - /********************************************************************** - */ - - public ResolvedTypeWithMembers(TypeResolver typeResolver, AnnotationConfiguration annotationConfig, - HierarchicType mainType, HierarchicType[] types, - Filter constructorFilter, Filter fieldFilter, Filter methodFilter) - { - _typeResolver = typeResolver; - _mainType = mainType; - _types = types; - if (annotationConfig == null) { - annotationConfig = DEFAULT_ANNOTATION_CONFIG; - } - _annotationHandler = new AnnotationHandler(annotationConfig); - _constructorFilter = constructorFilter; - _fieldFilter = fieldFilter; - _methodFilter = methodFilter; - } - - /* - /********************************************************************** - /* Public API, access to component types - /********************************************************************** - */ - - public int size() { return _types.length; } - - /** - * Accessor for getting full type hierarchy as priority-ordered list, from - * the lowest precedence to highest precedence (main type, its mix-in overrides) - */ - public List allTypesAndOverrides() { - return Arrays.asList(_types); - } - - /** - * Accessor for getting subset of type hierarchy which only contains main type - * and possible overrides (mix-ins) it has, but not supertypes or their overrides. - */ - public List mainTypeAndOverrides() - { - List l = Arrays.asList(_types); - int end = _mainType.getPriority() + 1; - if (end < l.size()) { - l = l.subList(0, end); - } - return l; - } - - /** - * Accessor for finding just overrides for the main type (if any). - */ - public List overridesOnly() - { - int index = _mainType.getPriority(); - if (index == 0) { - return Collections.emptyList(); - } - List l = Arrays.asList(_types); - return l.subList(0, index); - } - - /* - /********************************************************************** - /* Public API, actual resolution of members - /********************************************************************** - */ - - /** - * Method for finding all static fields of the main type (except for ones - * possibly filtered out by filter) and applying annotation overrides, if any, - * to annotations. - * - * @since 1.2.0 - */ - public ResolvedField[] getStaticFields() - { - if (_staticFields == null) { - _staticFields = resolveStaticFields(); - } - return _staticFields; - } - - /** - * Method for finding all static methods of the main type (except for ones - * possibly filtered out by filter) and applying annotation overrides, if any, - * to annotations. - */ - public ResolvedMethod[] getStaticMethods() - { - if (_staticMethods == null) { - _staticMethods = resolveStaticMethods(); - } - return _staticMethods; - } - - public ResolvedField[] getMemberFields() - { - if (_memberFields == null) { - _memberFields = resolveMemberFields(); - } - return _memberFields; - } - - public ResolvedMethod[] getMemberMethods() - { - if (_memberMethods == null) { - _memberMethods = resolveMemberMethods(); - } - return _memberMethods; - } - - public ResolvedConstructor[] getConstructors() - { - if (_constructors == null) { - _constructors = resolveConstructors(); - } - return _constructors; - } - - /* - /********************************************************************** - /* Internal methods: actual resolution - /********************************************************************** - */ - - /** - * Method that will actually resolve full information (types, annotations) - * for constructors of the main type. - */ - protected ResolvedConstructor[] resolveConstructors() - { - // First get static methods for main type, filter - LinkedHashMap constructors = new LinkedHashMap(); - for (RawConstructor constructor : _mainType.getType().getConstructors()) { - // no filter for constructors (yet?) - if (_constructorFilter == null || _constructorFilter.include(constructor)) { - constructors.put(constructor.createKey(), resolveConstructor(constructor)); - } - } - // then apply overrides (mix-ins): - for (HierarchicType type : overridesOnly()) { - for (RawConstructor raw : type.getType().getConstructors()) { - ResolvedConstructor constructor = constructors.get(raw.createKey()); - // must override something, otherwise to ignore - if (constructor != null) { - for (Annotation ann : raw.getAnnotations()) { - if (_annotationHandler.includeMethodAnnotation(ann)) { - constructor.applyOverride(ann); - } - } - - // and parameter annotations - Annotation[][] params = raw.getRawMember().getParameterAnnotations(); - for (int i = 0; i < params.length; i++) { - for (Annotation annotation : params[i]) { - if (_annotationHandler.includeParameterAnnotation(annotation)) { - constructor.applyParamOverride(i, annotation); - } - } - } - } - } - } - if (constructors.size() == 0) { - return NO_RESOLVED_CONSTRUCTORS; - } - return constructors.values().toArray(new ResolvedConstructor[constructors.size()]); - } - - /** - * Method for fully resolving field definitions and associated annotations. - * Neither field definitions nor associated annotations inherit, but we may - * still need to add annotation overrides, as well as filter out filters - * and annotations that caller is not interested in. - */ - protected ResolvedField[] resolveMemberFields() - { - LinkedHashMap fields = new LinkedHashMap(); - - /* Fields need different handling: must start from bottom; and annotations only get added - * as overrides, never as defaults. And sub-classes fully mask fields. This makes - * handling bit simpler than that of member methods. - */ - for (int typeIndex = _types.length; --typeIndex >= 0; ) { - HierarchicType thisType = _types[typeIndex]; - // If it's just a mix-in, add annotations as overrides - if (thisType.isMixin()) { - for (RawField raw : thisType.getType().getMemberFields()) { - if ((_fieldFilter != null) && !_fieldFilter.include(raw)) { - continue; - } - ResolvedField field = fields.get(raw.getName()); - if (field != null) { - for (Annotation ann : raw.getAnnotations()) { - if (_annotationHandler.includeMethodAnnotation(ann)) { - field.applyOverride(ann); - } - } - } - } - } else { // If actual type, add fields, masking whatever might have existed before: - for (RawField field : thisType.getType().getMemberFields()) { - if ((_fieldFilter != null) && !_fieldFilter.include(field)) { - continue; - } - fields.put(field.getName(), resolveField(field)); - } - } - } - // and that's it? - if (fields.size() == 0) { - return NO_RESOLVED_FIELDS; - } - return fields.values().toArray(new ResolvedField[fields.size()]); - } - - protected ResolvedMethod[] resolveMemberMethods() - { - LinkedHashMap methods = new LinkedHashMap(); - LinkedHashMap overrides = new LinkedHashMap(); - LinkedHashMap paramOverrides = new LinkedHashMap(); - - /* Member methods are handled from top to bottom; and annotations are tracked - * alongside (for overrides), as well as "merged down" for inheritable - * annotations. - */ - for (HierarchicType type : allTypesAndOverrides()) { - for (RawMethod method : type.getType().getMemberMethods()) { - // First: ignore methods caller is not interested - if (_methodFilter != null && !_methodFilter.include(method)) { - continue; - } - - MethodKey key = method.createKey(); - ResolvedMethod old = methods.get(key); - - // Ok, now, mix-ins only contribute annotations; whereas 'real' types methods - if (type.isMixin()) { // mix-in: only get annotations - for (Annotation ann : method.getAnnotations()) { - // If already have a method, must be inheritable to include - if (old != null) { - if (!methodCanInherit(ann)) { - continue; - } - // and if so, apply as default (i.e. do not override) - old.applyDefault(ann); - } else { // If no method, need to add to annotation override map - Annotations oldAnn = overrides.get(key); - if (oldAnn == null) { - oldAnn = new Annotations(); - oldAnn.add(ann); - overrides.put(key, oldAnn); - } else { - oldAnn.addAsDefault(ann); - } - } - } - - // override argument annotations - final Annotation[][] argAnnotations = method.getRawMember().getParameterAnnotations(); - if (old == null) { // no method (yet), add argument annotations to override map - Annotations[] oldParamAnns = paramOverrides.get(key); - if (oldParamAnns == null) { // no existing argument annotations for method - oldParamAnns = new Annotations[argAnnotations.length]; - for (int i = 0; i < argAnnotations.length; i++) { - oldParamAnns[i] = new Annotations(); - for (final Annotation annotation : argAnnotations[i]) { - if (parameterCanInherit(annotation)) { - oldParamAnns[i].add(annotation); - } - } - } - paramOverrides.put(key, oldParamAnns); - } else { - for (int i = 0; i < argAnnotations.length; i++) { - for (final Annotation annotation : argAnnotations[i]) { - if (parameterCanInherit(annotation)) { - oldParamAnns[i].addAsDefault(annotation); - } - } - } - } - } else { // already have a method, apply argument annotations as defaults - for (int i = 0; i < argAnnotations.length; i++) { - for (final Annotation annotation : argAnnotations[i]) { - if (parameterCanInherit(annotation)) { - old.applyParamDefault(i, annotation); - } - } - } - } - } else { // "real" methods; add if not present, possibly add defaults as well - if (old == null) { // new one to add - ResolvedMethod newMethod = resolveMethod(method); - methods.put(key, newMethod); - // But we may also have annotation overrides, so: - Annotations overrideAnn = overrides.get(key); - if (overrideAnn != null) { - newMethod.applyOverrides(overrideAnn); - } - // and apply parameter annotation overrides - Annotations[] annotations = paramOverrides.get(key); - if (annotations != null) { - for (int i = 0; i < annotations.length; i++) { - newMethod.applyParamOverrides(i, annotations[i]); - } - } - } else { // method masked by something else? can only contribute annotations - for (Annotation ann : method.getAnnotations()) { - if (methodCanInherit(ann)) { - old.applyDefault(ann); - } - } - // and parameter annotations - final Annotation[][] parameterAnnotations = method.getRawMember().getParameterAnnotations(); - for (int i = 0; i < parameterAnnotations.length; i++) { - for (final Annotation annotation : parameterAnnotations[i]) { - if (parameterCanInherit(annotation)) { - old.applyParamDefault(i, annotation); - } - } - } - } - } - } - } - - if (methods.size() == 0) { - return NO_RESOLVED_METHODS; - } - return methods.values().toArray(new ResolvedMethod[methods.size()]); - } - - /** - * Method for fully resolving static field definitions and associated annotations. - * Neither field definitions nor associated annotations inherit, but we may - * still need to add annotation overrides, as well as filter out filters - * and annotations that caller is not interested in. - * - * @since 1.2.0 - */ - protected ResolvedField[] resolveStaticFields() - { - // First get static methods for main type, filter - LinkedHashMap fields = new LinkedHashMap(); - for (RawField field : _mainType.getType().getStaticFields()) { - if (_fieldFilter == null || _fieldFilter.include(field)) { - fields.put(field.getName(), resolveField(field)); - } - } - // then apply overrides (mix-ins): - for (HierarchicType type : overridesOnly()) { - for (RawField raw : type.getType().getStaticFields()) { - ResolvedField field = fields.get(raw.getName()); - // must override something, otherwise to ignore - if (field != null) { - for (Annotation ann : raw.getAnnotations()) { - if (_annotationHandler.includeFieldAnnotation(ann)) { - field.applyOverride(ann); - } - } - } - } - } - // and that's it? - if (fields.isEmpty()) { - return NO_RESOLVED_FIELDS; - } - return fields.values().toArray(new ResolvedField[ fields.size()]); - } - - /** - * Method that will actually resolve full information (types, annotations) - * for static methods, using configured filter. - */ - protected ResolvedMethod[] resolveStaticMethods() - { - // First get static methods for main type, filter - LinkedHashMap methods = new LinkedHashMap(); - for (RawMethod method : _mainType.getType().getStaticMethods()) { - if (_methodFilter == null || _methodFilter.include(method)) { - methods.put(method.createKey(), resolveMethod(method)); - } - } - // then apply overrides (mix-ins): - for (HierarchicType type : overridesOnly()) { - for (RawMethod raw : type.getType().getStaticMethods()) { - ResolvedMethod method = methods.get(raw.createKey()); - // must override something, otherwise to ignore - if (method != null) { - for (Annotation ann : raw.getAnnotations()) { - if (_annotationHandler.includeMethodAnnotation(ann)) { - method.applyOverride(ann); - } - } - } - } - } - if (methods.size() == 0) { - return NO_RESOLVED_METHODS; - } - return methods.values().toArray(new ResolvedMethod[methods.size()]); - } - - /* - /********************************************************************** - /* Helper methods - /********************************************************************** - */ - - /** - * Method for resolving individual constructor completely - */ - protected ResolvedConstructor resolveConstructor(RawConstructor raw) - { - final ResolvedType context = raw.getDeclaringType(); - final TypeBindings bindings = context.getTypeBindings(); - Constructor ctor = raw.getRawMember(); - Type[] rawTypes = ctor.getGenericParameterTypes(); - ResolvedType[] argTypes; - if (rawTypes == null || rawTypes.length == 0) { - argTypes = NO_RESOLVED_TYPES; - } else { - argTypes = new ResolvedType[rawTypes.length]; - for (int i = 0, len = rawTypes.length; i < len; ++i) { - argTypes[i] = _typeResolver.resolve(bindings, rawTypes[i]); - } - } - // And then annotations - Annotations anns = new Annotations(); - for (Annotation ann : ctor.getAnnotations()) { - if (_annotationHandler.includeConstructorAnnotation(ann)) { - anns.add(ann); - } - } - - ResolvedConstructor constructor = new ResolvedConstructor(context, anns, ctor, argTypes); - - // and parameter annotations - Annotation[][] annotations = ctor.getParameterAnnotations(); - for (int i = 0; i < argTypes.length; i++) { - for (Annotation ann : annotations[i]) { - constructor.applyParamOverride(i, ann); - } - } - - return constructor; - } - - /** - * Method for resolving individual field completely - */ - protected ResolvedField resolveField(RawField raw) - { - final ResolvedType context = raw.getDeclaringType(); - Field field = raw.getRawMember(); - ResolvedType type = _typeResolver.resolve(context.getTypeBindings(), field.getGenericType()); - // And then annotations - Annotations anns = new Annotations(); - for (Annotation ann : field.getAnnotations()) { - if (_annotationHandler.includeFieldAnnotation(ann)) { - anns.add(ann); - } - } - return new ResolvedField(context, anns, field, type); - } - - /** - * Method for resolving individual method completely - */ - protected ResolvedMethod resolveMethod(RawMethod raw) - { - final ResolvedType context = raw.getDeclaringType(); - final TypeBindings bindings = context.getTypeBindings(); - Method m = raw.getRawMember(); - Type rawType = m.getGenericReturnType(); - ResolvedType rt = (rawType == Void.TYPE) ? null : _typeResolver.resolve(bindings, rawType); - Type[] rawTypes = m.getGenericParameterTypes(); - ResolvedType[] argTypes; - if (rawTypes == null || rawTypes.length == 0) { - argTypes = NO_RESOLVED_TYPES; - } else { - argTypes = new ResolvedType[rawTypes.length]; - for (int i = 0, len = rawTypes.length; i < len; ++i) { - argTypes[i] = _typeResolver.resolve(bindings, rawTypes[i]); - } - } - // And then annotations - Annotations anns = new Annotations(); - for (Annotation ann : m.getAnnotations()) { - if (_annotationHandler.includeMethodAnnotation(ann)) { - anns.add(ann); - } - } - - ResolvedMethod method = new ResolvedMethod(context, anns, m, rt, argTypes); - - // and argument annotations - Annotation[][] annotations = m.getParameterAnnotations(); - for (int i = 0; i < argTypes.length; i++) { - for (Annotation ann : annotations[i]) { - method.applyParamOverride(i, ann); - } - } - return method; - } - - protected boolean methodCanInherit(Annotation annotation) { - AnnotationInclusion annotationInclusion = _annotationHandler.methodInclusion(annotation); - if (annotationInclusion == AnnotationInclusion.INCLUDE_AND_INHERIT_IF_INHERITED) { - return annotation.annotationType().isAnnotationPresent(Inherited.class); - } - return (annotationInclusion == AnnotationInclusion.INCLUDE_AND_INHERIT); - } - - protected boolean parameterCanInherit(Annotation annotation) { - AnnotationInclusion annotationInclusion = _annotationHandler.parameterInclusion(annotation); - if (annotationInclusion == AnnotationInclusion.INCLUDE_AND_INHERIT_IF_INHERITED) { - return annotation.annotationType().isAnnotationPresent(Inherited.class); - } - return (annotationInclusion == AnnotationInclusion.INCLUDE_AND_INHERIT); - } - - /* - /********************************************************************** - /* Helper types - /********************************************************************** - */ - - /** - * Helper class we use to reduce number of calls to {@link AnnotationConfiguration}; - * mostly because determination may be expensive. - */ - private final static class AnnotationHandler - { - private final AnnotationConfiguration _annotationConfig; - - private HashMap, AnnotationInclusion> _fieldInclusions; - private HashMap, AnnotationInclusion> _constructorInclusions; - private HashMap, AnnotationInclusion> _methodInclusions; - private HashMap, AnnotationInclusion> _parameterInclusions; - - public AnnotationHandler(AnnotationConfiguration annotationConfig) { - _annotationConfig = annotationConfig; - } - - public boolean includeConstructorAnnotation(Annotation ann) - { - Class annType = ann.annotationType(); - if (_constructorInclusions == null) { - _constructorInclusions = new HashMap, AnnotationInclusion>(); - } else { - AnnotationInclusion incl = _constructorInclusions.get(annType); - if (incl != null) { - return (incl != AnnotationInclusion.DONT_INCLUDE); - } - } - AnnotationInclusion incl = _annotationConfig.getInclusionForConstructor(annType); - _constructorInclusions.put(annType, incl); - return (incl != AnnotationInclusion.DONT_INCLUDE); - } - - public boolean includeFieldAnnotation(Annotation ann) - { - Class annType = ann.annotationType(); - if (_fieldInclusions == null) { - _fieldInclusions = new HashMap, AnnotationInclusion>(); - } else { - AnnotationInclusion incl = _fieldInclusions.get(annType); - if (incl != null) { - return (incl != AnnotationInclusion.DONT_INCLUDE); - } - } - AnnotationInclusion incl = _annotationConfig.getInclusionForField(annType); - _fieldInclusions.put(annType, incl); - return (incl != AnnotationInclusion.DONT_INCLUDE); - } - - public boolean includeMethodAnnotation(Annotation ann) - { - return methodInclusion(ann) != AnnotationInclusion.DONT_INCLUDE; - } - - public AnnotationInclusion methodInclusion(Annotation ann) - { - Class annType = ann.annotationType(); - if (_methodInclusions == null) { - _methodInclusions = new HashMap, AnnotationInclusion>(); - } else { - AnnotationInclusion incl = _methodInclusions.get(annType); - if (incl != null) { - return incl; - } - } - AnnotationInclusion incl = _annotationConfig.getInclusionForMethod(annType); - _methodInclusions.put(annType, incl); - return incl; - } - - public boolean includeParameterAnnotation(Annotation ann) - { - return parameterInclusion(ann) != AnnotationInclusion.DONT_INCLUDE; - } - - public AnnotationInclusion parameterInclusion(Annotation ann) - { - Class annType = ann.annotationType(); - if (_parameterInclusions == null) { - _parameterInclusions = new HashMap, AnnotationInclusion>(); - } else { - AnnotationInclusion incl = _parameterInclusions.get(annType); - if (incl != null) { - return incl; - } - } - AnnotationInclusion incl = _annotationConfig.getInclusionForParameter(annType); - _parameterInclusions.put(annType, incl); - return incl; - } - } -} diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/TypeBindings.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/TypeBindings.java deleted file mode 100644 index 700a70a42..000000000 --- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/TypeBindings.java +++ /dev/null @@ -1,237 +0,0 @@ -package com.fr.third.com.fasterxml.classmate; - -import java.lang.reflect.TypeVariable; -import java.util.*; - -/** - * Helper class used for storing binding of local type variables to - * matching resolved types, in context of a single class. - */ -public final class TypeBindings -{ - private final static String[] NO_STRINGS = new String[0]; - - private final static ResolvedType[] NO_TYPES = new ResolvedType[0]; - - private final static TypeBindings EMPTY = new TypeBindings(NO_STRINGS, NO_TYPES, null); - - /** - * Array of type (type variable) names. - */ - private final String[] _names; - - /** - * Types matching names - */ - private final ResolvedType[] _types; - - /** - * Names of potentially unresolved type variables. - * - * @since 2.3 - */ - private final String[] _unboundVariables; - - private final int _hashCode; - - /* - /********************************************************************** - /* Construction - /********************************************************************** - */ - - private TypeBindings(String[] names, ResolvedType[] types, String[] uvars) - { - _names = (names == null) ? NO_STRINGS : names; - _types = (types == null) ? NO_TYPES : types; - if (_names.length != _types.length) { - throw new IllegalArgumentException("Mismatching names ("+_names.length+"), types ("+_types.length+")"); - } - int h = 1; - for (int i = 0, len = _types.length; i < len; ++i) { - h += _types[i].hashCode(); - } - _unboundVariables = uvars; - _hashCode = h; - } - - public static TypeBindings emptyBindings() { - return EMPTY; - } - - /** - * Factory method for constructing bindings for given class using specified type - * parameters. - */ - public static TypeBindings create(Class erasedType, List typeList) - { - ResolvedType[] types = (typeList == null || typeList.isEmpty()) ? - NO_TYPES : typeList.toArray(new ResolvedType[typeList.size()]); - return create(erasedType, types); - } - - public static TypeBindings create(Class erasedType, ResolvedType[] types) - { - if (types == null) { - types = NO_TYPES; - } - TypeVariable[] vars = erasedType.getTypeParameters(); - String[] names; - if (vars == null || vars.length == 0) { - names = NO_STRINGS; - } else { - int len = vars.length; - names = new String[len]; - for (int i = 0; i < len; ++i) { - names[i] = vars[i].getName(); - } - } - // Check here to give better error message - if (names.length != types.length) { - throw new IllegalArgumentException("Can not create TypeBinding for class "+erasedType.getName() - +" with "+types.length+" type parameter" - +((types.length == 1) ? "" : "s")+": class expects "+names.length); - } - return new TypeBindings(names, types, null); - } - - /** - * Method for creating an instance that has same bindings as this object, - * plus an indicator for additional type variable that may be unbound within - * this context; this is needed to resolve recursive self-references. - * - * @since 1.3 (renamed from "withAdditionalBinding" in 1.2) - */ - public TypeBindings withUnboundVariable(String name) - { - int len = (_unboundVariables == null) ? 0 : _unboundVariables.length; - String[] names = (len == 0) - ? new String[1] : Arrays.copyOf(_unboundVariables, len+1); - names[len] = name; - return new TypeBindings(_names, _types, names); - } - - /* - /********************************************************************** - /* Accessors - /********************************************************************** - */ - - /** - * Find type bound to specified name, if there is one; returns bound type if so, null if not. - */ - public ResolvedType findBoundType(String name) - { - for (int i = 0, len = _names.length; i < len; ++i) { - if (name.equals(_names[i])) { - return _types[i]; - } - } - return null; - } - - public boolean isEmpty() { - return (_types.length == 0); - } - - /** - * Returns number of bindings contained - */ - public int size() { - return _types.length; - } - - public String getBoundName(int index) - { - if (index < 0 || index >= _names.length) { - return null; - } - return _names[index]; - } - - public ResolvedType getBoundType(int index) - { - if (index < 0 || index >= _types.length) { - return null; - } - return _types[index]; - } - - /** - * Accessor for getting bound types in declaration order - */ - public List getTypeParameters() - { - if (_types.length == 0) { - return Collections.emptyList(); - } - return Arrays.asList(_types); - } - - /** - * @since 2.3 - */ - public boolean hasUnbound(String name) { - if (_unboundVariables != null) { - for (int i = _unboundVariables.length; --i >= 0; ) { - if (name.equals(_unboundVariables[i])) { - return true; - } - } - } - return false; - } - - /* - /********************************************************************** - /* Standard methods - /********************************************************************** - */ - - @Override public String toString() - { - if (_types.length == 0) { - return ""; - } - StringBuilder sb = new StringBuilder(); - sb.append('<'); - for (int i = 0, len = _types.length; i < len; ++i) { - if (i > 0) { - sb.append(','); - } - sb = _types[i].appendBriefDescription(sb); - } - sb.append('>'); - return sb.toString(); - } - - @Override public int hashCode() { return _hashCode; } - - @Override public boolean equals(Object o) - { - if (o == this) return true; - if (o == null || o.getClass() != getClass()) return false; - TypeBindings other = (TypeBindings) o; - int len = _types.length; - if (len != other.size()) { - return false; - } - ResolvedType[] otherTypes = other._types; - for (int i = 0; i < len; ++i) { - if (!otherTypes[i].equals(_types[i])) { - return false; - } - } - return true; - } - - /* - /********************************************************************** - /* Package accessible methods - /********************************************************************** - */ - - protected ResolvedType[] typeParameterArray() { - return _types; - } -} diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/TypeResolver.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/TypeResolver.java deleted file mode 100644 index acaf9a9fd..000000000 --- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/TypeResolver.java +++ /dev/null @@ -1,552 +0,0 @@ -package com.fr.third.com.fasterxml.classmate; - -import java.io.Serializable; -import java.lang.reflect.*; -import java.util.*; - -import com.fr.third.com.fasterxml.classmate.util.ClassKey; -import com.fr.third.com.fasterxml.classmate.util.ClassStack; -import com.fr.third.com.fasterxml.classmate.util.ResolvedTypeCache; -import com.fr.third.com.fasterxml.classmate.types.ResolvedArrayType; -import com.fr.third.com.fasterxml.classmate.types.ResolvedInterfaceType; -import com.fr.third.com.fasterxml.classmate.types.ResolvedObjectType; -import com.fr.third.com.fasterxml.classmate.types.ResolvedPrimitiveType; -import com.fr.third.com.fasterxml.classmate.types.ResolvedRecursiveType; -import com.fr.third.com.fasterxml.classmate.types.TypePlaceHolder; - -/** - * Object that is used for resolving generic type information of a class - * so that it is accessible using simple API. Resolved types are also starting - * point for accessing resolved (generics aware) return and argument types - * of class members (methods, fields, constructors). - *

- * Note that resolver instances are stateful in that resolvers cache resolved - * types for efficiency. Since this is internal state and not directly visible - * to callers, access to state is fully synchronized so that access from - * multiple threads is safe. - */ -@SuppressWarnings("serial") -public class TypeResolver implements Serializable -{ - private final static ResolvedType[] NO_TYPES = new ResolvedType[0]; - - /* - /********************************************************************** - /* Pre-created instances - /********************************************************************** - */ - - /** - * We will also need to return "unknown" type for cases where type variable binding - * is not found ('raw' instances of generic types); easiest way is to - * pre-create type for java.lang.Object - */ - private final static ResolvedObjectType sJavaLangObject = - ResolvedObjectType.create(Object.class, null, null, null); - - /** - * Since number of primitive types is small, and they are frequently needed, - * let's actually pre-create them for efficient reuse. Same goes for limited number - * of other "standard" types... - */ - protected final static HashMap _primitiveTypes; - static { - _primitiveTypes = new HashMap(16); - for (ResolvedPrimitiveType type : ResolvedPrimitiveType.all()) { - _primitiveTypes.put(new ClassKey(type.getErasedType()), type); - } - // should we include "void"? might as well... - _primitiveTypes.put(new ClassKey(Void.TYPE), ResolvedPrimitiveType.voidType()); - // and at least java.lang.Object should be added too. - _primitiveTypes.put(new ClassKey(Object.class), sJavaLangObject); - // but most other types can be added dynamically - } - - /* - /********************************************************************** - /* Caching - /********************************************************************** - */ - - /** - * Simple cache of types resolved by this resolved; capped to last 200 resolved types. - * Caching works because type instances themselves are mostly immutable; - * and properly synchronized in cases where transient data (raw members) are - * accessed. - */ - protected final ResolvedTypeCache _resolvedTypes = new ResolvedTypeCache(200); - - /* - /********************************************************************** - /* Life cycle - /********************************************************************** - */ - - public TypeResolver() { } - - /* - /********************************************************************** - /* Factory methods, with explicit parameterization - /********************************************************************** - */ - - /** - * Factory method for resolving given base type - * using specified types as type parameters. - * Sample usage would be: - *

-     *  ResolvedType type = TypeResolver.resolve(List.class, Integer.class);
-     *
- * which would be equivalent to - *
-     *  ResolvedType type = TypeResolver.resolve(new GenericType<List<Integer>>() { });
-     *
- * Note that you can mix different types of type parameters, whether already - * resolved ({@link ResolvedType}), type-erased ({@link java.lang.Class}) or - * generic type reference ({@link GenericType}). - */ - public ResolvedType resolve(Type type, Type... typeParameters) - { - boolean noParams = (typeParameters == null || typeParameters.length == 0); - TypeBindings bindings; - Class rawBase; - - if (type instanceof Class) { - bindings = TypeBindings.emptyBindings(); - if (noParams) { - return _fromClass(null, (Class) type, bindings); - } - rawBase = (Class) type; - } else if (type instanceof GenericType) { - bindings = TypeBindings.emptyBindings(); - if (noParams) { - return _fromGenericType(null, (GenericType) type, bindings); - } - ResolvedType rt = _fromAny(null, type, bindings); - rawBase = rt.getErasedType(); - } else if (type instanceof ResolvedType) { - ResolvedType rt = (ResolvedType) type; - if (noParams) { - return rt; - } - bindings = rt.getTypeBindings(); - rawBase = rt.getErasedType(); - } else { - bindings = TypeBindings.emptyBindings(); - if (noParams) { - return resolve(bindings, type); - } - // Quite convoluted... but necessary to find Class underlying it all - ResolvedType rt = _fromAny(null, type, bindings); - rawBase = rt.getErasedType(); - } - - // Next: resolve type parameters - int len = typeParameters.length; - ResolvedType[] resolvedParams = new ResolvedType[len]; - for (int i = 0; i < len; ++i) { - resolvedParams[i] = _fromAny(null, typeParameters[i], bindings); - } - return _fromClass(null, rawBase, TypeBindings.create(rawBase, resolvedParams)); - } - - /** - * Factory method for constructing array type of given element type. - */ - public ResolvedArrayType arrayType(Type elementType) - { - ResolvedType resolvedElementType = resolve(TypeBindings.emptyBindings(), elementType); - // Arrays are cumbersome for some reason: - Object emptyArray = Array.newInstance(resolvedElementType.getErasedType(), 0); - // Should we try to use cache? It's bit tricky, so let's not bother yet - return new ResolvedArrayType(emptyArray.getClass(), TypeBindings.emptyBindings(), - resolvedElementType); - } - - /** - * Factory method for resolving specified Java {@link java.lang.reflect.Type}, given - * {@link TypeBindings} needed to resolve any type variables. - *

- * Use of this method is discouraged (use if and only if you really know what you - * are doing!); but if used, type bindings passed should come from {@link ResolvedType} - * instance of declaring class (or interface). - *

- * NOTE: order of arguments was reversed for 0.8, to avoid problems with - * overload varargs method. - */ - public ResolvedType resolve(TypeBindings typeBindings, Type jdkType) - { - return _fromAny(null, jdkType, typeBindings); - } - - /** - * Factory method for constructing sub-classing specified type; class specified - * as sub-class must be compatible according to basic Java inheritance rules - * (subtype must properly extend or implement specified supertype). - *

- * A typical use case here is to refine a generic type; for example, given - * that we have generic type like List<Integer>, but we want - * a more specific implementation type like - * class ArrayList but with same parameterization (here just Integer), - * we could achieve it by: - *

-     *  ResolvedType mapType = typeResolver.resolve(List.class, Integer.class);
-     *  ResolveType concreteMapType = typeResolver.resolveSubType(mapType, ArrayList.class);
-     *
- * (in this case, it would have been simpler to resolve directly; but in some - * cases we are handled supertype and want to refine it, in which case steps - * would be the same but separated by other code) - *

- * Note that this method will fail if extension can not succeed; either because - * this type is not extendable (sub-classable) -- which is true for primitive - * and array types -- or because given class is not a subtype of this type. - * To check whether subtyping could succeed, you can call - * {@link ResolvedType#canCreateSubtypes()} to see if supertype can ever - * be extended. - * - * @param supertype Type to subtype (extend) - * @param subtype Type-erased sub-class or sub-interface - * - * @return Resolved subtype - * - * @throws IllegalArgumentException If this type can be extended in general, but not into specified sub-class - * @throws UnsupportedOperationException If this type can not be sub-classed - */ - public ResolvedType resolveSubtype(ResolvedType supertype, Class subtype) - throws IllegalArgumentException, UnsupportedOperationException - { - // first: if it's a recursive reference, find out referred-to type - ResolvedType refType = supertype.getSelfReferencedType(); - if (refType != null) { - supertype = refType; - } - // Then, trivial check for case where subtype is supertype... - if (supertype.getErasedType() == subtype) { - return supertype; - } - - if (!supertype.canCreateSubtypes()) { - throw new UnsupportedOperationException("Can not subtype primitive or array types (type "+supertype.getFullDescription()+")"); - } - // In general, must be able to subtype as per JVM rules: - Class superclass = supertype.getErasedType(); - if (!superclass.isAssignableFrom(subtype)) { - throw new IllegalArgumentException("Can not sub-class "+supertype.getBriefDescription() - +" into "+subtype.getName()); - } - // Ok, then, let us instantiate type with placeholders - ResolvedType resolvedSubtype; - int paramCount = subtype.getTypeParameters().length; - TypePlaceHolder[] placeholders; - - if (paramCount == 0) { // no generics - placeholders = null; - resolvedSubtype = resolve(subtype); - } else { - placeholders = new TypePlaceHolder[paramCount]; - for (int i = 0; i < paramCount; ++i) { - placeholders[i] = new TypePlaceHolder(i); - } - resolvedSubtype = resolve(subtype, placeholders); - } - ResolvedType rawSupertype = resolvedSubtype.findSupertype(superclass); - if (rawSupertype == null) { // sanity check, should never occur - throw new IllegalArgumentException("Internal error: unable to locate supertype ("+subtype.getName()+") for type "+supertype.getBriefDescription()); - } - // Ok, then, let's find and verify type assignments - _resolveTypePlaceholders(supertype, rawSupertype); - - // And then re-construct, if necessary - if (paramCount == 0) { // if no type parameters, fine as is - return resolvedSubtype; - } - // but with type parameters, need to reconstruct - ResolvedType[] typeParams = new ResolvedType[paramCount]; - for (int i = 0; i < paramCount; ++i) { - ResolvedType t = placeholders[i].actualType(); - /* Is it ok for it to be left unassigned? For now let's not - * allow that - */ - if (t == null) { - throw new IllegalArgumentException("Failed to find type parameter #"+(i+1)+"/" - +paramCount+" for "+subtype.getName()); - } - typeParams[i] = t; - } - return resolve(subtype, typeParams); - } - - /* - /********************************************************************** - /* Misc other methods - /********************************************************************** - */ - - /** - * Helper method that can be used to checked whether given resolved type - * (with erased type of java.lang.Object) is a placeholder - * for "self-reference"; these are nasty recursive ("self") types - * needed with some interfaces - */ - public static boolean isSelfReference(ResolvedType type) - { - return (type instanceof ResolvedRecursiveType); - } - - /* - /********************************************************************** - /* Internal methods, second-level factory methods - /********************************************************************** - */ - - private ResolvedType _fromAny(ClassStack context, Type mainType, TypeBindings typeBindings) - { - if (mainType instanceof Class) { - return _fromClass(context, (Class) mainType, typeBindings); - } - if (mainType instanceof ResolvedType) { - return (ResolvedType) mainType; - } - if (mainType instanceof ParameterizedType) { - return _fromParamType(context, (ParameterizedType) mainType, typeBindings); - } - if (mainType instanceof GenericType) { - return _fromGenericType(context, (GenericType) mainType, typeBindings); - } - if (mainType instanceof GenericArrayType) { - return _fromArrayType(context, (GenericArrayType) mainType, typeBindings); - } - if (mainType instanceof TypeVariable) { - return _fromVariable(context, (TypeVariable) mainType, typeBindings); - } - if (mainType instanceof WildcardType) { - return _fromWildcard(context, (WildcardType) mainType, typeBindings); - } - // should never get here... - throw new IllegalArgumentException("Unrecognized type class: "+mainType.getClass().getName()); - } - - private ResolvedType _fromClass(ClassStack context, Class rawType, TypeBindings typeBindings) - { - // First: a primitive type perhaps? - ResolvedType type = _primitiveTypes.get(new ClassKey(rawType)); - if (type != null) { - return type; - } - // Second: recursive reference? - if (context == null) { - context = new ClassStack(rawType); - } else { - ClassStack prev = context.find(rawType); - if (prev != null) { - // Self-reference: needs special handling, then... - ResolvedRecursiveType selfRef = new ResolvedRecursiveType(rawType, typeBindings); - prev.addSelfReference(selfRef); - return selfRef; - } - // no, can just add - context = context.child(rawType); - } - - // If not, already recently resolved? - ResolvedType[] typeParameters = typeBindings.typeParameterArray(); - ResolvedTypeCache.Key key = _resolvedTypes.key(rawType, typeParameters); - - type = _resolvedTypes.find(key); - if (type == null) { - type = _constructType(context, rawType, typeBindings); - _resolvedTypes.put(key, type); - } - context.resolveSelfReferences(type); - return type; - } - - /** - * Factory method for resolving given generic type, defined by using sub-class - * instance of {@link GenericType} - */ - private ResolvedType _fromGenericType(ClassStack context, GenericType generic, TypeBindings typeBindings) - { - /* To allow multiple levels of inheritance (just in case someone - * wants to go to town with inheritance of GenericType), - * we better resolve the whole thing; then dig out - * type parameterization... - */ - ResolvedType type = _fromClass(context, generic.getClass(), typeBindings); - ResolvedType genType = type.findSupertype(GenericType.class); - if (genType == null) { // sanity check; shouldn't occur - throw new IllegalArgumentException("Unparameterized GenericType instance ("+generic.getClass().getName()+")"); - } - TypeBindings b = genType.getTypeBindings(); - ResolvedType[] params = b.typeParameterArray(); - if (params.length == 0) { - throw new IllegalArgumentException("Unparameterized GenericType instance ("+generic.getClass().getName()+")"); - } - return params[0]; - } - - private ResolvedType _constructType(ClassStack context, Class rawType, TypeBindings typeBindings) - { - // Ok: no easy shortcut, let's figure out type of type... - if (rawType.isArray()) { - ResolvedType elementType = _fromAny(context, rawType.getComponentType(), typeBindings); - return new ResolvedArrayType(rawType, typeBindings, elementType); - } - // For other types super interfaces are needed... - if (rawType.isInterface()) { - return new ResolvedInterfaceType(rawType, typeBindings, - _resolveSuperInterfaces(context, rawType, typeBindings)); - - } - return new ResolvedObjectType(rawType, typeBindings, - _resolveSuperClass(context, rawType, typeBindings), - _resolveSuperInterfaces(context, rawType, typeBindings)); - } - - private ResolvedType[] _resolveSuperInterfaces(ClassStack context, Class rawType, TypeBindings typeBindings) - { - Type[] types = rawType.getGenericInterfaces(); - if (types == null || types.length == 0) { - return NO_TYPES; - } - int len = types.length; - ResolvedType[] resolved = new ResolvedType[len]; - for (int i = 0; i < len; ++i) { - resolved[i] = _fromAny(context, types[i], typeBindings); - } - return resolved; - } - - /** - * NOTE: return type changed in 1.0.1 from {@link ResolvedObjectType} to - * {@link ResolvedType}, since it was found that other types may - * be returned... - * - * @return Usually a {@link ResolvedObjectType}, but possibly also - * {@link ResolvedRecursiveType} - */ - private ResolvedType _resolveSuperClass(ClassStack context, Class rawType, TypeBindings typeBindings) - { - Type parent = rawType.getGenericSuperclass(); - if (parent == null) { - return null; - } - return _fromAny(context, parent, typeBindings); - } - - private ResolvedType _fromParamType(ClassStack context, ParameterizedType ptype, TypeBindings parentBindings) - { - /* First: what is the actual base type? One odd thing is that 'getRawType' - * returns Type, not Class as one might expect. But let's assume it is - * always of type Class: if not, need to add more code to resolve it... - */ - Class rawType = (Class) ptype.getRawType(); - Type[] params = ptype.getActualTypeArguments(); - int len = params.length; - ResolvedType[] types = new ResolvedType[len]; - - for (int i = 0; i < len; ++i) { - types[i] = _fromAny(context, params[i], parentBindings); - } - // Ok: this gives us current bindings for this type: - TypeBindings newBindings = TypeBindings.create(rawType, types); - return _fromClass(context, rawType, newBindings); - } - - private ResolvedType _fromArrayType(ClassStack context, GenericArrayType arrayType, TypeBindings typeBindings) - { - ResolvedType elementType = _fromAny(context, arrayType.getGenericComponentType(), typeBindings); - // Figuring out raw class for generic array is actually bit tricky... - Object emptyArray = Array.newInstance(elementType.getErasedType(), 0); - return new ResolvedArrayType(emptyArray.getClass(), typeBindings, elementType); - } - - private ResolvedType _fromWildcard(ClassStack context, WildcardType wildType, TypeBindings typeBindings) - { - /* Similar to challenges with TypeVariable, we may have multiple upper bounds. - * But it is also possible that if upper bound defaults to Object, we might want to - * consider lower bounds instead? - * For now, we won't try anything more advanced; above is just for future reference. - */ - return _fromAny(context, wildType.getUpperBounds()[0], typeBindings); - } - - private ResolvedType _fromVariable(ClassStack context, TypeVariable variable, TypeBindings typeBindings) - { - // ideally should find it via bindings: - String name = variable.getName(); - ResolvedType type = typeBindings.findBoundType(name); - - if (type != null) { - return type; - } - - /* but if not, use bounds... note that approach here is simplistic; not taking - * into account possible multiple bounds, nor consider upper bounds. - */ - /* 02-Mar-2011, tatu: As per issue#4, need to avoid self-reference cycles here; - * can be handled by (temporarily) adding binding: - */ - if (typeBindings.hasUnbound(name)) { - return sJavaLangObject; - } - typeBindings = typeBindings.withUnboundVariable(name); - - Type[] bounds = variable.getBounds(); - return _fromAny(context, bounds[0], typeBindings); - } - - /* - /********************************************************************** - /* Internal methods, replacing and verifying type placeholders - /********************************************************************** - */ - - /** - * Method called to verify that types match; and if there are - */ - private void _resolveTypePlaceholders(ResolvedType expectedType, ResolvedType actualType) - throws IllegalArgumentException - { - List expectedTypes = expectedType.getTypeParameters(); - List actualTypes = actualType.getTypeParameters(); - for (int i = 0, len = expectedTypes.size(); i < len; ++i) { - ResolvedType exp = expectedTypes.get(i); - ResolvedType act = actualTypes.get(i); - if (!_typesMatch(exp, act)) { - throw new IllegalArgumentException("Type parameter #"+(i+1)+"/"+len+" differs; expected " - +exp.getBriefDescription()+", got "+act.getBriefDescription()); - } - } - } - - private boolean _typesMatch(ResolvedType exp, ResolvedType act) - { - // Simple equality check, except for one thing: place holders for 'act' - if (act instanceof TypePlaceHolder) { - ((TypePlaceHolder) act).actualType(exp); - return true; - } - // but due to recursive nature can't call equality... - if (exp.getErasedType() != act.getErasedType()) { - return false; - } - // But we can check type parameters "blindly" - List expectedTypes = exp.getTypeParameters(); - List actualTypes = act.getTypeParameters(); - for (int i = 0, len = expectedTypes.size(); i < len; ++i) { - ResolvedType exp2 = expectedTypes.get(i); - ResolvedType act2 = actualTypes.get(i); - if (!_typesMatch(exp2, act2)) { - return false; - } - } - return true; - } - - /* - /********************************************************************** - /* Helper classes - /********************************************************************** - */ -} diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/members/HierarchicType.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/members/HierarchicType.java deleted file mode 100644 index defa550ed..000000000 --- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/members/HierarchicType.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.fr.third.com.fasterxml.classmate.members; - -import com.fr.third.com.fasterxml.classmate.ResolvedType; -import com.fr.third.com.fasterxml.classmate.ResolvedTypeWithMembers; - -/** - * Container class used to enclose information about a single {@link ResolvedType} - * that is part of {@link ResolvedTypeWithMembers}. - */ -public final class HierarchicType -{ - /** - * Whether this type instance represents a mix-in; if so, it can only result in - * addition of annotations but not in addition of actual members. - */ - protected final boolean _isMixin; - - protected final ResolvedType _type; - - /** - * Relative priority of this type in hierarchy; higher priority members can override - * lower priority members. Priority values are unique and are based on type index - * (starting from 0), although they are not to be used for indexing. - */ - protected final int _priority; - - /* - /********************************************************************** - /* Life cycle - /********************************************************************** - */ - - public HierarchicType(ResolvedType type, boolean mixin, int priority) - { - _type = type; - _isMixin = mixin; - _priority = priority; - } - - /* - /********************************************************************** - /* Simple accessors - /********************************************************************** - */ - - public ResolvedType getType() { return _type; } - public Class getErasedType() { return _type.getErasedType(); } - public boolean isMixin() { return _isMixin; } - public int getPriority() { return _priority; } - - /* - /********************************************************************** - /* Standard methods - /********************************************************************** - */ - - @Override public String toString() { return _type.toString(); } - @Override public int hashCode() { return _type.hashCode(); } - - @Override - public boolean equals(Object o) - { - if (o == this) return true; - if (o == null || o.getClass() != getClass()) return false; - HierarchicType other = (HierarchicType) o; - return _type.equals(other._type); - } -} diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/members/RawConstructor.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/members/RawConstructor.java deleted file mode 100644 index 0cd8280c1..000000000 --- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/members/RawConstructor.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.fr.third.com.fasterxml.classmate.members; - -import java.lang.reflect.Constructor; - -import com.fr.third.com.fasterxml.classmate.ResolvedType; -import com.fr.third.com.fasterxml.classmate.util.MethodKey; - -public final class RawConstructor extends RawMember -{ - protected final Constructor _constructor; - - protected final int _hashCode; - - public RawConstructor(ResolvedType context, Constructor constructor) - { - super(context); - _constructor = constructor; - _hashCode = (_constructor == null ? 0 : _constructor.hashCode()); - } - - /** - * Although constructors are different from other methods, we can use - * {@link MethodKey} easily. - */ - public MethodKey createKey() - { - String name = ""; // do not use _constructor.getName() to allow for 'mix-ins' - Class[] argTypes = _constructor.getParameterTypes(); // return of Constructor#getParameterTypes will never be null - return new MethodKey(name, argTypes); - } - - /* - /********************************************************************** - /* Simple accessors - /********************************************************************** - */ - - @Override - public Constructor getRawMember() { - return _constructor; - } - - /* - /********************************************************************** - /* Standard methods - /********************************************************************** - */ - - @Override public int hashCode() - { - return _hashCode; - } - - @Override public boolean equals(Object o) - { - if (o == this) return true; - if (o == null || o.getClass() != getClass()) return false; - RawConstructor other = (RawConstructor) o; - return (other._constructor == _constructor); - } -} diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/members/RawField.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/members/RawField.java deleted file mode 100644 index bef99fb93..000000000 --- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/members/RawField.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.fr.third.com.fasterxml.classmate.members; - -import java.lang.reflect.Field; -import java.lang.reflect.Modifier; - -import com.fr.third.com.fasterxml.classmate.ResolvedType; - -public final class RawField extends RawMember -{ - protected final Field _field; - - private final int _hashCode; - - public RawField(ResolvedType context, Field field) - { - super(context); - _field = field; - _hashCode = (_field == null ? 0 : _field.hashCode()); - } - - /* - /********************************************************************** - /* Simple accessors - /********************************************************************** - */ - - @Override - public Field getRawMember() { - return _field; - } - - public boolean isTransient() { - return Modifier.isTransient(getModifiers()); - } - - public boolean isVolatile() { - return Modifier.isVolatile(getModifiers()); - } - - /* - /********************************************************************** - /* Standard methods - /********************************************************************** - */ - - @Override public boolean equals(Object o) - { - if (o == this) return true; - if (o == null || o.getClass() != getClass()) return false; - RawField other = (RawField) o; - return (other._field == _field); - } - - @Override public int hashCode() - { - return _hashCode; - } -} diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/members/RawMember.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/members/RawMember.java deleted file mode 100644 index 9862f5131..000000000 --- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/members/RawMember.java +++ /dev/null @@ -1,98 +0,0 @@ -package com.fr.third.com.fasterxml.classmate.members; - -import java.lang.annotation.Annotation; -import java.lang.reflect.AnnotatedElement; -import java.lang.reflect.Member; -import java.lang.reflect.Modifier; - -import com.fr.third.com.fasterxml.classmate.ResolvedType; - -/** - * Base class for all "raw" member (field, method, constructor) types; raw means that - * actual types are not yet resolved, but relationship to declaring type is - * retained for eventual resolution. - * Instances are typically created by {@link ResolvedType} - * when requested, and form the input to eventual full flattening of type members. - */ -public abstract class RawMember -{ - /** - * {@link ResolvedType} (class with generic type parameters) that declared - * this member - */ - protected final ResolvedType _declaringType; - - /* - /********************************************************************** - /* Life cycle - /********************************************************************** - */ - - protected RawMember(ResolvedType context) - { - _declaringType = context; - } - - /* - /********************************************************************** - /* Simple accessors - /********************************************************************** - */ - - public final ResolvedType getDeclaringType() { - return _declaringType; - } - - public abstract Member getRawMember(); - - public String getName() { - return getRawMember().getName(); - } - - public boolean isStatic() { - return Modifier.isStatic(getModifiers()); - } - - public boolean isFinal() { - return Modifier.isFinal(getModifiers()); - } - - public boolean isPrivate() { - return Modifier.isPrivate(getModifiers()); - } - - public boolean isProtected() { - return Modifier.isProtected(getModifiers()); - } - - public boolean isPublic() { - return Modifier.isPublic(getModifiers()); - } - - public Annotation[] getAnnotations() { - return ((AnnotatedElement) getRawMember()).getAnnotations(); - } - - /* - /********************************************************************** - /* Standard method overrides - /********************************************************************** - */ - - // make abstract to force implementation by sub-class - @Override public abstract boolean equals(Object o); - - @Override public abstract int hashCode(); - - @Override public String toString() { - return getName(); - } - - /* - /********************************************************************** - /* Package methods - /********************************************************************** - */ - - protected final int getModifiers() { return getRawMember().getModifiers(); } -} diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/members/RawMethod.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/members/RawMethod.java deleted file mode 100644 index 6fac0ab34..000000000 --- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/members/RawMethod.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.fr.third.com.fasterxml.classmate.members; - -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; - -import com.fr.third.com.fasterxml.classmate.ResolvedType; -import com.fr.third.com.fasterxml.classmate.util.MethodKey; - -public final class RawMethod extends RawMember -{ - protected final Method _method; - - protected final int _hashCode; - - public RawMethod(ResolvedType context, Method method) - { - super(context); - _method = method; - _hashCode = (_method == null ? 0 : _method.hashCode()); - } - - /* - /********************************************************************** - /* Simple accessors - /********************************************************************** - */ - - @Override - public Method getRawMember() { - return _method; - } - - public boolean isAbstract() { - return Modifier.isAbstract(getModifiers()); - } - - public boolean isStrict() { - return Modifier.isStrict(getModifiers()); - } - - public boolean isNative() { - return Modifier.isNative(getModifiers()); - } - - public boolean isSynchronized() { - return Modifier.isSynchronized(getModifiers()); - } - - public MethodKey createKey() - { - String name = _method.getName(); - Class[] argTypes = _method.getParameterTypes(); // return of Method#getParameterTypes will never be null - return new MethodKey(name, argTypes); - } - - /* - /********************************************************************** - /* Standard methods - /********************************************************************** - */ - - @Override public int hashCode() - { - return _hashCode; - } - - @Override public boolean equals(Object o) - { - if (o == this) return true; - if (o == null || o.getClass() != getClass()) return false; - RawMethod other = (RawMethod) o; - return (other._method == _method); - } -} diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/members/ResolvedConstructor.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/members/ResolvedConstructor.java deleted file mode 100644 index 63fb546b9..000000000 --- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/members/ResolvedConstructor.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.fr.third.com.fasterxml.classmate.members; - -import java.lang.reflect.Constructor; - -import com.fr.third.com.fasterxml.classmate.Annotations; -import com.fr.third.com.fasterxml.classmate.ResolvedType; - -/** - * Class that represents a constructor that has fully resolved generic - * type information and annotation information. - */ -public final class ResolvedConstructor extends ResolvedParameterizedMember> -{ - public ResolvedConstructor(ResolvedType context, Annotations ann, Constructor constructor, - ResolvedType[] argumentTypes) - { - super(context, ann, constructor, null, argumentTypes); - } - - /* - /********************************************************************** - /* Simple accessors - /********************************************************************** - */ - -} diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/members/ResolvedField.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/members/ResolvedField.java deleted file mode 100644 index e930c0b2f..000000000 --- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/members/ResolvedField.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.fr.third.com.fasterxml.classmate.members; - -import java.lang.reflect.Field; -import java.lang.reflect.Modifier; - -import com.fr.third.com.fasterxml.classmate.Annotations; -import com.fr.third.com.fasterxml.classmate.ResolvedType; - -public final class ResolvedField extends ResolvedMember - implements Comparable -{ - public ResolvedField(ResolvedType context, Annotations ann, - Field field, ResolvedType type) - { - super(context, ann, field, type); - } - - /* - /********************************************************************** - /* Simple accessors - /********************************************************************** - */ - - public boolean isTransient() { - return Modifier.isTransient(getModifiers()); - } - - public boolean isVolatile() { - return Modifier.isVolatile(getModifiers()); - } - - @Override - public int compareTo(ResolvedField other) { - return getName().compareTo(other.getName()); - } -} diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/members/ResolvedMember.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/members/ResolvedMember.java deleted file mode 100644 index 01792c544..000000000 --- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/members/ResolvedMember.java +++ /dev/null @@ -1,156 +0,0 @@ -package com.fr.third.com.fasterxml.classmate.members; - -import java.lang.annotation.Annotation; -import java.lang.reflect.Member; -import java.lang.reflect.Modifier; - -import com.fr.third.com.fasterxml.classmate.Annotations; -import com.fr.third.com.fasterxml.classmate.ResolvedType; - -/** - * Fully type-resolved equivalent of {@link RawMember}. Only members "that matter" (ones not - * overridden, or filtered out) are resolved, since resolution process can add non-trivial - * overhead. - */ -public abstract class ResolvedMember -{ - /** - * {@link ResolvedType} (class with generic type parameters) that declared - * this member - */ - protected final ResolvedType _declaringType; - - protected final Annotations _annotations; - - protected final T _member; - - protected final ResolvedType _type; - - protected final int _hashCode; - - /* - /********************************************************************** - /* Life cycle - /********************************************************************** - */ - - protected ResolvedMember(ResolvedType context, Annotations ann, T member, ResolvedType type) - { - _declaringType = context; - _annotations = ann; - _member = member; - _type = type; - _hashCode = (_member == null ? 0 : _member.hashCode()); - } - - public void applyOverride(Annotation override) - { - _annotations.add(override); - } - - public void applyOverrides(Annotations overrides) - { - _annotations.addAll(overrides); - } - - public void applyDefault(Annotation override) - { - _annotations.addAsDefault(override); - } - - public A get(Class cls) - { - return _annotations.get(cls); - } - - public Annotations getAnnotations() - { - return _annotations; - } - - /* - /********************************************************************** - /* Simple accessors - /********************************************************************** - */ - - public final ResolvedType getDeclaringType() { - return _declaringType; - } - - /** - * Returns type of this member; if it has one, for methods this is the - * return type, for fields field type, and for constructors null. - */ - public ResolvedType getType() { - return _type; - } - - /** - * Returns JDK object that represents member. - */ - public T getRawMember() { - return _member; - } - - public String getName() { - return getRawMember().getName(); - } - - public boolean isStatic() { - return Modifier.isStatic(getModifiers()); - } - - public boolean isFinal() { - return Modifier.isFinal(getModifiers()); - } - - public boolean isPrivate() { - return Modifier.isPrivate(getModifiers()); - } - - public boolean isProtected() { - return Modifier.isProtected(getModifiers()); - } - - public boolean isPublic() { - return Modifier.isPublic(getModifiers()); - } - - /* - /********************************************************************** - /* Standard method overrides - /********************************************************************** - */ - - @Override public String toString() { - return getName(); - } - - /* - /********************************************************************** - /* Package methods - /********************************************************************** - */ - - protected final int getModifiers() { return getRawMember().getModifiers(); } - - /* - /********************************************************************** - /* Standard methods - /********************************************************************** - */ - - @Override public int hashCode() { - return _hashCode; - } - - @Override public boolean equals(Object o) - { - if (o == this) return true; - if (o == null || o.getClass() != getClass()) return false; - ResolvedMember other = (ResolvedMember) o; - return (other._member == _member); - } - -} diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/members/ResolvedMethod.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/members/ResolvedMethod.java deleted file mode 100644 index 9f71cad1d..000000000 --- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/members/ResolvedMethod.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.fr.third.com.fasterxml.classmate.members; - -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; - -import com.fr.third.com.fasterxml.classmate.Annotations; -import com.fr.third.com.fasterxml.classmate.ResolvedType; - -public final class ResolvedMethod extends ResolvedParameterizedMember - implements Comparable -{ - public ResolvedMethod(ResolvedType context, Annotations ann, Method method, - ResolvedType returnType, ResolvedType[] argumentTypes) - { - super(context, ann, method, returnType, argumentTypes); - } - - /* - /********************************************************************** - /* Simple accessors from base class - /********************************************************************** - */ - - public boolean isAbstract() { - return Modifier.isAbstract(getModifiers()); - } - - public boolean isStrict() { - return Modifier.isStrict(getModifiers()); - } - - public boolean isNative() { - return Modifier.isNative(getModifiers()); - } - - public boolean isSynchronized() { - return Modifier.isSynchronized(getModifiers()); - } - - /* - /********************************************************************** - /* Extended API - /********************************************************************** - */ - - public ResolvedType getReturnType() { return getType(); } - - /* - /********************************************************************** - /* Standard method override - /********************************************************************** - */ - - @Override - public int compareTo(ResolvedMethod other) - { - // primary sort by name (alphabetic); secondary by arg count (ascending) - int diff = getName().compareTo(other.getName()); - if (diff == 0) { - // subtract fine, no fear of overflow here - diff = getArgumentCount() - other.getArgumentCount(); - } - return diff; - } -} diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/members/ResolvedParameterizedMember.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/members/ResolvedParameterizedMember.java deleted file mode 100644 index 80233cc00..000000000 --- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/members/ResolvedParameterizedMember.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.fr.third.com.fasterxml.classmate.members; - -import com.fr.third.com.fasterxml.classmate.Annotations; -import com.fr.third.com.fasterxml.classmate.ResolvedType; - -import java.lang.annotation.Annotation; -import java.lang.reflect.Member; - -/** - * Base type for resolved members that take some parameters (e.g. methods and constructors). - */ -public abstract class ResolvedParameterizedMember extends ResolvedMember { - - protected final ResolvedType[] _paramTypes; - - protected final Annotations[] _paramAnnotations; - - protected ResolvedParameterizedMember(ResolvedType context, Annotations ann, - T member, ResolvedType type, ResolvedType[] argumentTypes) { - super(context, ann, member, type); - _paramTypes = argumentTypes == null ? ResolvedType.NO_TYPES : argumentTypes; - _paramAnnotations = new Annotations[_paramTypes.length]; - } - - public Annotations getParameterAnnotations(int index) { - if (index >= _paramTypes.length) - throw new IndexOutOfBoundsException("No parameter at index " + index + ", this is greater than the total number of parameters"); - - if (_paramAnnotations[index] == null) { - _paramAnnotations[index] = new Annotations(); - } - return _paramAnnotations[index]; - } - - public void applyParamOverride(int index, Annotation override) - { - if (index >= _paramAnnotations.length) - return; - - getParameterAnnotations(index).add(override); - } - - public void applyParamOverrides(int index, Annotations overrides) - { - if (index >= _paramAnnotations.length) - return; - - getParameterAnnotations(index).addAll(overrides); - } - - public void applyParamDefault(int index, Annotation defaultValue) - { - if (index >= _paramAnnotations.length) - return; - - getParameterAnnotations(index).addAsDefault(defaultValue); - } - - public A getParam(int index, Class cls) - { - if (index >= _paramAnnotations.length) - return null; - - return _paramAnnotations[index].get(cls); - } - - /** - * Returns number of arguments method takes. - */ - public int getArgumentCount() { - return _paramTypes.length; - } - - public ResolvedType getArgumentType(int index) - { - if (index < 0 || index >= _paramTypes.length) { - return null; - } - return _paramTypes[index]; - } -} diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/members/package-info.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/members/package-info.java deleted file mode 100644 index b854566b5..000000000 --- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/members/package-info.java +++ /dev/null @@ -1,5 +0,0 @@ -/** - * Package that contains implementations of various member types - * (methods, fields, constructors) - */ -package com.fr.third.com.fasterxml.classmate.members; diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/package-info.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/package-info.java deleted file mode 100644 index 820128ab3..000000000 --- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/package-info.java +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Package that contains main public interface of ClassMate - * package. - *

- * Most commonly resolution starts with {@link com.fr.third.com.fasterxml.classmate.TypeResolver}, - * using its resolve() method, which returns a - * {@link com.fr.third.com.fasterxml.classmate.ResolvedType} instance. - * These type objects contain all necessary information about type itself; - * but if type information on members (fields, methods, constructors, static - * members) is needed, {@link com.fr.third.com.fasterxml.classmate.MemberResolver} can - * resolve types for members: it takes {@link com.fr.third.com.fasterxml.classmate.ResolvedType}s. - */ -package com.fr.third.com.fasterxml.classmate; diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/types/ResolvedArrayType.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/types/ResolvedArrayType.java deleted file mode 100644 index 099f9d2c3..000000000 --- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/types/ResolvedArrayType.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.fr.third.com.fasterxml.classmate.types; - -import java.util.*; - -import com.fr.third.com.fasterxml.classmate.ResolvedType; -import com.fr.third.com.fasterxml.classmate.TypeBindings; - -public final class ResolvedArrayType extends ResolvedType -{ - protected final ResolvedType _elementType; - - /* - /********************************************************************** - /* Life cycle - /********************************************************************** - */ - - public ResolvedArrayType(Class erased, TypeBindings bindings, - ResolvedType elementType) - { - super(erased, bindings); - _elementType = elementType; - } - - @Override - public boolean canCreateSubtypes() { - return false; - } - - /* - /********************************************************************** - /* Accessors for related types - /********************************************************************** - */ - - @Override - public ResolvedType getParentClass() { return null; } - - @Override - public ResolvedType getSelfReferencedType() { return null; } - - @Override - public List getImplementedInterfaces() { - return Collections.emptyList(); - } - - /* - /********************************************************************** - /* Simple property accessors - /********************************************************************** - */ - - @Override - public boolean isInterface() { - return false; - } - - @Override - public boolean isAbstract() { return false; } - - @Override - public ResolvedType getArrayElementType() { return _elementType; } - - @Override - public boolean isArray() { return true; } - - @Override - public boolean isPrimitive() { return false; } - - /* - /********************************************************************** - /* Accessors for raw (minimally procesed) members - /********************************************************************** - */ - - // defaults are fine (nothing to access) - - /* - /********************************************************************** - /* String representations - /********************************************************************** - */ - - @Override - public StringBuilder appendSignature(StringBuilder sb) { - sb.append('['); - return _elementType.appendSignature(sb); - } - - @Override - public StringBuilder appendErasedSignature(StringBuilder sb) { - sb.append('['); - return _elementType.appendErasedSignature(sb); - } - - @Override - public StringBuilder appendBriefDescription(StringBuilder sb) - { - sb = _elementType.appendBriefDescription(sb); - sb.append("[]"); - return sb; - } - - @Override - public StringBuilder appendFullDescription(StringBuilder sb) { - return appendBriefDescription(sb); - } -} diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/types/ResolvedInterfaceType.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/types/ResolvedInterfaceType.java deleted file mode 100644 index e4c045bfc..000000000 --- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/types/ResolvedInterfaceType.java +++ /dev/null @@ -1,162 +0,0 @@ -package com.fr.third.com.fasterxml.classmate.types; - -import java.util.*; - -import com.fr.third.com.fasterxml.classmate.ResolvedType; -import com.fr.third.com.fasterxml.classmate.TypeBindings; -import com.fr.third.com.fasterxml.classmate.members.RawField; -import com.fr.third.com.fasterxml.classmate.members.RawMethod; - -public class ResolvedInterfaceType extends ResolvedType -{ - - /** - * List of interfaces this type implements; may be empty but never null - */ - protected final ResolvedType[] _superInterfaces; - - /** - * Interfaces can have static final (constant) fields. - */ - protected RawField[] _constantFields; - - /** - * Interface methods are all public and abstract. - */ - protected RawMethod[] _memberMethods; - - /* - /********************************************************************** - /* Life cycle - /********************************************************************** - */ - - public ResolvedInterfaceType(Class erased, TypeBindings bindings, - ResolvedType[] superInterfaces) - { - super(erased, bindings); - _superInterfaces = (superInterfaces == null ? NO_TYPES : superInterfaces); - } - - @Override - public boolean canCreateSubtypes() { - return true; - } - - /* - /********************************************************************** - /* Accessors for related types - /********************************************************************** - */ - - @Override - public ResolvedType getParentClass() { - // interfaces do not have parent class, just interfaces - return null; - } - - @Override - public ResolvedType getSelfReferencedType() { return null; } - - @Override - public List getImplementedInterfaces() { - return (_superInterfaces.length == 0) ? - Collections.emptyList() : Arrays.asList(_superInterfaces); - } - - @Override - public ResolvedType getArrayElementType() { // interfaces are never arrays, so: - return null; - } - - /* - /********************************************************************** - /* Simple property accessors - /********************************************************************** - */ - - @Override - public boolean isInterface() { return true; } - - @Override - public boolean isAbstract() { return true; } - - @Override - public boolean isArray() { return false; } - - @Override - public boolean isPrimitive() { return false; } - - /* - /********************************************************************** - /* Accessors for raw (minimally procesed) members - /********************************************************************** - */ - - @Override - public synchronized List getStaticFields() - { - // Interfaces can have static fields, but only as static constants... - if (_constantFields == null) { - _constantFields = _getFields(true); - } - if (_constantFields.length == 0) { - return Collections.emptyList(); - } - return Arrays.asList(_constantFields); - } - - @Override - public synchronized List getMemberMethods() - { - if (_memberMethods == null) { - _memberMethods = _getMethods(false); - } - if (_memberMethods.length == 0) { - return Collections.emptyList(); - } - return Arrays.asList(_memberMethods); - } - - /* - /********************************************************************** - /* String representations - /********************************************************************** - */ - - @Override - public StringBuilder appendSignature(StringBuilder sb) { - return _appendClassSignature(sb); - } - - @Override - public StringBuilder appendErasedSignature(StringBuilder sb) { - return _appendErasedClassSignature(sb); - } - - @Override - public StringBuilder appendBriefDescription(StringBuilder sb) { - return _appendClassDescription(sb); - } - - @Override - public StringBuilder appendFullDescription(StringBuilder sb) - { - sb = _appendClassDescription(sb); - // interfaces 'extend' other interfaces... - int count = _superInterfaces.length; - if (count > 0) { - sb.append(" extends "); - for (int i = 0; i < count; ++i) { - if (i > 0) { - sb.append(","); - } - sb = _superInterfaces[i].appendBriefDescription(sb); - } - } - return sb; - } -} - - - diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/types/ResolvedObjectType.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/types/ResolvedObjectType.java deleted file mode 100644 index d23acee8b..000000000 --- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/types/ResolvedObjectType.java +++ /dev/null @@ -1,287 +0,0 @@ -package com.fr.third.com.fasterxml.classmate.types; - -import java.lang.reflect.Modifier; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -import com.fr.third.com.fasterxml.classmate.ResolvedType; -import com.fr.third.com.fasterxml.classmate.TypeBindings; -import com.fr.third.com.fasterxml.classmate.members.RawConstructor; -import com.fr.third.com.fasterxml.classmate.members.RawField; -import com.fr.third.com.fasterxml.classmate.members.RawMethod; - -/** - * Type implementation for classes that do not represent interfaces, - * primitive or array types. - */ -public class ResolvedObjectType extends ResolvedType -{ - /** - * While fundamentally super class has to be {@link ResolvedObjectType} - * (or null for {@link java.lang.Object}), we may need to hold on to - * a {@link ResolvedRecursiveType} occasionally. - */ - protected final ResolvedType _superClass; - - /** - * List of interfaces this type implements; may be empty but never null - */ - protected final ResolvedType[] _superInterfaces; - - /** - * Modifiers of the underlying class. - */ - protected final int _modifiers; - - /** - * Constructors declared by the resolved Object class. - */ - protected RawConstructor[] _constructors; - - protected RawField[] _memberFields; - protected RawField[] _staticFields; - - protected RawMethod[] _memberMethods; - protected RawMethod[] _staticMethods; - - /* - /********************************************************************** - /* Life cycle - /********************************************************************** - */ - - public ResolvedObjectType(Class erased, TypeBindings bindings, - ResolvedType superClass, List interfaces) - { - this(erased, bindings, superClass, - (interfaces == null || interfaces.isEmpty()) ? NO_TYPES : - interfaces.toArray(new ResolvedType[interfaces.size()])); - } - - public ResolvedObjectType(Class erased, TypeBindings bindings, - ResolvedType superClass, ResolvedType[] interfaces) - { - super(erased, bindings); - /* 19-Aug-2014, tatu: bit unclean, but has to do for now. - * Problem is, there is no common super-type, nor can we yet - * force or coerce recursive types. Rather, they may only get - * resolved only slightly after construction. So... need to - * keep a reference. - */ - if (superClass != null) { - if (!(superClass instanceof ResolvedObjectType) - && !(superClass instanceof ResolvedRecursiveType) - ) { - throw new IllegalArgumentException("Unexpected parent type for " - +erased.getName()+": "+superClass.getClass().getName()); - } - } - - _superClass = superClass; - _superInterfaces = (interfaces == null) ? NO_TYPES : interfaces; - _modifiers = erased.getModifiers(); - } - - @Deprecated // since 1.1; removed from 1.2 -- kept for binary backwards compatibility - public ResolvedObjectType(Class erased, TypeBindings bindings, - ResolvedObjectType superClass, List interfaces) - { - this(erased, bindings, (ResolvedType) superClass, interfaces); - } - - @Deprecated // since 1.1; removed from 1.2 -- kept for binary backwards compatibility - public ResolvedObjectType(Class erased, TypeBindings bindings, - ResolvedObjectType superClass, ResolvedType[] interfaces) - { - this(erased, bindings, (ResolvedType) superClass, interfaces); - } - - public static ResolvedObjectType create(Class erased, TypeBindings bindings, - ResolvedType superClass, List interfaces) - { - return new ResolvedObjectType(erased, bindings, superClass, interfaces); - } - - @Override - public boolean canCreateSubtypes() { - return true; - } - - /* - /********************************************************************** - /* Accessors for related types - /********************************************************************** - */ - - @Override - public ResolvedObjectType getParentClass() { - - /* 19-Aug-2014, tatu: Ugly does it... sigh. - * But can't be helped because ResolvedRecursiveType is typically only - * resolved after instances of this type have been constructed. - * This means that resolution will need to be done somewhat dynamically. - */ - if (_superClass == null) { - return null; - } - if (_superClass instanceof ResolvedObjectType) { - return (ResolvedObjectType) _superClass; - } - ResolvedType rt = ((ResolvedRecursiveType) _superClass).getSelfReferencedType(); - if (!(rt instanceof ResolvedObjectType)) { - throw new IllegalStateException("Internal error: self-referential parent type (" - +_superClass+") does not resolve into proper ResolvedObjectType, but instead to: " - +rt); - } - return (ResolvedObjectType) rt; - } - - @Override - public ResolvedType getSelfReferencedType() { return null; } - - @Override - public List getImplementedInterfaces() { - return (_superInterfaces.length == 0) ? - Collections.emptyList() : Arrays.asList(_superInterfaces); - } - - /* - /********************************************************************** - /* Accessors for related types - /********************************************************************** - */ - - @Override - public final ResolvedType getArrayElementType() { return null; } - - /* - /********************************************************************** - /* Simple property accessors - /********************************************************************** - */ - - @Override - public final boolean isInterface() { return false; } - - @Override - public boolean isAbstract() { - return Modifier.isAbstract(_modifiers); - } - - @Override - public final boolean isArray() { return false; } - - @Override - public final boolean isPrimitive() { return false; } - - /* - /********************************************************************** - /* Accessors for raw (minimally procesed) members - /********************************************************************** - */ - - @Override - public synchronized List getMemberFields() - { - if (_memberFields == null) { - _memberFields = _getFields(false); - } - if (_memberFields.length == 0) { - return Collections.emptyList(); - } - return Arrays.asList(_memberFields); - } - - @Override - public synchronized List getStaticFields() - { - if (_staticFields == null) { - _staticFields = _getFields(true); - } - if (_staticFields.length == 0) { - return Collections.emptyList(); - } - return Arrays.asList(_staticFields); - } - - @Override - public synchronized List getMemberMethods() - { - if (_memberMethods == null) { - _memberMethods = _getMethods(false); - } - if (_memberMethods.length == 0) { - return Collections.emptyList(); - } - return Arrays.asList(_memberMethods); - } - - @Override - public synchronized List getStaticMethods() - { - if (_staticMethods == null) { - _staticMethods = _getMethods(true); - } - if (_staticMethods.length == 0) { - return Collections.emptyList(); - } - return Arrays.asList(_staticMethods); - } - - @Override - public List getConstructors() - { - if (_constructors == null) { - _constructors = _getConstructors(); - } - if (_constructors.length == 0) { - return Collections.emptyList(); - } - return Arrays.asList(_constructors); - } - - /* - /********************************************************************** - /* String representations - /********************************************************************** - */ - - @Override - public StringBuilder appendSignature(StringBuilder sb) { - return _appendClassSignature(sb); - } - - @Override - public StringBuilder appendErasedSignature(StringBuilder sb) { - return _appendErasedClassSignature(sb); - } - - @Override - public StringBuilder appendBriefDescription(StringBuilder sb) { - return _appendClassDescription(sb); - } - - @Override - public StringBuilder appendFullDescription(StringBuilder sb) - { - sb = _appendClassDescription(sb); - if (_superClass != null) { - sb.append(" extends "); - sb = _superClass.appendBriefDescription(sb); - } - // interfaces 'extend' other interfaces... - int count = _superInterfaces.length; - if (count > 0) { - sb.append(" implements "); - for (int i = 0; i < count; ++i) { - if (i > 0) { - sb.append(","); - } - sb = _superInterfaces[i].appendBriefDescription(sb); - } - } - return sb; - } -} - diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/types/ResolvedPrimitiveType.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/types/ResolvedPrimitiveType.java deleted file mode 100644 index 34c9e9a91..000000000 --- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/types/ResolvedPrimitiveType.java +++ /dev/null @@ -1,157 +0,0 @@ -package com.fr.third.com.fasterxml.classmate.types; - -import java.util.*; - -import com.fr.third.com.fasterxml.classmate.ResolvedType; -import com.fr.third.com.fasterxml.classmate.TypeBindings; - -/** - * Type used for Java primitive types (which does not include arrays here). - *

- * Since set of primitive types is bounded, constructor is defined as protected, - * and class final; that is, new primitive types are not to be constructed - * by calling applications. - */ -public final class ResolvedPrimitiveType extends ResolvedType -{ - private final static ResolvedPrimitiveType VOID = new ResolvedPrimitiveType(Void.TYPE, 'V', "void"); - - /** - * Primitive types have single-character Signature, easy and efficient - * to just store here - */ - protected final String _signature; - - /** - * Human-readable description should be simple as well - */ - protected final String _description; - - /* - /********************************************************************** - /* Life cycle - /********************************************************************** - */ - - protected ResolvedPrimitiveType(Class erased, char sig, String desc) - { - super(erased, TypeBindings.emptyBindings()); - _signature = String.valueOf(sig); - _description = desc; - } - - public static List all() - { - ArrayList all = new ArrayList(); - all.add(new ResolvedPrimitiveType(Boolean.TYPE, 'Z', "boolean")); - all.add(new ResolvedPrimitiveType(Byte.TYPE, 'B', "byte")); - all.add(new ResolvedPrimitiveType(Short.TYPE, 'S', "short")); - all.add(new ResolvedPrimitiveType(Character.TYPE, 'C', "char")); - all.add(new ResolvedPrimitiveType(Integer.TYPE, 'I', "int")); - all.add(new ResolvedPrimitiveType(Long.TYPE, 'J', "long")); - all.add(new ResolvedPrimitiveType(Float.TYPE, 'F', "float")); - all.add(new ResolvedPrimitiveType(Double.TYPE, 'D', "double")); - return all; - } - - public static ResolvedPrimitiveType voidType() - { - return VOID; - } - - @Override - public boolean canCreateSubtypes() { - return false; - } - - /* - /********************************************************************** - /* Accessors for related types - /********************************************************************** - */ - - @Override - public ResolvedType getSelfReferencedType() { return null; } - - @Override - public ResolvedType getParentClass() { return null; } - - /* - /********************************************************************** - /* Simple property accessors - /********************************************************************** - */ - - @Override - public boolean isInterface() { return false; } - - @Override - public boolean isAbstract() { return false; } - - @Override - public ResolvedType getArrayElementType() { return null; } - - @Override - public boolean isArray() { return false; } - - @Override - public boolean isPrimitive() { return true; } - - @Override - public List getImplementedInterfaces() { - return Collections.emptyList(); - } - - /* - /********************************************************************** - /* Accessors for raw (minimally procesed) members - /********************************************************************** - */ - - // Primitive types are simple; no fields, no methods, no constructors - - /* - /********************************************************************** - /* String representations - /********************************************************************** - */ - - @Override - public String getSignature() { - return _signature; - } - - @Override - public String getErasedSignature() { - return _signature; - } - - @Override - public String getFullDescription() { - return _description; - } - - @Override - public StringBuilder appendSignature(StringBuilder sb) { - sb.append(_signature); - return sb; - } - - @Override - public StringBuilder appendErasedSignature(StringBuilder sb) { - sb.append(_signature); - return sb; - } - - @Override - public StringBuilder appendFullDescription(StringBuilder sb) { - sb.append(_description); - return sb; - } - - @Override - public StringBuilder appendBriefDescription(StringBuilder sb) { - sb.append(_description); - return sb; - } -} diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/types/ResolvedRecursiveType.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/types/ResolvedRecursiveType.java deleted file mode 100644 index f1146ff05..000000000 --- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/types/ResolvedRecursiveType.java +++ /dev/null @@ -1,149 +0,0 @@ -package com.fr.third.com.fasterxml.classmate.types; - -import java.lang.reflect.Modifier; -import java.util.*; - -import com.fr.third.com.fasterxml.classmate.ResolvedType; -import com.fr.third.com.fasterxml.classmate.TypeBindings; -import com.fr.third.com.fasterxml.classmate.members.RawConstructor; -import com.fr.third.com.fasterxml.classmate.members.RawField; -import com.fr.third.com.fasterxml.classmate.members.RawMethod; - -/** - * Specialized type placeholder used in cases where type definition is - * recursive; to avoid infinite loop, reference that would be "back" in - * hierarchy is represented by an instance of this class. - * Underlying information is achievable (for full resolution), but - * not exposed using super type (parent) accessors; and has special - * handling when used for constructing descriptions. - */ -public class ResolvedRecursiveType extends ResolvedType -{ - /** - * Actual fully resolved type; assigned once resolution is complete - */ - protected ResolvedType _referencedType; - - /* - /********************************************************************** - /* Life cycle - /********************************************************************** - */ - - public ResolvedRecursiveType(Class erased, TypeBindings bindings) - { - super(erased, bindings); - } - - @Override - public boolean canCreateSubtypes() { - return _referencedType.canCreateSubtypes(); - } - - public void setReference(ResolvedType ref) - { - // sanity check; should not be called multiple times - if (_referencedType != null) { - throw new IllegalStateException("Trying to re-set self reference; old value = "+_referencedType+", new = "+ref); - } - _referencedType = ref; - } - - - /* - /********************************************************************** - /* Accessors for related types - /********************************************************************** - */ - - /** - * To avoid infinite loops, will return null; - */ - @Override - public ResolvedType getParentClass() { - return null; - } - - @Override - public ResolvedType getSelfReferencedType() { return _referencedType; } - - /** - * To avoid infinite loops, will return empty list - */ - @Override - public List getImplementedInterfaces() { - return Collections.emptyList(); - } - - /** - * To avoid infinite loops, will return null type - */ - @Override - public ResolvedType getArrayElementType() { // interfaces are never arrays, so: - return null; - } - - /* - /********************************************************************** - /* Simple property accessors - /********************************************************************** - */ - - @Override - public boolean isInterface() { return _erasedType.isInterface(); } - - @Override - public boolean isAbstract() { return Modifier.isAbstract(_erasedType.getModifiers()); } - - @Override - public boolean isArray() { return _erasedType.isArray(); } - - @Override - public boolean isPrimitive() { return false; } - - /* - /********************************************************************** - /* Accessors for raw (minimally procesed) members - /********************************************************************** - */ - - @Override - public List getMemberFields() { return _referencedType.getMemberFields(); } - @Override - public List getStaticFields() { return _referencedType.getStaticFields(); } - @Override - public List getStaticMethods() { return _referencedType.getStaticMethods(); } - @Override - public List getMemberMethods() { return _referencedType.getMemberMethods(); } - @Override - public List getConstructors() { return _referencedType.getConstructors(); } - - /* - /********************************************************************** - /* String representations - /********************************************************************** - */ - - @Override - public StringBuilder appendSignature(StringBuilder sb) { - // to avoid infinite recursion, only print type erased version - return appendErasedSignature(sb); - } - - @Override - public StringBuilder appendErasedSignature(StringBuilder sb) { - return _appendErasedClassSignature(sb); - } - - @Override - public StringBuilder appendBriefDescription(StringBuilder sb) { - return _appendClassDescription(sb); - } - - @Override - public StringBuilder appendFullDescription(StringBuilder sb) - { - // should never get called, but just in case, only print brief description - return appendBriefDescription(sb); - } -} diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/types/TypePlaceHolder.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/types/TypePlaceHolder.java deleted file mode 100644 index 47157ecb6..000000000 --- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/types/TypePlaceHolder.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.fr.third.com.fasterxml.classmate.types; - -import java.util.*; - -import com.fr.third.com.fasterxml.classmate.ResolvedType; -import com.fr.third.com.fasterxml.classmate.TypeBindings; - -/** - * Placeholder used for resolving type assignments to figure out - * type parameters for subtypes. - */ -public class TypePlaceHolder extends ResolvedType -{ - protected final int _ordinal; - - /** - * Type assigned during wildcard resolution - */ - protected ResolvedType _actualType; - - public TypePlaceHolder(int ordinal) - { - super(Object.class, TypeBindings.emptyBindings()); - _ordinal = ordinal; - } - - @Override - public boolean canCreateSubtypes() { return false; } - - public ResolvedType actualType() { return _actualType; } - public void actualType(ResolvedType t) { _actualType = t; } - - /* - /********************************************************************** - /* Accessors for related types - /********************************************************************** - */ - - @Override - public ResolvedType getParentClass() { return null; } - - @Override - public ResolvedType getSelfReferencedType() { return null; } - - @Override - public List getImplementedInterfaces() { return Collections.emptyList(); } - - @Override - public ResolvedType getArrayElementType() { return null; } - - /* - /********************************************************************** - /* Simple property accessors - /********************************************************************** - */ - - @Override - public boolean isInterface() { return false; } - - @Override - public boolean isAbstract() { return true; } - - @Override - public boolean isArray() { return false; } - - @Override - public boolean isPrimitive() { return false; } - - /* - /********************************************************************** - /* Accessors for raw (minimally procesed) members - /********************************************************************** - */ - - /* - /********************************************************************** - /* String representations - /********************************************************************** - */ - - @Override - public StringBuilder appendSignature(StringBuilder sb) { - return _appendClassSignature(sb); - } - - @Override - public StringBuilder appendErasedSignature(StringBuilder sb) { - return _appendErasedClassSignature(sb); - } - - @Override - public StringBuilder appendBriefDescription(StringBuilder sb) { - sb.append('<').append(_ordinal).append('>'); - return sb; - } - - @Override - public StringBuilder appendFullDescription(StringBuilder sb) { - return appendBriefDescription(sb); - } -} diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/types/package-info.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/types/package-info.java deleted file mode 100644 index e8da046d9..000000000 --- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/types/package-info.java +++ /dev/null @@ -1,5 +0,0 @@ -/** - * Package that contains {@link com.fr.third.com.fasterxml.classmate.ResolvedType} - * implementation classes. - */ -package com.fr.third.com.fasterxml.classmate.types; diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/util/ClassKey.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/util/ClassKey.java deleted file mode 100644 index 402c005e0..000000000 --- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/util/ClassKey.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.fr.third.com.fasterxml.classmate.util; - -import java.io.Serializable; - -/** - * Helper class used as key when we need efficient Class-to-value lookups. - */ -@SuppressWarnings("serial") -public class ClassKey - implements Comparable, Serializable -{ - private final String _className; - - private final Class _class; - - /** - * Let's cache hash code straight away, since we are almost certain to need it. - */ - private final int _hashCode; - - public ClassKey(Class clz) - { - _class = clz; - _className = clz.getName(); - _hashCode = _className.hashCode(); - } - - /* - /********************************************************************** - /* Comparable - /********************************************************************** - */ - - @Override - public int compareTo(ClassKey other) - { - // Just need to sort by name, ok to collide (unless used in TreeMap/Set!) - return _className.compareTo(other._className); - } - - /* - /********************************************************************** - /* Standard methods - /********************************************************************** - */ - - @Override - public boolean equals(Object o) - { - if (o == this) return true; - if (o == null) return false; - if (o.getClass() != getClass()) return false; - ClassKey other = (ClassKey) o; - - /* Is it possible to have different Class object for same name + class loader combo? - * Let's assume answer is no: if this is wrong, will need to uncomment following functionality - */ - /* - return (other._className.equals(_className)) - && (other._class.getClassLoader() == _class.getClassLoader()); - */ - return other._class == _class; - } - - @Override public int hashCode() { return _hashCode; } - - @Override public String toString() { return _className; } - -} diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/util/ClassStack.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/util/ClassStack.java deleted file mode 100644 index 4de5a5b09..000000000 --- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/util/ClassStack.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.fr.third.com.fasterxml.classmate.util; - -import java.util.ArrayList; - -import com.fr.third.com.fasterxml.classmate.ResolvedType; -import com.fr.third.com.fasterxml.classmate.types.ResolvedRecursiveType; - -/** - * Simple helper class used to keep track of 'call stack' for classes being referenced - * (as well as unbound variables) - */ -public final class ClassStack -{ - protected final ClassStack _parent; - protected final Class _current; - - private ArrayList _selfRefs; - - public ClassStack(Class rootType) { - this(null, rootType); - } - - private ClassStack(ClassStack parent, Class curr) { - _parent = parent; - _current = curr; - } - - /** - * @return New stack frame, if addition is ok; null if not - */ - public ClassStack child(Class cls) - { - return new ClassStack(this, cls); - } - - /** - * Method called to indicate that there is a self-reference from - * deeper down in stack pointing into type this stack frame represents. - */ - public void addSelfReference(ResolvedRecursiveType ref) - { - if (_selfRefs == null) { - _selfRefs = new ArrayList(); - } - _selfRefs.add(ref); - } - - /** - * Method called when type that this stack frame represents is - * fully resolved, allowing self-references to be completed - * (if there are any) - */ - public void resolveSelfReferences(ResolvedType resolved) - { - if (_selfRefs != null) { - for (ResolvedRecursiveType ref : _selfRefs) { - ref.setReference(resolved); - } - } - } - - public ClassStack find(Class cls) - { - if (_current == cls) return this; - for (ClassStack curr = _parent; curr != null; curr = curr._parent) { - if (curr._current == cls) { - return curr; - } - } - return null; - } -} diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/util/MethodKey.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/util/MethodKey.java deleted file mode 100644 index 94b309018..000000000 --- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/util/MethodKey.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.fr.third.com.fasterxml.classmate.util; - -import java.io.Serializable; - -/** - * Helper class needed when storing methods in maps. - * Immutable. - */ -@SuppressWarnings("serial") -public class MethodKey implements Serializable -{ - private static final Class[] NO_CLASSES = new Class[0]; - - private final String _name; - - private final Class[] _argumentTypes; - - private final int _hashCode; - - public MethodKey(String name) - { - _name = name; - _argumentTypes = NO_CLASSES; - _hashCode = name.hashCode(); - } - - public MethodKey(String name, Class[] argTypes) - { - _name = name; - _argumentTypes = argTypes; - _hashCode = name.hashCode() + argTypes.length; - } - - /* - /********************************************************************** - /* Standard methods - /********************************************************************** - */ - - /** - * Equality means name is the same and argument type erasures as well. - */ - @Override public boolean equals(Object o) - { - if (o == this) return true; - if (o == null || o.getClass() != getClass()) return false; - MethodKey other = (MethodKey) o; - Class[] otherArgs = other._argumentTypes; - int len = _argumentTypes.length; - if (otherArgs.length != len) return false; - for (int i = 0; i < len; ++i) { - if (otherArgs[i] != _argumentTypes[i]) return false; - } - return _name.equals(other._name); - } - - @Override public int hashCode() { return _hashCode; } - - @Override public String toString() - { - StringBuilder sb = new StringBuilder(); - sb.append(_name); - sb.append('('); - for (int i = 0, len = _argumentTypes.length; i < len; ++i) { - if (i > 0) sb.append(','); - sb.append(_argumentTypes[i].getName()); - } - sb.append(')'); - return sb.toString(); - } -} diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/util/ResolvedTypeCache.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/util/ResolvedTypeCache.java deleted file mode 100644 index 46847944b..000000000 --- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/util/ResolvedTypeCache.java +++ /dev/null @@ -1,141 +0,0 @@ -package com.fr.third.com.fasterxml.classmate.util; - -import java.io.Serializable; -import java.util.*; - -import com.fr.third.com.fasterxml.classmate.ResolvedType; - -/** - * Simple LRU cache used for storing up to specified number of most recently accessed - * {@link ResolvedType} instances. - * Since usage pattern is such that caller needs synchronization, cache access methods - * are fully synchronized so that caller need not do explicit synchronization. - */ -@SuppressWarnings("serial") -public class ResolvedTypeCache implements Serializable -{ - protected final CacheMap _map; - - public ResolvedTypeCache(int maxEntries) { - _map = new CacheMap(maxEntries); - } - - /** - * Helper method for constructing reusable cache keys - */ - public Key key(Class simpleType) { - return new Key(simpleType); - } - - /** - * Helper method for constructing reusable cache keys - */ - public Key key(Class simpleType, ResolvedType[] tp) { - return new Key(simpleType, tp); - } - - public synchronized ResolvedType find(Key key) { - return _map.get(key); - } - - public synchronized int size() { - return _map.size(); - } - - public synchronized void put(Key key, ResolvedType type) { - _map.put(key, type); - } - - /* - /********************************************************************** - /* Methods for unit tests - /********************************************************************** - */ - - public void add(ResolvedType type) - { - List tp = type.getTypeParameters(); - ResolvedType[] tpa = tp.toArray(new ResolvedType[tp.size()]); - put(key(type.getErasedType(), tpa), type); - } - - /* - /********************************************************************** - /* Helper classes - /********************************************************************** - */ - - /** - * Key used for type entries. - */ - public static class Key - { - private final Class _erasedType; - - private final ResolvedType[] _typeParameters; - - private final int _hashCode; - - public Key(Class simpleType) { - this(simpleType, null); - } - - public Key(Class erasedType, ResolvedType[] tp) - { - // let's not hold on type empty arrays - if (tp != null && tp.length == 0) { - tp = null; - } - _erasedType = erasedType; - _typeParameters = tp; - int h = erasedType.getName().hashCode(); - if (tp != null) { - h += tp.length; - } - _hashCode = h; - } - - @Override - public int hashCode() { return _hashCode; } - - @Override - public boolean equals(Object o) - { - if (o == this) return true; - if (o == null || o.getClass() != getClass()) return false; - Key other = (Key) o; - if (other._erasedType != _erasedType) return false; - ResolvedType[] otherTP = other._typeParameters; - if (_typeParameters == null) { - return (otherTP == null); - } - if (otherTP == null || otherTP.length != _typeParameters.length) { - return false; - } - for (int i = 0, len = _typeParameters.length; i < len; ++i) { - if (!_typeParameters[i].equals(otherTP[i])) { - return false; - } - } - return true; - } - } - - /** - * Simple sub-class to get LRU cache - */ - private final static class CacheMap - extends LinkedHashMap - { - protected final int _maxEntries; - - public CacheMap(int maxEntries) { - _maxEntries = maxEntries; - } - - @Override - protected boolean removeEldestEntry(Map.Entry eldest) { - return size() > _maxEntries; - } - } -} diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/util/package-info.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/util/package-info.java deleted file mode 100644 index e82d06994..000000000 --- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/util/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Various utility classes used by ClassMate. - */ -package com.fr.third.com.fasterxml.classmate.util; diff --git a/fine-hibernate/src/main/java/com/fr/third/org/hibernate/boot/internal/SessionFactoryBuilderImpl.java b/fine-hibernate/src/main/java/com/fr/third/org/hibernate/boot/internal/SessionFactoryBuilderImpl.java index 57a874a82..57a755ef9 100644 --- a/fine-hibernate/src/main/java/com/fr/third/org/hibernate/boot/internal/SessionFactoryBuilderImpl.java +++ b/fine-hibernate/src/main/java/com/fr/third/org/hibernate/boot/internal/SessionFactoryBuilderImpl.java @@ -483,6 +483,7 @@ public class SessionFactoryBuilderImpl implements SessionFactoryBuilderImplement private Map querySubstitutions; private boolean strictJpaQueryLanguageCompliance; private boolean namedQueryStartupCheckingEnabled; + private boolean conventionalJavaConstants; private final boolean procedureParameterNullPassingEnabled; private final boolean collectionJoinSubqueryRewriteEnabled; @@ -600,6 +601,8 @@ public class SessionFactoryBuilderImpl implements SessionFactoryBuilderImplement this.querySubstitutions = ConfigurationHelper.toMap( QUERY_SUBSTITUTIONS, " ,=;:\n\t\r\f", configurationSettings ); this.strictJpaQueryLanguageCompliance = cfgService.getSetting( JPAQL_STRICT_COMPLIANCE, BOOLEAN, false ); this.namedQueryStartupCheckingEnabled = cfgService.getSetting( QUERY_STARTUP_CHECKING, BOOLEAN, true ); + this.conventionalJavaConstants = cfgService.getSetting( + CONVENTIONAL_JAVA_CONSTANTS, BOOLEAN, true ); this.procedureParameterNullPassingEnabled = cfgService.getSetting( PROCEDURE_NULL_PARAM_PASSING, BOOLEAN, false ); this.collectionJoinSubqueryRewriteEnabled = cfgService.getSetting( COLLECTION_JOIN_SUBQUERY, BOOLEAN, true ); @@ -851,6 +854,11 @@ public class SessionFactoryBuilderImpl implements SessionFactoryBuilderImplement return namedQueryStartupCheckingEnabled; } + @Override + public boolean isConventionalJavaConstants() { + return conventionalJavaConstants; + } + @Override public boolean isProcedureParameterNullPassingEnabled() { return procedureParameterNullPassingEnabled; @@ -1132,6 +1140,10 @@ public class SessionFactoryBuilderImpl implements SessionFactoryBuilderImplement return options.isNamedQueryStartupCheckingEnabled(); } + @Override + public boolean isConventionalJavaConstants() { + return options.isConventionalJavaConstants(); + } @Override public boolean isProcedureParameterNullPassingEnabled() { return options.isProcedureParameterNullPassingEnabled(); diff --git a/fine-hibernate/src/main/java/com/fr/third/org/hibernate/boot/internal/SessionFactoryOptionsImpl.java b/fine-hibernate/src/main/java/com/fr/third/org/hibernate/boot/internal/SessionFactoryOptionsImpl.java index ffaa7a149..f925b5cba 100644 --- a/fine-hibernate/src/main/java/com/fr/third/org/hibernate/boot/internal/SessionFactoryOptionsImpl.java +++ b/fine-hibernate/src/main/java/com/fr/third/org/hibernate/boot/internal/SessionFactoryOptionsImpl.java @@ -88,6 +88,9 @@ public class SessionFactoryOptionsImpl implements SessionFactoryOptions { private final Map querySubstitutions; private final boolean strictJpaQueryLanguageCompliance; private final boolean namedQueryStartupCheckingEnabled; + + private final boolean conventionalJavaConstants; + private final boolean procedureParameterNullPassingEnabled; private final boolean collectionJoinSubqueryRewriteEnabled; @@ -160,6 +163,7 @@ public class SessionFactoryOptionsImpl implements SessionFactoryOptions { this.querySubstitutions = state.getQuerySubstitutions(); this.strictJpaQueryLanguageCompliance = state.isStrictJpaQueryLanguageCompliance(); this.namedQueryStartupCheckingEnabled = state.isNamedQueryStartupCheckingEnabled(); + this.conventionalJavaConstants = state.isConventionalJavaConstants(); this.procedureParameterNullPassingEnabled = state.isProcedureParameterNullPassingEnabled(); this.collectionJoinSubqueryRewriteEnabled = state.isCollectionJoinSubqueryRewriteEnabled(); @@ -339,6 +343,11 @@ public class SessionFactoryOptionsImpl implements SessionFactoryOptions { return namedQueryStartupCheckingEnabled; } + @Override + public boolean isConventionalJavaConstants() { + return conventionalJavaConstants; + } + @Override public boolean isProcedureParameterNullPassingEnabled() { return procedureParameterNullPassingEnabled; diff --git a/fine-hibernate/src/main/java/com/fr/third/org/hibernate/boot/internal/SessionFactoryOptionsState.java b/fine-hibernate/src/main/java/com/fr/third/org/hibernate/boot/internal/SessionFactoryOptionsState.java index c73f94f8b..8835f3453 100644 --- a/fine-hibernate/src/main/java/com/fr/third/org/hibernate/boot/internal/SessionFactoryOptionsState.java +++ b/fine-hibernate/src/main/java/com/fr/third/org/hibernate/boot/internal/SessionFactoryOptionsState.java @@ -98,6 +98,8 @@ public interface SessionFactoryOptionsState { boolean isNamedQueryStartupCheckingEnabled(); + boolean isConventionalJavaConstants(); + boolean isProcedureParameterNullPassingEnabled(); boolean isCollectionJoinSubqueryRewriteEnabled(); diff --git a/fine-hibernate/src/main/java/com/fr/third/org/hibernate/boot/spi/AbstractDelegatingSessionFactoryOptions.java b/fine-hibernate/src/main/java/com/fr/third/org/hibernate/boot/spi/AbstractDelegatingSessionFactoryOptions.java index 3e8a7f603..97d723488 100644 --- a/fine-hibernate/src/main/java/com/fr/third/org/hibernate/boot/spi/AbstractDelegatingSessionFactoryOptions.java +++ b/fine-hibernate/src/main/java/com/fr/third/org/hibernate/boot/spi/AbstractDelegatingSessionFactoryOptions.java @@ -198,6 +198,11 @@ public abstract class AbstractDelegatingSessionFactoryOptions implements Session return delegate.isNamedQueryStartupCheckingEnabled(); } + @Override + public boolean isConventionalJavaConstants() { + return delegate.isConventionalJavaConstants(); + } + @Override public boolean isProcedureParameterNullPassingEnabled() { return delegate.isProcedureParameterNullPassingEnabled(); diff --git a/fine-hibernate/src/main/java/com/fr/third/org/hibernate/boot/spi/SessionFactoryOptions.java b/fine-hibernate/src/main/java/com/fr/third/org/hibernate/boot/spi/SessionFactoryOptions.java index 7872aacb7..6c8972464 100644 --- a/fine-hibernate/src/main/java/com/fr/third/org/hibernate/boot/spi/SessionFactoryOptions.java +++ b/fine-hibernate/src/main/java/com/fr/third/org/hibernate/boot/spi/SessionFactoryOptions.java @@ -122,6 +122,8 @@ public interface SessionFactoryOptions { boolean isNamedQueryStartupCheckingEnabled(); + boolean isConventionalJavaConstants(); + boolean isSecondLevelCacheEnabled(); boolean isQueryCacheEnabled(); diff --git a/fine-hibernate/src/main/java/com/fr/third/org/hibernate/cfg/AvailableSettings.java b/fine-hibernate/src/main/java/com/fr/third/org/hibernate/cfg/AvailableSettings.java index 0ac6a9122..80541d2f1 100644 --- a/fine-hibernate/src/main/java/com/fr/third/org/hibernate/cfg/AvailableSettings.java +++ b/fine-hibernate/src/main/java/com/fr/third/org/hibernate/cfg/AvailableSettings.java @@ -564,6 +564,17 @@ public interface AvailableSettings { */ String QUERY_STARTUP_CHECKING = "hibernate.query.startup_check"; + /** + * Setting which indicates whether or not Java constant follow the Java Naming conventions. + *

+ * Default is {@code true}. Existing applications may want to disable this (set it {@code false}) if non-conventional Java constants are used. + * However, there is a significant performance overhead for using non-conventional Java constants since Hibernate cannot determine if aliases + * should be treated as Java constants or not. + * + * @since 5.2 + */ + String CONVENTIONAL_JAVA_CONSTANTS = "hibernate.query.conventional_java_constants"; + /** * The {@link com.fr.third.org.hibernate.exception.spi.SQLExceptionConverter} to use for converting SQLExceptions * to Hibernate's JDBCException hierarchy. The default is to use the configured diff --git a/fine-hibernate/src/main/java/com/fr/third/org/hibernate/hql/internal/ast/QueryTranslatorImpl.java b/fine-hibernate/src/main/java/com/fr/third/org/hibernate/hql/internal/ast/QueryTranslatorImpl.java index e7968fcca..ab9c923a8 100644 --- a/fine-hibernate/src/main/java/com/fr/third/org/hibernate/hql/internal/ast/QueryTranslatorImpl.java +++ b/fine-hibernate/src/main/java/com/fr/third/org/hibernate/hql/internal/ast/QueryTranslatorImpl.java @@ -612,7 +612,7 @@ public class QueryTranslatorImpl implements FilterTranslator { } private void handleDotStructure(AST dotStructureRoot) { final String expression = ASTUtil.getPathText( dotStructureRoot ); - final Object constant = ReflectHelper.getConstantValue( expression, factory.getServiceRegistry().getService( ClassLoaderService.class ) ); + final Object constant = ReflectHelper.getConstantValue( expression, factory ); if ( constant != null ) { dotStructureRoot.setFirstChild( null ); dotStructureRoot.setType( HqlTokenTypes.JAVA_CONSTANT ); diff --git a/fine-hibernate/src/main/java/com/fr/third/org/hibernate/hql/internal/ast/tree/JavaConstantNode.java b/fine-hibernate/src/main/java/com/fr/third/org/hibernate/hql/internal/ast/tree/JavaConstantNode.java index 2f77663fd..5a678968e 100644 --- a/fine-hibernate/src/main/java/com/fr/third/org/hibernate/hql/internal/ast/tree/JavaConstantNode.java +++ b/fine-hibernate/src/main/java/com/fr/third/org/hibernate/hql/internal/ast/tree/JavaConstantNode.java @@ -39,7 +39,7 @@ public class JavaConstantNode extends Node implements ExpectedTypeAwareNode, Ses // this method to get called twice. The first time with an empty string if ( StringHelper.isNotEmpty( s ) ) { constantExpression = s; - constantValue = ReflectHelper.getConstantValue( s, factory.getServiceRegistry().getService( ClassLoaderService.class ) ); + constantValue = ReflectHelper.getConstantValue( s, factory ); heuristicType = factory.getTypeResolver().heuristicType( constantValue.getClass().getName() ); super.setText( s ); } diff --git a/fine-hibernate/src/main/java/com/fr/third/org/hibernate/hql/internal/ast/util/LiteralProcessor.java b/fine-hibernate/src/main/java/com/fr/third/org/hibernate/hql/internal/ast/util/LiteralProcessor.java index c414c847f..6fb54838d 100644 --- a/fine-hibernate/src/main/java/com/fr/third/org/hibernate/hql/internal/ast/util/LiteralProcessor.java +++ b/fine-hibernate/src/main/java/com/fr/third/org/hibernate/hql/internal/ast/util/LiteralProcessor.java @@ -107,7 +107,7 @@ public class LiteralProcessor implements HqlSqlTokenTypes { setSQLValue( node, text, discrim ); } else { - Object value = ReflectHelper.getConstantValue( text, walker.getSessionFactoryHelper().getFactory().getServiceRegistry().getService( ClassLoaderService.class ) ); + Object value = ReflectHelper.getConstantValue( text, walker.getSessionFactoryHelper().getFactory() ); if ( value == null ) { throw new InvalidPathException( "Invalid path: '" + text + "'" ); } diff --git a/fine-hibernate/src/main/java/com/fr/third/org/hibernate/hql/internal/classic/WhereParser.java b/fine-hibernate/src/main/java/com/fr/third/org/hibernate/hql/internal/classic/WhereParser.java index 618950829..7f22b82ee 100644 --- a/fine-hibernate/src/main/java/com/fr/third/org/hibernate/hql/internal/classic/WhereParser.java +++ b/fine-hibernate/src/main/java/com/fr/third/org/hibernate/hql/internal/classic/WhereParser.java @@ -419,7 +419,7 @@ public class WhereParser implements Parser { Object constant; if ( token.indexOf( '.' ) > -1 && - ( constant = ReflectHelper.getConstantValue( token, q.getFactory().getServiceRegistry().getService( ClassLoaderService.class ) ) ) != null + ( constant = ReflectHelper.getConstantValue( token, q.getFactory() ) ) != null ) { Type type; try { diff --git a/fine-hibernate/src/main/java/com/fr/third/org/hibernate/internal/util/ReflectHelper.java b/fine-hibernate/src/main/java/com/fr/third/org/hibernate/internal/util/ReflectHelper.java index bb9d5aa3a..819fc0358 100644 --- a/fine-hibernate/src/main/java/com/fr/third/org/hibernate/internal/util/ReflectHelper.java +++ b/fine-hibernate/src/main/java/com/fr/third/org/hibernate/internal/util/ReflectHelper.java @@ -13,12 +13,14 @@ import java.lang.reflect.Member; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.util.Locale; +import java.util.regex.Pattern; import com.fr.third.org.hibernate.AssertionFailure; import com.fr.third.org.hibernate.MappingException; import com.fr.third.org.hibernate.PropertyNotFoundException; import com.fr.third.org.hibernate.boot.registry.classloading.spi.ClassLoaderService; import com.fr.third.org.hibernate.boot.registry.classloading.spi.ClassLoadingException; +import com.fr.third.org.hibernate.engine.spi.SessionFactoryImplementor; import com.fr.third.org.hibernate.property.access.internal.PropertyAccessStrategyMixedImpl; import com.fr.third.org.hibernate.property.access.spi.Getter; import com.fr.third.org.hibernate.type.PrimitiveType; @@ -32,6 +34,8 @@ import com.fr.third.org.hibernate.type.Type; */ @SuppressWarnings("unchecked") public final class ReflectHelper { + private static final Pattern JAVA_CONSTANT_PATTERN = Pattern.compile( + "[a-z\\d]+\\.([A-Z]+[a-z\\d]+)+\\$?([A-Z]{1}[a-z\\d]+)*\\.[A-Z_\\$]+", Pattern.UNICODE_CHARACTER_CLASS); public static final Class[] NO_PARAM_SIGNATURE = new Class[0]; public static final Object[] NO_PARAMS = new Object[0]; @@ -229,9 +233,15 @@ public final class ReflectHelper { return PropertyAccessStrategyMixedImpl.INSTANCE.buildPropertyAccess( clazz, name ).getGetter(); } - public static Object getConstantValue(String name, ClassLoaderService classLoaderService) { + public static Object getConstantValue(String name, SessionFactoryImplementor factory) { + boolean conventionalJavaConstants = factory.getSessionFactoryOptions().isConventionalJavaConstants(); Class clazz; try { + if ( conventionalJavaConstants && + !JAVA_CONSTANT_PATTERN.matcher( name ).find() ) { + return null; + } + ClassLoaderService classLoaderService = factory.getServiceRegistry().getService( ClassLoaderService.class ); clazz = classLoaderService.classForName( StringHelper.qualifier( name ) ); } catch ( Throwable t ) { diff --git a/fine-jboss-logging/.gitignore b/fine-jboss-logging/.gitignore deleted file mode 100644 index 5d453cd8b..000000000 --- a/fine-jboss-logging/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -*.iml -.idea/ -.DS_Store -.project -.classpath -*.gradle \ No newline at end of file diff --git a/fine-jboss-logging/README.md b/fine-jboss-logging/README.md deleted file mode 100644 index 167a97c0d..000000000 --- a/fine-jboss-logging/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# fine-jboss-logging - -改包名的jboss-logging(3.3.0.Final),以下模块需要依赖该模块: - -- fine-hibernate diff --git a/fine-jboss-logging/lib/jboss-logmanager-1.5.2.Final.jar b/fine-jboss-logging/lib/jboss-logmanager-1.5.2.Final.jar deleted file mode 100644 index 7661371eb..000000000 Binary files a/fine-jboss-logging/lib/jboss-logmanager-1.5.2.Final.jar and /dev/null differ diff --git a/fine-jboss-logging/lib/log4j-1.2.17.jar b/fine-jboss-logging/lib/log4j-1.2.17.jar deleted file mode 100644 index 1d425cf7d..000000000 Binary files a/fine-jboss-logging/lib/log4j-1.2.17.jar and /dev/null differ diff --git a/fine-jboss-logging/lib/log4j-api-2.5.jar b/fine-jboss-logging/lib/log4j-api-2.5.jar deleted file mode 100644 index f18c9d063..000000000 Binary files a/fine-jboss-logging/lib/log4j-api-2.5.jar and /dev/null differ diff --git a/fine-jboss-logging/lib/slf4j-api-1.7.2.jar b/fine-jboss-logging/lib/slf4j-api-1.7.2.jar deleted file mode 100644 index 1a8870833..000000000 Binary files a/fine-jboss-logging/lib/slf4j-api-1.7.2.jar and /dev/null differ diff --git a/fine-jboss-logging/pom.xml b/fine-jboss-logging/pom.xml deleted file mode 100644 index 99db8427d..000000000 --- a/fine-jboss-logging/pom.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - 4.0.0 - - - com.fr.third - step3 - ${revision} - ../base-third-project/base-third-step3 - - - fine-jboss-logging - ${revision} - - - - com.fr.essential - fine-slf4j-api - ${essentialVersion} - - - com.fr.essential - fine-log4j2 - ${essentialVersion} - - 以下是lib的本地jar包依赖<--> - - com.fr.third - jboss-logmanager - local - system - ${basedir}/lib/jboss-logmanager-1.5.2.Final.jar - - - com.fr.third - log4j - local - system - ${basedir}/lib/log4j-1.2.17.jar - - - com.fr.third - log4j-api - local - system - ${basedir}/lib/log4j-api-2.5.jar - - - com.fr.third - slf4j-api - local - system - ${basedir}/lib/slf4j-api-1.7.2.jar - - - \ No newline at end of file diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/AbstractLoggerProvider.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/AbstractLoggerProvider.java deleted file mode 100644 index c1012a259..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/AbstractLoggerProvider.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2010 Red Hat, Inc. - * - * Licensed 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 com.fr.third.org.jboss.logging; - -import java.util.ArrayDeque; - -abstract class AbstractLoggerProvider { - - private final ThreadLocal> ndcStack = new ThreadLocal>(); - - public void clearNdc() { - ArrayDeque stack = ndcStack.get(); - if (stack != null) - stack.clear(); - } - - public String getNdc() { - ArrayDeque stack = ndcStack.get(); - return stack == null || stack.isEmpty() ? null : stack.peek().merged; - } - - public int getNdcDepth() { - ArrayDeque stack = ndcStack.get(); - return stack == null ? 0 : stack.size(); - } - - public String peekNdc() { - ArrayDeque stack = ndcStack.get(); - return stack == null || stack.isEmpty() ? "" : stack.peek().current; - } - - public String popNdc() { - ArrayDeque stack = ndcStack.get(); - return stack == null || stack.isEmpty() ? "" : stack.pop().current; - } - - public void pushNdc(String message) { - ArrayDeque stack = ndcStack.get(); - if (stack == null) { - stack = new ArrayDeque(); - ndcStack.set(stack); - } - stack.push(stack.isEmpty() ? new Entry(message) : new Entry(stack.peek(), message)); - } - - public void setNdcMaxDepth(int maxDepth) { - final ArrayDeque stack = ndcStack.get(); - if (stack != null) while (stack.size() > maxDepth) stack.pop(); - } - - private static class Entry { - - private String merged; - private String current; - - Entry(String current) { - merged = current; - this.current = current; - } - - Entry(Entry parent, String current) { - merged = parent.merged + ' ' + current; - this.current = current; - } - } -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/AbstractMdcLoggerProvider.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/AbstractMdcLoggerProvider.java deleted file mode 100644 index 2935bca9d..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/AbstractMdcLoggerProvider.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2010 Red Hat, Inc. - * - * Licensed 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 com.fr.third.org.jboss.logging; - -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; - -abstract class AbstractMdcLoggerProvider extends AbstractLoggerProvider { - - private final ThreadLocal> mdcMap = new ThreadLocal>(); - - public void clearMdc() { - final Map map = mdcMap.get(); - if (map != null) { - map.clear(); - } - } - - public Object getMdc(String key) { - return mdcMap.get() == null ? null : mdcMap.get().get(key); - } - - public Map getMdcMap() { - final Map map = mdcMap.get(); - return map == null ? Collections.emptyMap() : map; - } - - public Object putMdc(String key, Object value) { - Map map = mdcMap.get(); - if (map == null) { - map = new HashMap(); - mdcMap.set(map); - } - return map.put(key, value); - } - - public void removeMdc(String key) { - Map map = mdcMap.get(); - if (map == null) - return; - map.remove(key); - } -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/BasicLogger.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/BasicLogger.java deleted file mode 100644 index b6f7ffb83..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/BasicLogger.java +++ /dev/null @@ -1,1918 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2010 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed 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 com.fr.third.org.jboss.logging; - -/** - * An interface which specifies the basic logger methods. When used as the base interface of a typed logger, these methods will delegate - * to the corresponding underlying logger instance. - * - * @author David M. Lloyd - */ -public interface BasicLogger { - - /** - * Check to see if the given level is enabled for this logger. - * - * @param level the level to check for - * @return {@code true} if messages may be logged at the given level, {@code false} otherwise - */ - boolean isEnabled(Logger.Level level); - - /** - * Check to see if the {@code TRACE} level is enabled for this logger. - * - * @return {@code true} if messages logged at {@link Logger.Level#TRACE} may be accepted, {@code false} otherwise - */ - boolean isTraceEnabled(); - - /** - * Issue a log message with a level of TRACE. - * - * @param message the message - */ - void trace(Object message); - - /** - * Issue a log message and throwable with a level of TRACE. - * - * @param message the message - * @param t the throwable - */ - void trace(Object message, Throwable t); - - /** - * Issue a log message and throwable with a level of TRACE and a specific logger class name. - * - * @param loggerFqcn the logger class name - * @param message the message - * @param t the throwable - */ - void trace(String loggerFqcn, Object message, Throwable t); - - /** - * Issue a log message with parameters and a throwable with a level of TRACE. - * - * @param loggerFqcn the logger class name - * @param message the message - * @param params the message parameters - * @param t the throwable - */ - void trace(String loggerFqcn, Object message, Object[] params, Throwable t); - - /** - * Issue a log message with a level of TRACE using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param params the parameters - */ - void tracev(String format, Object... params); - - /** - * Issue a log message with a level of TRACE using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param param1 the sole parameter - */ - void tracev(String format, Object param1); - - /** - * Issue a log message with a level of TRACE using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - */ - void tracev(String format, Object param1, Object param2); - - /** - * Issue a log message with a level of TRACE using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - void tracev(String format, Object param1, Object param2, Object param3); - - /** - * Issue a log message with a level of TRACE using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param params the parameters - */ - void tracev(Throwable t, String format, Object... params); - - /** - * Issue a log message with a level of TRACE using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param param1 the sole parameter - */ - void tracev(Throwable t, String format, Object param1); - - /** - * Issue a log message with a level of TRACE using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - */ - void tracev(Throwable t, String format, Object param1, Object param2); - - /** - * Issue a log message with a level of TRACE using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - void tracev(Throwable t, String format, Object param1, Object param2, Object param3); - - /** - * Issue a formatted log message with a level of TRACE. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param params the parameters - */ - void tracef(String format, Object... params); - - /** - * Issue a formatted log message with a level of TRACE. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the sole parameter - */ - void tracef(String format, Object param1); - - /** - * Issue a formatted log message with a level of TRACE. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the first parameter - * @param param2 the second parameter - */ - void tracef(String format, Object param1, Object param2); - - /** - * Issue a formatted log message with a level of TRACE. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - void tracef(String format, Object param1, Object param2, Object param3); - - /** - * Issue a formatted log message with a level of TRACE. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param params the parameters - */ - void tracef(Throwable t, String format, Object... params); - - /** - * Issue a formatted log message with a level of TRACE. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param param1 the sole parameter - */ - void tracef(Throwable t, String format, Object param1); - - /** - * Issue a formatted log message with a level of TRACE. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param param1 the first parameter - * @param param2 the second parameter - */ - void tracef(Throwable t, String format, Object param1, Object param2); - - /** - * Issue a formatted log message with a level of TRACE. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - void tracef(Throwable t, String format, Object param1, Object param2, Object param3); - - /** - * Issue a formatted log message with a level of TRACE. - * - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg the parameter - */ - void tracef(String format, int arg); - - /** - * Issue a formatted log message with a level of TRACE. - * - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg1 the first parameter - * @param arg2 the second parameter - */ - void tracef(String format, int arg1, int arg2); - - /** - * Issue a formatted log message with a level of TRACE. - * - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg1 the first parameter - * @param arg2 the second parameter - */ - void tracef(String format, int arg1, Object arg2); - - /** - * Issue a formatted log message with a level of TRACE. - * - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg1 the first parameter - * @param arg2 the second parameter - * @param arg3 the third parameter - */ - void tracef(String format, int arg1, int arg2, int arg3); - - /** - * Issue a formatted log message with a level of TRACE. - * - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg1 the first parameter - * @param arg2 the second parameter - * @param arg3 the third parameter - */ - void tracef(String format, int arg1, int arg2, Object arg3); - - /** - * Issue a formatted log message with a level of TRACE. - * - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg1 the first parameter - * @param arg2 the second parameter - * @param arg3 the third parameter - */ - void tracef(String format, int arg1, Object arg2, Object arg3); - - /** - * Issue a formatted log message with a level of TRACE. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg the parameter - */ - void tracef(Throwable t, String format, int arg); - - /** - * Issue a formatted log message with a level of TRACE. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg1 the first parameter - * @param arg2 the second parameter - */ - void tracef(Throwable t, String format, int arg1, int arg2); - - /** - * Issue a formatted log message with a level of TRACE. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg1 the first parameter - * @param arg2 the second parameter - */ - void tracef(Throwable t, String format, int arg1, Object arg2); - - /** - * Issue a formatted log message with a level of TRACE. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg1 the first parameter - * @param arg2 the second parameter - * @param arg3 the third parameter - */ - void tracef(Throwable t, String format, int arg1, int arg2, int arg3); - - /** - * Issue a formatted log message with a level of TRACE. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg1 the first parameter - * @param arg2 the second parameter - * @param arg3 the third parameter - */ - void tracef(Throwable t, String format, int arg1, int arg2, Object arg3); - - /** - * Issue a formatted log message with a level of TRACE. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg1 the first parameter - * @param arg2 the second parameter - * @param arg3 the third parameter - */ - void tracef(Throwable t, String format, int arg1, Object arg2, Object arg3); - - /** - * Issue a formatted log message with a level of TRACE. - * - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg the parameter - */ - void tracef(String format, long arg); - - /** - * Issue a formatted log message with a level of TRACE. - * - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg1 the first parameter - * @param arg2 the second parameter - */ - void tracef(String format, long arg1, long arg2); - - /** - * Issue a formatted log message with a level of TRACE. - * - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg1 the first parameter - * @param arg2 the second parameter - */ - void tracef(String format, long arg1, Object arg2); - - /** - * Issue a formatted log message with a level of TRACE. - * - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg1 the first parameter - * @param arg2 the second parameter - * @param arg3 the third parameter - */ - void tracef(String format, long arg1, long arg2, long arg3); - - /** - * Issue a formatted log message with a level of TRACE. - * - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg1 the first parameter - * @param arg2 the second parameter - * @param arg3 the third parameter - */ - void tracef(String format, long arg1, long arg2, Object arg3); - - /** - * Issue a formatted log message with a level of TRACE. - * - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg1 the first parameter - * @param arg2 the second parameter - * @param arg3 the third parameter - */ - void tracef(String format, long arg1, Object arg2, Object arg3); - - /** - * Issue a formatted log message with a level of TRACE. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg the parameter - */ - void tracef(Throwable t, String format, long arg); - - /** - * Issue a formatted log message with a level of TRACE. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg1 the first parameter - * @param arg2 the second parameter - */ - void tracef(Throwable t, String format, long arg1, long arg2); - - /** - * Issue a formatted log message with a level of TRACE. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg1 the first parameter - * @param arg2 the second parameter - */ - void tracef(Throwable t, String format, long arg1, Object arg2); - - /** - * Issue a formatted log message with a level of TRACE. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg1 the first parameter - * @param arg2 the second parameter - * @param arg3 the third parameter - */ - void tracef(Throwable t, String format, long arg1, long arg2, long arg3); - - /** - * Issue a formatted log message with a level of TRACE. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg1 the first parameter - * @param arg2 the second parameter - * @param arg3 the third parameter - */ - void tracef(Throwable t, String format, long arg1, long arg2, Object arg3); - - /** - * Issue a formatted log message with a level of TRACE. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg1 the first parameter - * @param arg2 the second parameter - * @param arg3 the third parameter - */ - void tracef(Throwable t, String format, long arg1, Object arg2, Object arg3); - - /** - * Check to see if the {@code DEBUG} level is enabled for this logger. - * - * @return {@code true} if messages logged at {@link Logger.Level#DEBUG} may be accepted, {@code false} otherwise - */ - boolean isDebugEnabled(); - - /** - * Issue a log message with a level of DEBUG. - * - * @param message the message - */ - void debug(Object message); - - /** - * Issue a log message and throwable with a level of DEBUG. - * - * @param message the message - * @param t the throwable - */ - void debug(Object message, Throwable t); - - /** - * Issue a log message and throwable with a level of DEBUG and a specific logger class name. - * - * @param loggerFqcn the logger class name - * @param message the message - * @param t the throwable - */ - void debug(String loggerFqcn, Object message, Throwable t); - - /** - * Issue a log message with parameters and a throwable with a level of DEBUG. - * - * @param loggerFqcn the logger class name - * @param message the message - * @param params the message parameters - * @param t the throwable - */ - void debug(String loggerFqcn, Object message, Object[] params, Throwable t); - - /** - * Issue a log message with a level of DEBUG using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param params the parameters - */ - void debugv(String format, Object... params); - - /** - * Issue a log message with a level of DEBUG using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param param1 the sole parameter - */ - void debugv(String format, Object param1); - - /** - * Issue a log message with a level of DEBUG using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - */ - void debugv(String format, Object param1, Object param2); - - /** - * Issue a log message with a level of DEBUG using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - void debugv(String format, Object param1, Object param2, Object param3); - - /** - * Issue a log message with a level of DEBUG using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param params the parameters - */ - void debugv(Throwable t, String format, Object... params); - - /** - * Issue a log message with a level of DEBUG using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param param1 the sole parameter - */ - void debugv(Throwable t, String format, Object param1); - - /** - * Issue a log message with a level of DEBUG using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - */ - void debugv(Throwable t, String format, Object param1, Object param2); - - /** - * Issue a log message with a level of DEBUG using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - void debugv(Throwable t, String format, Object param1, Object param2, Object param3); - - /** - * Issue a formatted log message with a level of DEBUG. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param params the parameters - */ - void debugf(String format, Object... params); - - /** - * Issue a formatted log message with a level of DEBUG. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the sole parameter - */ - void debugf(String format, Object param1); - - /** - * Issue a formatted log message with a level of DEBUG. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the first parameter - * @param param2 the second parameter - */ - void debugf(String format, Object param1, Object param2); - - /** - * Issue a formatted log message with a level of DEBUG. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - void debugf(String format, Object param1, Object param2, Object param3); - - /** - * Issue a formatted log message with a level of DEBUG. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param params the parameters - */ - void debugf(Throwable t, String format, Object... params); - - /** - * Issue a formatted log message with a level of DEBUG. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param param1 the sole parameter - */ - void debugf(Throwable t, String format, Object param1); - - /** - * Issue a formatted log message with a level of DEBUG. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param param1 the first parameter - * @param param2 the second parameter - */ - void debugf(Throwable t, String format, Object param1, Object param2); - - /** - * Issue a formatted log message with a level of DEBUG. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - void debugf(Throwable t, String format, Object param1, Object param2, Object param3); - - /** - * Issue a formatted log message with a level of DEBUG. - * - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg the parameter - */ - void debugf(String format, int arg); - - /** - * Issue a formatted log message with a level of DEBUG. - * - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg1 the first parameter - * @param arg2 the second parameter - */ - void debugf(String format, int arg1, int arg2); - - /** - * Issue a formatted log message with a level of DEBUG. - * - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg1 the first parameter - * @param arg2 the second parameter - */ - void debugf(String format, int arg1, Object arg2); - - /** - * Issue a formatted log message with a level of DEBUG. - * - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg1 the first parameter - * @param arg2 the second parameter - * @param arg3 the third parameter - */ - void debugf(String format, int arg1, int arg2, int arg3); - - /** - * Issue a formatted log message with a level of DEBUG. - * - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg1 the first parameter - * @param arg2 the second parameter - * @param arg3 the third parameter - */ - void debugf(String format, int arg1, int arg2, Object arg3); - - /** - * Issue a formatted log message with a level of DEBUG. - * - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg1 the first parameter - * @param arg2 the second parameter - * @param arg3 the third parameter - */ - void debugf(String format, int arg1, Object arg2, Object arg3); - - /** - * Issue a formatted log message with a level of DEBUG. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg the parameter - */ - void debugf(Throwable t, String format, int arg); - - /** - * Issue a formatted log message with a level of DEBUG. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg1 the first parameter - * @param arg2 the second parameter - */ - void debugf(Throwable t, String format, int arg1, int arg2); - - /** - * Issue a formatted log message with a level of DEBUG. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg1 the first parameter - * @param arg2 the second parameter - */ - void debugf(Throwable t, String format, int arg1, Object arg2); - - /** - * Issue a formatted log message with a level of DEBUG. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg1 the first parameter - * @param arg2 the second parameter - * @param arg3 the third parameter - */ - void debugf(Throwable t, String format, int arg1, int arg2, int arg3); - - /** - * Issue a formatted log message with a level of DEBUG. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg1 the first parameter - * @param arg2 the second parameter - * @param arg3 the third parameter - */ - void debugf(Throwable t, String format, int arg1, int arg2, Object arg3); - - /** - * Issue a formatted log message with a level of DEBUG. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg1 the first parameter - * @param arg2 the second parameter - * @param arg3 the third parameter - */ - void debugf(Throwable t, String format, int arg1, Object arg2, Object arg3); - - /** - * Issue a formatted log message with a level of DEBUG. - * - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg the parameter - */ - void debugf(String format, long arg); - - /** - * Issue a formatted log message with a level of DEBUG. - * - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg1 the first parameter - * @param arg2 the second parameter - */ - void debugf(String format, long arg1, long arg2); - - /** - * Issue a formatted log message with a level of DEBUG. - * - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg1 the first parameter - * @param arg2 the second parameter - */ - void debugf(String format, long arg1, Object arg2); - - /** - * Issue a formatted log message with a level of DEBUG. - * - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg1 the first parameter - * @param arg2 the second parameter - * @param arg3 the third parameter - */ - void debugf(String format, long arg1, long arg2, long arg3); - - /** - * Issue a formatted log message with a level of DEBUG. - * - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg1 the first parameter - * @param arg2 the second parameter - * @param arg3 the third parameter - */ - void debugf(String format, long arg1, long arg2, Object arg3); - - /** - * Issue a formatted log message with a level of DEBUG. - * - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg1 the first parameter - * @param arg2 the second parameter - * @param arg3 the third parameter - */ - void debugf(String format, long arg1, Object arg2, Object arg3); - - /** - * Issue a formatted log message with a level of DEBUG. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg the parameter - */ - void debugf(Throwable t, String format, long arg); - - /** - * Issue a formatted log message with a level of DEBUG. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg1 the first parameter - * @param arg2 the second parameter - */ - void debugf(Throwable t, String format, long arg1, long arg2); - - /** - * Issue a formatted log message with a level of DEBUG. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg1 the first parameter - * @param arg2 the second parameter - */ - void debugf(Throwable t, String format, long arg1, Object arg2); - - /** - * Issue a formatted log message with a level of DEBUG. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg1 the first parameter - * @param arg2 the second parameter - * @param arg3 the third parameter - */ - void debugf(Throwable t, String format, long arg1, long arg2, long arg3); - - /** - * Issue a formatted log message with a level of DEBUG. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg1 the first parameter - * @param arg2 the second parameter - * @param arg3 the third parameter - */ - void debugf(Throwable t, String format, long arg1, long arg2, Object arg3); - - /** - * Issue a formatted log message with a level of DEBUG. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param arg1 the first parameter - * @param arg2 the second parameter - * @param arg3 the third parameter - */ - void debugf(Throwable t, String format, long arg1, Object arg2, Object arg3); - - /** - * Check to see if the {@code INFO} level is enabled for this logger. - * - * @return {@code true} if messages logged at {@link Logger.Level#INFO} may be accepted, {@code false} otherwise - */ - boolean isInfoEnabled(); - - /** - * Issue a log message with a level of INFO. - * - * @param message the message - */ - void info(Object message); - - /** - * Issue a log message and throwable with a level of INFO. - * - * @param message the message - * @param t the throwable - */ - void info(Object message, Throwable t); - - /** - * Issue a log message and throwable with a level of INFO and a specific logger class name. - * - * @param loggerFqcn the logger class name - * @param message the message - * @param t the throwable - */ - void info(String loggerFqcn, Object message, Throwable t); - - /** - * Issue a log message with parameters and a throwable with a level of INFO. - * - * @param loggerFqcn the logger class name - * @param message the message - * @param params the message parameters - * @param t the throwable - */ - void info(String loggerFqcn, Object message, Object[] params, Throwable t); - - /** - * Issue a log message with a level of INFO using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param params the parameters - */ - void infov(String format, Object... params); - - /** - * Issue a log message with a level of INFO using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param param1 the sole parameter - */ - void infov(String format, Object param1); - - /** - * Issue a log message with a level of INFO using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - */ - void infov(String format, Object param1, Object param2); - - /** - * Issue a log message with a level of INFO using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - void infov(String format, Object param1, Object param2, Object param3); - - /** - * Issue a log message with a level of INFO using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param params the parameters - */ - void infov(Throwable t, String format, Object... params); - - /** - * Issue a log message with a level of INFO using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param param1 the sole parameter - */ - void infov(Throwable t, String format, Object param1); - - /** - * Issue a log message with a level of INFO using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - */ - void infov(Throwable t, String format, Object param1, Object param2); - - /** - * Issue a log message with a level of INFO using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - void infov(Throwable t, String format, Object param1, Object param2, Object param3); - - /** - * Issue a formatted log message with a level of INFO. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param params the parameters - */ - void infof(String format, Object... params); - - /** - * Issue a formatted log message with a level of INFO. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the sole parameter - */ - void infof(String format, Object param1); - - /** - * Issue a formatted log message with a level of INFO. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the first parameter - * @param param2 the second parameter - */ - void infof(String format, Object param1, Object param2); - - /** - * Issue a formatted log message with a level of INFO. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - void infof(String format, Object param1, Object param2, Object param3); - - /** - * Issue a formatted log message with a level of INFO. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param params the parameters - */ - void infof(Throwable t, String format, Object... params); - - /** - * Issue a formatted log message with a level of INFO. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param param1 the sole parameter - */ - void infof(Throwable t, String format, Object param1); - - /** - * Issue a formatted log message with a level of INFO. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param param1 the first parameter - * @param param2 the second parameter - */ - void infof(Throwable t, String format, Object param1, Object param2); - - /** - * Issue a formatted log message with a level of INFO. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - void infof(Throwable t, String format, Object param1, Object param2, Object param3); - - /** - * Issue a log message with a level of WARN. - * - * @param message the message - */ - void warn(Object message); - - /** - * Issue a log message and throwable with a level of WARN. - * - * @param message the message - * @param t the throwable - */ - void warn(Object message, Throwable t); - - /** - * Issue a log message and throwable with a level of WARN and a specific logger class name. - * - * @param loggerFqcn the logger class name - * @param message the message - * @param t the throwable - */ - void warn(String loggerFqcn, Object message, Throwable t); - - /** - * Issue a log message with parameters and a throwable with a level of WARN. - * - * @param loggerFqcn the logger class name - * @param message the message - * @param params the message parameters - * @param t the throwable - */ - void warn(String loggerFqcn, Object message, Object[] params, Throwable t); - - /** - * Issue a log message with a level of WARN using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param params the parameters - */ - void warnv(String format, Object... params); - - /** - * Issue a log message with a level of WARN using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param param1 the sole parameter - */ - void warnv(String format, Object param1); - - /** - * Issue a log message with a level of WARN using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - */ - void warnv(String format, Object param1, Object param2); - - /** - * Issue a log message with a level of WARN using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - void warnv(String format, Object param1, Object param2, Object param3); - - /** - * Issue a log message with a level of WARN using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param params the parameters - */ - void warnv(Throwable t, String format, Object... params); - - /** - * Issue a log message with a level of WARN using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param param1 the sole parameter - */ - void warnv(Throwable t, String format, Object param1); - - /** - * Issue a log message with a level of WARN using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - */ - void warnv(Throwable t, String format, Object param1, Object param2); - - /** - * Issue a log message with a level of WARN using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - void warnv(Throwable t, String format, Object param1, Object param2, Object param3); - - /** - * Issue a formatted log message with a level of WARN. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param params the parameters - */ - void warnf(String format, Object... params); - - /** - * Issue a formatted log message with a level of WARN. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the sole parameter - */ - void warnf(String format, Object param1); - - /** - * Issue a formatted log message with a level of WARN. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the first parameter - * @param param2 the second parameter - */ - void warnf(String format, Object param1, Object param2); - - /** - * Issue a formatted log message with a level of WARN. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - void warnf(String format, Object param1, Object param2, Object param3); - - /** - * Issue a formatted log message with a level of WARN. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param params the parameters - */ - void warnf(Throwable t, String format, Object... params); - - /** - * Issue a formatted log message with a level of WARN. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param param1 the sole parameter - */ - void warnf(Throwable t, String format, Object param1); - - /** - * Issue a formatted log message with a level of WARN. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param param1 the first parameter - * @param param2 the second parameter - */ - void warnf(Throwable t, String format, Object param1, Object param2); - - /** - * Issue a formatted log message with a level of WARN. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - void warnf(Throwable t, String format, Object param1, Object param2, Object param3); - - /** - * Issue a log message with a level of ERROR. - * - * @param message the message - */ - void error(Object message); - - /** - * Issue a log message and throwable with a level of ERROR. - * - * @param message the message - * @param t the throwable - */ - void error(Object message, Throwable t); - - /** - * Issue a log message and throwable with a level of ERROR and a specific logger class name. - * - * @param loggerFqcn the logger class name - * @param message the message - * @param t the throwable - */ - void error(String loggerFqcn, Object message, Throwable t); - - /** - * Issue a log message with parameters and a throwable with a level of ERROR. - * - * @param loggerFqcn the logger class name - * @param message the message - * @param params the message parameters - * @param t the throwable - */ - void error(String loggerFqcn, Object message, Object[] params, Throwable t); - - /** - * Issue a log message with a level of ERROR using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param params the parameters - */ - void errorv(String format, Object... params); - - /** - * Issue a log message with a level of ERROR using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param param1 the sole parameter - */ - void errorv(String format, Object param1); - - /** - * Issue a log message with a level of ERROR using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - */ - void errorv(String format, Object param1, Object param2); - - /** - * Issue a log message with a level of ERROR using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - void errorv(String format, Object param1, Object param2, Object param3); - - /** - * Issue a log message with a level of ERROR using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param params the parameters - */ - void errorv(Throwable t, String format, Object... params); - - /** - * Issue a log message with a level of ERROR using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param param1 the sole parameter - */ - void errorv(Throwable t, String format, Object param1); - - /** - * Issue a log message with a level of ERROR using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - */ - void errorv(Throwable t, String format, Object param1, Object param2); - - /** - * Issue a log message with a level of ERROR using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - void errorv(Throwable t, String format, Object param1, Object param2, Object param3); - - /** - * Issue a formatted log message with a level of ERROR. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param params the parameters - */ - void errorf(String format, Object... params); - - /** - * Issue a formatted log message with a level of ERROR. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the sole parameter - */ - void errorf(String format, Object param1); - - /** - * Issue a formatted log message with a level of ERROR. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the first parameter - * @param param2 the second parameter - */ - void errorf(String format, Object param1, Object param2); - - /** - * Issue a formatted log message with a level of ERROR. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - void errorf(String format, Object param1, Object param2, Object param3); - - /** - * Issue a formatted log message with a level of ERROR. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param params the parameters - */ - void errorf(Throwable t, String format, Object... params); - - /** - * Issue a formatted log message with a level of ERROR. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param param1 the sole parameter - */ - void errorf(Throwable t, String format, Object param1); - - /** - * Issue a formatted log message with a level of ERROR. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param param1 the first parameter - * @param param2 the second parameter - */ - void errorf(Throwable t, String format, Object param1, Object param2); - - /** - * Issue a formatted log message with a level of ERROR. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - void errorf(Throwable t, String format, Object param1, Object param2, Object param3); - - /** - * Issue a log message with a level of FATAL. - * - * @param message the message - */ - void fatal(Object message); - - /** - * Issue a log message and throwable with a level of FATAL. - * - * @param message the message - * @param t the throwable - */ - void fatal(Object message, Throwable t); - - /** - * Issue a log message and throwable with a level of FATAL and a specific logger class name. - * - * @param loggerFqcn the logger class name - * @param message the message - * @param t the throwable - */ - void fatal(String loggerFqcn, Object message, Throwable t); - - /** - * Issue a log message with parameters and a throwable with a level of FATAL. - * - * @param loggerFqcn the logger class name - * @param message the message - * @param params the message parameters - * @param t the throwable - */ - void fatal(String loggerFqcn, Object message, Object[] params, Throwable t); - - /** - * Issue a log message with a level of FATAL using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param params the parameters - */ - void fatalv(String format, Object... params); - - /** - * Issue a log message with a level of FATAL using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param param1 the sole parameter - */ - void fatalv(String format, Object param1); - - /** - * Issue a log message with a level of FATAL using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - */ - void fatalv(String format, Object param1, Object param2); - - /** - * Issue a log message with a level of FATAL using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - void fatalv(String format, Object param1, Object param2, Object param3); - - /** - * Issue a log message with a level of FATAL using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param params the parameters - */ - void fatalv(Throwable t, String format, Object... params); - - /** - * Issue a log message with a level of FATAL using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param param1 the sole parameter - */ - void fatalv(Throwable t, String format, Object param1); - - /** - * Issue a log message with a level of FATAL using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - */ - void fatalv(Throwable t, String format, Object param1, Object param2); - - /** - * Issue a log message with a level of FATAL using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - void fatalv(Throwable t, String format, Object param1, Object param2, Object param3); - - /** - * Issue a formatted log message with a level of FATAL. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param params the parameters - */ - void fatalf(String format, Object... params); - - /** - * Issue a formatted log message with a level of FATAL. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the sole parameter - */ - void fatalf(String format, Object param1); - - /** - * Issue a formatted log message with a level of FATAL. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the first parameter - * @param param2 the second parameter - */ - void fatalf(String format, Object param1, Object param2); - - /** - * Issue a formatted log message with a level of FATAL. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - void fatalf(String format, Object param1, Object param2, Object param3); - - /** - * Issue a formatted log message with a level of FATAL. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param params the parameters - */ - void fatalf(Throwable t, String format, Object... params); - - /** - * Issue a formatted log message with a level of FATAL. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param param1 the sole parameter - */ - void fatalf(Throwable t, String format, Object param1); - - /** - * Issue a formatted log message with a level of FATAL. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param param1 the first parameter - * @param param2 the second parameter - */ - void fatalf(Throwable t, String format, Object param1, Object param2); - - /** - * Issue a formatted log message with a level of FATAL. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - void fatalf(Throwable t, String format, Object param1, Object param2, Object param3); - - /** - * Log a message at the given level. - * - * @param level the level - * @param message the message - */ - void log(Logger.Level level, Object message); - - /** - * Issue a log message and throwable at the given log level. - * - * @param level the level - * @param message the message - * @param t the throwable - */ - void log(Logger.Level level, Object message, Throwable t); - - /** - * Issue a log message and throwable at the given log level and a specific logger class name. - * - * @param level the level - * @param loggerFqcn the logger class name - * @param message the message - * @param t the throwable - */ - void log(Logger.Level level, String loggerFqcn, Object message, Throwable t); - - /** - * Issue a log message with parameters and a throwable at the given log level. - * - * @param loggerFqcn the logger class name - * @param level the level - * @param message the message - * @param params the message parameters - * @param t the throwable - */ - void log(String loggerFqcn, Logger.Level level, Object message, Object[] params, Throwable t); - - /** - * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. - * - * @param level the level - * @param format the message format string - * @param params the parameters - */ - void logv(Logger.Level level, String format, Object... params); - - /** - * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. - * - * @param level the level - * @param format the message format string - * @param param1 the sole parameter - */ - void logv(Logger.Level level, String format, Object param1); - - /** - * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. - * - * @param level the level - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - */ - void logv(Logger.Level level, String format, Object param1, Object param2); - - /** - * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. - * - * @param level the level - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - void logv(Logger.Level level, String format, Object param1, Object param2, Object param3); - - /** - * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. - * - * @param level the level - * @param t the throwable - * @param format the message format string - * @param params the parameters - */ - void logv(Logger.Level level, Throwable t, String format, Object... params); - - /** - * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. - * - * @param level the level - * @param t the throwable - * @param format the message format string - * @param param1 the sole parameter - */ - void logv(Logger.Level level, Throwable t, String format, Object param1); - - /** - * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. - * - * @param level the level - * @param t the throwable - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - */ - void logv(Logger.Level level, Throwable t, String format, Object param1, Object param2); - - /** - * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. - * - * @param level the level - * @param t the throwable - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - void logv(Logger.Level level, Throwable t, String format, Object param1, Object param2, Object param3); - - /** - * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. - * - * @param loggerFqcn the logger class name - * @param level the level - * @param t the throwable - * @param format the message format string - * @param params the parameters - */ - void logv(String loggerFqcn, Logger.Level level, Throwable t, String format, Object... params); - - /** - * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. - * - * @param loggerFqcn the logger class name - * @param level the level - * @param t the throwable - * @param format the message format string - * @param param1 the sole parameter - */ - void logv(String loggerFqcn, Logger.Level level, Throwable t, String format, Object param1); - - /** - * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. - * - * @param loggerFqcn the logger class name - * @param level the level - * @param t the throwable - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - */ - void logv(String loggerFqcn, Logger.Level level, Throwable t, String format, Object param1, Object param2); - - /** - * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. - * - * @param loggerFqcn the logger class name - * @param level the level - * @param t the throwable - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - void logv(String loggerFqcn, Logger.Level level, Throwable t, String format, Object param1, Object param2, Object param3); - - /** - * Issue a formatted log message at the given log level. - * - * @param level the level - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param params the parameters - */ - void logf(Logger.Level level, String format, Object... params); - - /** - * Issue a formatted log message at the given log level. - * - * @param level the level - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the sole parameter - */ - void logf(Logger.Level level, String format, Object param1); - - /** - * Issue a formatted log message at the given log level. - * - * @param level the level - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the first parameter - * @param param2 the second parameter - */ - void logf(Logger.Level level, String format, Object param1, Object param2); - - /** - * Issue a formatted log message at the given log level. - * - * @param level the level - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - void logf(Logger.Level level, String format, Object param1, Object param2, Object param3); - - /** - * Issue a formatted log message at the given log level. - * - * @param level the level - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param params the parameters - */ - void logf(Logger.Level level, Throwable t, String format, Object... params); - - /** - * Issue a formatted log message at the given log level. - * - * @param level the level - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param param1 the sole parameter - */ - void logf(Logger.Level level, Throwable t, String format, Object param1); - - /** - * Issue a formatted log message at the given log level. - * - * @param level the level - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param param1 the first parameter - * @param param2 the second parameter - */ - void logf(Logger.Level level, Throwable t, String format, Object param1, Object param2); - - /** - * Issue a formatted log message at the given log level. - * - * @param level the level - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - void logf(Logger.Level level, Throwable t, String format, Object param1, Object param2, Object param3); - - /** - * Log a message at the given level. - * - * @param loggerFqcn the logger class name - * @param level the level - * @param t the throwable cause - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the sole parameter - */ - void logf(String loggerFqcn, Logger.Level level, Throwable t, String format, Object param1); - - /** - * Log a message at the given level. - * - * @param loggerFqcn the logger class name - * @param level the level - * @param t the throwable cause - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the first parameter - * @param param2 the second parameter - */ - void logf(String loggerFqcn, Logger.Level level, Throwable t, String format, Object param1, Object param2); - - /** - * Log a message at the given level. - * - * @param loggerFqcn the logger class name - * @param level the level - * @param t the throwable cause - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - void logf(String loggerFqcn, Logger.Level level, Throwable t, String format, Object param1, Object param2, Object param3); - - /** - * Log a message at the given level. - * - * @param loggerFqcn the logger class name - * @param level the level - * @param t the throwable cause - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param params the message parameters - */ - void logf(String loggerFqcn, Logger.Level level, Throwable t, String format, Object... params); -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/Cause.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/Cause.java deleted file mode 100644 index a00904651..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/Cause.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2010 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed 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 com.fr.third.org.jboss.logging; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.CLASS; - -/** - * Mark a parameter as being the "exception cause" parameter rather than a positional format parameter. - * - * @deprecated Use com.fr.third.org.jboss.logging.annotations.Cause provided in module org.jboss.logging:jboss-logging-annotations - * - * @author David M. Lloyd - */ -@Retention(CLASS) -@Target(PARAMETER) -@Documented -@Deprecated -public @interface Cause { -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/DelegatingBasicLogger.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/DelegatingBasicLogger.java deleted file mode 100644 index 801bf467e..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/DelegatingBasicLogger.java +++ /dev/null @@ -1,1052 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2011 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed 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 com.fr.third.org.jboss.logging; - -import java.io.Serializable; - -/** - * A serializable, delegating basic logger instance. - * - * @author David M. Lloyd - */ -public class DelegatingBasicLogger implements BasicLogger, Serializable { - - private static final long serialVersionUID = -5774903162389601853L; - - /** - * The cached logger class name. - */ - private static final String FQCN = DelegatingBasicLogger.class.getName(); - - /** - * The delegate logger. - */ - protected final Logger log; - - /** - * Construct a new instance. - * - * @param log the logger to which calls should be delegated - */ - public DelegatingBasicLogger(final Logger log) { - this.log = log; - } - - @Override - public boolean isTraceEnabled() { - return log.isTraceEnabled(); - } - - @Override - public void trace(final Object message) { - log.trace(FQCN, message, null); - } - - @Override - public void trace(final Object message, final Throwable t) { - log.trace(FQCN, message, t); - } - - @Override - public void trace(final String loggerFqcn, final Object message, final Throwable t) { - log.trace(loggerFqcn, message, t); - } - - @Override - public void trace(final String loggerFqcn, final Object message, final Object[] params, final Throwable t) { - log.trace(loggerFqcn, message, params, t); - } - - @Override - public void tracev(final String format, final Object... params) { - log.logv(FQCN, Logger.Level.TRACE, null, format, params); - } - - @Override - public void tracev(final String format, final Object param1) { - log.logv(FQCN, Logger.Level.TRACE, null, format, param1); - } - - @Override - public void tracev(final String format, final Object param1, final Object param2) { - log.logv(FQCN, Logger.Level.TRACE, null, format, param1, param2); - } - - @Override - public void tracev(final String format, final Object param1, final Object param2, final Object param3) { - log.logv(FQCN, Logger.Level.TRACE, null, format, param1, param2, param3); - } - - @Override - public void tracev(final Throwable t, final String format, final Object... params) { - log.logv(FQCN, Logger.Level.TRACE, t, format, params); - } - - @Override - public void tracev(final Throwable t, final String format, final Object param1) { - log.logv(FQCN, Logger.Level.TRACE, t, format, param1); - } - - @Override - public void tracev(final Throwable t, final String format, final Object param1, final Object param2) { - log.logv(FQCN, Logger.Level.TRACE, t, format, param1, param2); - } - - @Override - public void tracev(final Throwable t, final String format, final Object param1, final Object param2, final Object param3) { - log.logv(FQCN, Logger.Level.TRACE, t, format, param1, param2, param3); - } - - @Override - public void tracef(final String format, final Object... params) { - log.logf(FQCN, Logger.Level.TRACE, null, format, params); - } - - @Override - public void tracef(final String format, final Object param1) { - log.logf(FQCN, Logger.Level.TRACE, null, format, param1); - } - - @Override - public void tracef(final String format, final Object param1, final Object param2) { - log.logf(FQCN, Logger.Level.TRACE, null, format, param1, param2); - } - - @Override - public void tracef(final String format, final Object param1, final Object param2, final Object param3) { - log.logf(FQCN, Logger.Level.TRACE, null, format, param1, param2, param3); - } - - @Override - public void tracef(final Throwable t, final String format, final Object... params) { - log.logf(FQCN, Logger.Level.TRACE, t, format, params); - } - - @Override - public void tracef(final Throwable t, final String format, final Object param1) { - log.logf(FQCN, Logger.Level.TRACE, t, format, param1); - } - - @Override - public void tracef(final Throwable t, final String format, final Object param1, final Object param2) { - log.logf(FQCN, Logger.Level.TRACE, t, format, param1, param2); - } - - @Override - public void tracef(final Throwable t, final String format, final Object param1, final Object param2, final Object param3) { - log.logf(FQCN, Logger.Level.TRACE, t, format, param1, param2, param3); - } - - @Override - public void tracef(final String format, final int arg) { - log.tracef(format, arg); - } - - @Override - public void tracef(final String format, final int arg1, final int arg2) { - log.tracef(format, arg1, arg2); - } - - @Override - public void tracef(final String format, final int arg1, final Object arg2) { - log.tracef(format, arg1, arg2); - } - - @Override - public void tracef(final String format, final int arg1, final int arg2, final int arg3) { - log.tracef(format, arg1, arg2, arg3); - } - - @Override - public void tracef(final String format, final int arg1, final int arg2, final Object arg3) { - log.tracef(format, arg1, arg2, arg3); - } - - @Override - public void tracef(final String format, final int arg1, final Object arg2, final Object arg3) { - log.tracef(format, arg1, arg2, arg3); - } - - @Override - public void tracef(final Throwable t, final String format, final int arg) { - log.tracef(t, format, arg); - } - - @Override - public void tracef(final Throwable t, final String format, final int arg1, final int arg2) { - log.tracef(t, format, arg1, arg2); - } - - @Override - public void tracef(final Throwable t, final String format, final int arg1, final Object arg2) { - log.tracef(t, format, arg1, arg2); - } - - @Override - public void tracef(final Throwable t, final String format, final int arg1, final int arg2, final int arg3) { - log.tracef(t, format, arg1, arg2, arg3); - } - - @Override - public void tracef(final Throwable t, final String format, final int arg1, final int arg2, final Object arg3) { - log.tracef(t, format, arg1, arg2, arg3); - } - - @Override - public void tracef(final Throwable t, final String format, final int arg1, final Object arg2, final Object arg3) { - log.tracef(t, format, arg1, arg2, arg3); - } - - @Override - public void tracef(final String format, final long arg) { - log.tracef(format, arg); - } - - @Override - public void tracef(final String format, final long arg1, final long arg2) { - log.tracef(format, arg1, arg2); - } - - @Override - public void tracef(final String format, final long arg1, final Object arg2) { - log.tracef(format, arg1, arg2); - } - - @Override - public void tracef(final String format, final long arg1, final long arg2, final long arg3) { - log.tracef(format, arg1, arg2, arg3); - } - - @Override - public void tracef(final String format, final long arg1, final long arg2, final Object arg3) { - log.tracef(format, arg1, arg2, arg3); - } - - @Override - public void tracef(final String format, final long arg1, final Object arg2, final Object arg3) { - log.tracef(format, arg1, arg2, arg3); - } - - @Override - public void tracef(final Throwable t, final String format, final long arg) { - log.tracef(t, format, arg); - } - - @Override - public void tracef(final Throwable t, final String format, final long arg1, final long arg2) { - log.tracef(t, format, arg1, arg2); - } - - @Override - public void tracef(final Throwable t, final String format, final long arg1, final Object arg2) { - log.tracef(t, format, arg1, arg2); - } - - @Override - public void tracef(final Throwable t, final String format, final long arg1, final long arg2, final long arg3) { - log.tracef(t, format, arg1, arg2, arg3); - } - - @Override - public void tracef(final Throwable t, final String format, final long arg1, final long arg2, final Object arg3) { - log.tracef(t, format, arg1, arg2, arg3); - } - - @Override - public void tracef(final Throwable t, final String format, final long arg1, final Object arg2, final Object arg3) { - log.tracef(t, format, arg1, arg2, arg3); - } - - @Override - public boolean isDebugEnabled() { - return log.isDebugEnabled(); - } - - @Override - public void debug(final Object message) { - log.debug(FQCN, message, null); - } - - @Override - public void debug(final Object message, final Throwable t) { - log.debug(FQCN, message, t); - } - - @Override - public void debug(final String loggerFqcn, final Object message, final Throwable t) { - log.debug(loggerFqcn, message, t); - } - - @Override - public void debug(final String loggerFqcn, final Object message, final Object[] params, final Throwable t) { - log.debug(loggerFqcn, message, params, t); - } - - @Override - public void debugv(final String format, final Object... params) { - log.logv(FQCN, Logger.Level.DEBUG, null, format, params); - } - - @Override - public void debugv(final String format, final Object param1) { - log.logv(FQCN, Logger.Level.DEBUG, null, format, param1); - } - - @Override - public void debugv(final String format, final Object param1, final Object param2) { - log.logv(FQCN, Logger.Level.DEBUG, null, format, param1, param2); - } - - @Override - public void debugv(final String format, final Object param1, final Object param2, final Object param3) { - log.logv(FQCN, Logger.Level.DEBUG, null, format, param1, param2, param3); - } - - @Override - public void debugv(final Throwable t, final String format, final Object... params) { - log.logv(FQCN, Logger.Level.DEBUG, t, format, params); - } - - @Override - public void debugv(final Throwable t, final String format, final Object param1) { - log.logv(FQCN, Logger.Level.DEBUG, t, format, param1); - } - - @Override - public void debugv(final Throwable t, final String format, final Object param1, final Object param2) { - log.logv(FQCN, Logger.Level.DEBUG, t, format, param1, param2); - } - - @Override - public void debugv(final Throwable t, final String format, final Object param1, final Object param2, final Object param3) { - log.logv(FQCN, Logger.Level.DEBUG, t, format, param1, param2, param3); - } - - @Override - public void debugf(final String format, final Object... params) { - log.logf(FQCN, Logger.Level.DEBUG, null, format, params); - } - - @Override - public void debugf(final String format, final Object param1) { - log.logf(FQCN, Logger.Level.DEBUG, null, format, param1); - } - - @Override - public void debugf(final String format, final Object param1, final Object param2) { - log.logf(FQCN, Logger.Level.DEBUG, null, format, param1, param2); - } - - @Override - public void debugf(final String format, final Object param1, final Object param2, final Object param3) { - log.logf(FQCN, Logger.Level.DEBUG, null, format, param1, param2, param3); - } - - @Override - public void debugf(final Throwable t, final String format, final Object... params) { - log.logf(FQCN, Logger.Level.DEBUG, t, format, params); - } - - @Override - public void debugf(final Throwable t, final String format, final Object param1) { - log.logf(FQCN, Logger.Level.DEBUG, t, format, param1); - } - - @Override - public void debugf(final Throwable t, final String format, final Object param1, final Object param2) { - log.logf(FQCN, Logger.Level.DEBUG, t, format, param1, param2); - } - - @Override - public void debugf(final Throwable t, final String format, final Object param1, final Object param2, final Object param3) { - log.logf(FQCN, Logger.Level.DEBUG, t, format, param1, param2, param3); - } - - @Override - public void debugf(final String format, final int arg) { - log.debugf(format, arg); - } - - @Override - public void debugf(final String format, final int arg1, final int arg2) { - log.debugf(format, arg1, arg2); - } - - @Override - public void debugf(final String format, final int arg1, final Object arg2) { - log.debugf(format, arg1, arg2); - } - - @Override - public void debugf(final String format, final int arg1, final int arg2, final int arg3) { - log.debugf(format, arg1, arg2, arg3); - } - - @Override - public void debugf(final String format, final int arg1, final int arg2, final Object arg3) { - log.debugf(format, arg1, arg2, arg3); - } - - @Override - public void debugf(final String format, final int arg1, final Object arg2, final Object arg3) { - log.debugf(format, arg1, arg2, arg3); - } - - @Override - public void debugf(final Throwable t, final String format, final int arg) { - log.debugf(t, format, arg); - } - - @Override - public void debugf(final Throwable t, final String format, final int arg1, final int arg2) { - log.debugf(t, format, arg1, arg2); - } - - @Override - public void debugf(final Throwable t, final String format, final int arg1, final Object arg2) { - log.debugf(t, format, arg1, arg2); - } - - @Override - public void debugf(final Throwable t, final String format, final int arg1, final int arg2, final int arg3) { - log.debugf(t, format, arg1, arg2, arg3); - } - - @Override - public void debugf(final Throwable t, final String format, final int arg1, final int arg2, final Object arg3) { - log.debugf(t, format, arg1, arg2, arg3); - } - - @Override - public void debugf(final Throwable t, final String format, final int arg1, final Object arg2, final Object arg3) { - log.debugf(t, format, arg1, arg2, arg3); - } - - @Override - public void debugf(final String format, final long arg) { - log.debugf(format, arg); - } - - @Override - public void debugf(final String format, final long arg1, final long arg2) { - log.debugf(format, arg1, arg2); - } - - @Override - public void debugf(final String format, final long arg1, final Object arg2) { - log.debugf(format, arg1, arg2); - } - - @Override - public void debugf(final String format, final long arg1, final long arg2, final long arg3) { - log.debugf(format, arg1, arg2, arg3); - } - - @Override - public void debugf(final String format, final long arg1, final long arg2, final Object arg3) { - log.debugf(format, arg1, arg2, arg3); - } - - @Override - public void debugf(final String format, final long arg1, final Object arg2, final Object arg3) { - log.debugf(format, arg1, arg2, arg3); - } - - @Override - public void debugf(final Throwable t, final String format, final long arg) { - log.debugf(t, format, arg); - } - - @Override - public void debugf(final Throwable t, final String format, final long arg1, final long arg2) { - log.debugf(t, format, arg1, arg2); - } - - @Override - public void debugf(final Throwable t, final String format, final long arg1, final Object arg2) { - log.debugf(t, format, arg1, arg2); - } - - @Override - public void debugf(final Throwable t, final String format, final long arg1, final long arg2, final long arg3) { - log.debugf(t, format, arg1, arg2, arg3); - } - - @Override - public void debugf(final Throwable t, final String format, final long arg1, final long arg2, final Object arg3) { - log.debugf(t, format, arg1, arg2, arg3); - } - - @Override - public void debugf(final Throwable t, final String format, final long arg1, final Object arg2, final Object arg3) { - log.debugf(t, format, arg1, arg2, arg3); - } - - @Override - public boolean isInfoEnabled() { - return log.isInfoEnabled(); - } - - @Override - public void info(final Object message) { - log.info(FQCN, message, null); - } - - @Override - public void info(final Object message, final Throwable t) { - log.info(FQCN, message, t); - } - - @Override - public void info(final String loggerFqcn, final Object message, final Throwable t) { - log.info(loggerFqcn, message, t); - } - - @Override - public void info(final String loggerFqcn, final Object message, final Object[] params, final Throwable t) { - log.info(loggerFqcn, message, params, t); - } - - @Override - public void infov(final String format, final Object... params) { - log.logv(FQCN, Logger.Level.INFO, null, format, params); - } - - @Override - public void infov(final String format, final Object param1) { - log.logv(FQCN, Logger.Level.INFO, null, format, param1); - } - - @Override - public void infov(final String format, final Object param1, final Object param2) { - log.logv(FQCN, Logger.Level.INFO, null, format, param1, param2); - } - - @Override - public void infov(final String format, final Object param1, final Object param2, final Object param3) { - log.logv(FQCN, Logger.Level.INFO, null, format, param1, param2, param3); - } - - @Override - public void infov(final Throwable t, final String format, final Object... params) { - log.logv(FQCN, Logger.Level.INFO, t, format, params); - } - - @Override - public void infov(final Throwable t, final String format, final Object param1) { - log.logv(FQCN, Logger.Level.INFO, t, format, param1); - } - - @Override - public void infov(final Throwable t, final String format, final Object param1, final Object param2) { - log.logv(FQCN, Logger.Level.INFO, t, format, param1, param2); - } - - @Override - public void infov(final Throwable t, final String format, final Object param1, final Object param2, final Object param3) { - log.logv(FQCN, Logger.Level.INFO, t, format, param1, param2, param3); - } - - @Override - public void infof(final String format, final Object... params) { - log.logf(FQCN, Logger.Level.INFO, null, format, params); - } - - @Override - public void infof(final String format, final Object param1) { - log.logf(FQCN, Logger.Level.INFO, null, format, param1); - } - - @Override - public void infof(final String format, final Object param1, final Object param2) { - log.logf(FQCN, Logger.Level.INFO, null, format, param1, param2); - } - - @Override - public void infof(final String format, final Object param1, final Object param2, final Object param3) { - log.logf(FQCN, Logger.Level.INFO, null, format, param1, param2, param3); - } - - @Override - public void infof(final Throwable t, final String format, final Object... params) { - log.logf(FQCN, Logger.Level.INFO, t, format, params); - } - - @Override - public void infof(final Throwable t, final String format, final Object param1) { - log.logf(FQCN, Logger.Level.INFO, t, format, param1); - } - - @Override - public void infof(final Throwable t, final String format, final Object param1, final Object param2) { - log.logf(FQCN, Logger.Level.INFO, t, format, param1, param2); - } - - @Override - public void infof(final Throwable t, final String format, final Object param1, final Object param2, final Object param3) { - log.logf(FQCN, Logger.Level.INFO, t, format, param1, param2, param3); - } - - @Override - public void warn(final Object message) { - log.warn(FQCN, message, null); - } - - @Override - public void warn(final Object message, final Throwable t) { - log.warn(FQCN, message, t); - } - - @Override - public void warn(final String loggerFqcn, final Object message, final Throwable t) { - log.warn(loggerFqcn, message, t); - } - - @Override - public void warn(final String loggerFqcn, final Object message, final Object[] params, final Throwable t) { - log.warn(loggerFqcn, message, params, t); - } - - @Override - public void warnv(final String format, final Object... params) { - log.logv(FQCN, Logger.Level.WARN, null, format, params); - } - - @Override - public void warnv(final String format, final Object param1) { - log.logv(FQCN, Logger.Level.WARN, null, format, param1); - } - - @Override - public void warnv(final String format, final Object param1, final Object param2) { - log.logv(FQCN, Logger.Level.WARN, null, format, param1, param2); - } - - @Override - public void warnv(final String format, final Object param1, final Object param2, final Object param3) { - log.logv(FQCN, Logger.Level.WARN, null, format, param1, param2, param3); - } - - @Override - public void warnv(final Throwable t, final String format, final Object... params) { - log.logv(FQCN, Logger.Level.WARN, t, format, params); - } - - @Override - public void warnv(final Throwable t, final String format, final Object param1) { - log.logv(FQCN, Logger.Level.WARN, t, format, param1); - } - - @Override - public void warnv(final Throwable t, final String format, final Object param1, final Object param2) { - log.logv(FQCN, Logger.Level.WARN, t, format, param1, param2); - } - - @Override - public void warnv(final Throwable t, final String format, final Object param1, final Object param2, final Object param3) { - log.logv(FQCN, Logger.Level.WARN, t, format, param1, param2, param3); - } - - @Override - public void warnf(final String format, final Object... params) { - log.logf(FQCN, Logger.Level.WARN, null, format, params); - } - - @Override - public void warnf(final String format, final Object param1) { - log.logf(FQCN, Logger.Level.WARN, null, format, param1); - } - - @Override - public void warnf(final String format, final Object param1, final Object param2) { - log.logf(FQCN, Logger.Level.WARN, null, format, param1, param2); - } - - @Override - public void warnf(final String format, final Object param1, final Object param2, final Object param3) { - log.logf(FQCN, Logger.Level.WARN, null, format, param1, param2, param3); - } - - @Override - public void warnf(final Throwable t, final String format, final Object... params) { - log.logf(FQCN, Logger.Level.WARN, t, format, params); - } - - @Override - public void warnf(final Throwable t, final String format, final Object param1) { - log.logf(FQCN, Logger.Level.WARN, t, format, param1); - } - - @Override - public void warnf(final Throwable t, final String format, final Object param1, final Object param2) { - log.logf(FQCN, Logger.Level.WARN, t, format, param1, param2); - } - - @Override - public void warnf(final Throwable t, final String format, final Object param1, final Object param2, final Object param3) { - log.logf(FQCN, Logger.Level.WARN, t, format, param1, param2, param3); - } - - @Override - public void error(final Object message) { - log.error(FQCN, message, null); - } - - @Override - public void error(final Object message, final Throwable t) { - log.error(FQCN, message, t); - } - - @Override - public void error(final String loggerFqcn, final Object message, final Throwable t) { - log.error(loggerFqcn, message, t); - } - - @Override - public void error(final String loggerFqcn, final Object message, final Object[] params, final Throwable t) { - log.error(loggerFqcn, message, params, t); - } - - @Override - public void errorv(final String format, final Object... params) { - log.logv(FQCN, Logger.Level.ERROR, null, format, params); - } - - @Override - public void errorv(final String format, final Object param1) { - log.logv(FQCN, Logger.Level.ERROR, null, format, param1); - } - - @Override - public void errorv(final String format, final Object param1, final Object param2) { - log.logv(FQCN, Logger.Level.ERROR, null, format, param1, param2); - } - - @Override - public void errorv(final String format, final Object param1, final Object param2, final Object param3) { - log.logv(FQCN, Logger.Level.ERROR, null, format, param1, param2, param3); - } - - @Override - public void errorv(final Throwable t, final String format, final Object... params) { - log.logv(FQCN, Logger.Level.ERROR, t, format, params); - } - - @Override - public void errorv(final Throwable t, final String format, final Object param1) { - log.logv(FQCN, Logger.Level.ERROR, t, format, param1); - } - - @Override - public void errorv(final Throwable t, final String format, final Object param1, final Object param2) { - log.logv(FQCN, Logger.Level.ERROR, t, format, param1, param2); - } - - @Override - public void errorv(final Throwable t, final String format, final Object param1, final Object param2, final Object param3) { - log.logv(FQCN, Logger.Level.ERROR, t, format, param1, param2, param3); - } - - @Override - public void errorf(final String format, final Object... params) { - log.logf(FQCN, Logger.Level.ERROR, null, format, params); - } - - @Override - public void errorf(final String format, final Object param1) { - log.logf(FQCN, Logger.Level.ERROR, null, format, param1); - } - - @Override - public void errorf(final String format, final Object param1, final Object param2) { - log.logf(FQCN, Logger.Level.ERROR, null, format, param1, param2); - } - - @Override - public void errorf(final String format, final Object param1, final Object param2, final Object param3) { - log.logf(FQCN, Logger.Level.ERROR, null, format, param1, param2, param3); - } - - @Override - public void errorf(final Throwable t, final String format, final Object... params) { - log.logf(FQCN, Logger.Level.ERROR, t, format, params); - } - - @Override - public void errorf(final Throwable t, final String format, final Object param1) { - log.logf(FQCN, Logger.Level.ERROR, t, format, param1); - } - - @Override - public void errorf(final Throwable t, final String format, final Object param1, final Object param2) { - log.logf(FQCN, Logger.Level.ERROR, t, format, param1, param2); - } - - @Override - public void errorf(final Throwable t, final String format, final Object param1, final Object param2, final Object param3) { - log.logf(FQCN, Logger.Level.ERROR, t, format, param1, param2, param3); - } - - @Override - public void fatal(final Object message) { - log.fatal(FQCN, message, null); - } - - @Override - public void fatal(final Object message, final Throwable t) { - log.fatal(FQCN, message, t); - } - - @Override - public void fatal(final String loggerFqcn, final Object message, final Throwable t) { - log.fatal(loggerFqcn, message, t); - } - - @Override - public void fatal(final String loggerFqcn, final Object message, final Object[] params, final Throwable t) { - log.fatal(loggerFqcn, message, params, t); - } - - @Override - public void fatalv(final String format, final Object... params) { - log.logv(FQCN, Logger.Level.FATAL, null, format, params); - } - - @Override - public void fatalv(final String format, final Object param1) { - log.logv(FQCN, Logger.Level.FATAL, null, format, param1); - } - - @Override - public void fatalv(final String format, final Object param1, final Object param2) { - log.logv(FQCN, Logger.Level.FATAL, null, format, param1, param2); - } - - @Override - public void fatalv(final String format, final Object param1, final Object param2, final Object param3) { - log.logv(FQCN, Logger.Level.FATAL, null, format, param1, param2, param3); - } - - @Override - public void fatalv(final Throwable t, final String format, final Object... params) { - log.logv(FQCN, Logger.Level.FATAL, t, format, params); - } - - @Override - public void fatalv(final Throwable t, final String format, final Object param1) { - log.logv(FQCN, Logger.Level.FATAL, t, format, param1); - } - - @Override - public void fatalv(final Throwable t, final String format, final Object param1, final Object param2) { - log.logv(FQCN, Logger.Level.FATAL, t, format, param1, param2); - } - - @Override - public void fatalv(final Throwable t, final String format, final Object param1, final Object param2, final Object param3) { - log.logv(FQCN, Logger.Level.FATAL, t, format, param1, param2, param3); - } - - @Override - public void fatalf(final String format, final Object... params) { - log.logf(FQCN, Logger.Level.FATAL, null, format, params); - } - - @Override - public void fatalf(final String format, final Object param1) { - log.logf(FQCN, Logger.Level.FATAL, null, format, param1); - } - - @Override - public void fatalf(final String format, final Object param1, final Object param2) { - log.logf(FQCN, Logger.Level.FATAL, null, format, param1, param2); - } - - @Override - public void fatalf(final String format, final Object param1, final Object param2, final Object param3) { - log.logf(FQCN, Logger.Level.FATAL, null, format, param1, param2, param3); - } - - @Override - public void fatalf(final Throwable t, final String format, final Object... params) { - log.logf(FQCN, Logger.Level.FATAL, t, format, params); - } - - @Override - public void fatalf(final Throwable t, final String format, final Object param1) { - log.logf(FQCN, Logger.Level.FATAL, t, format, param1); - } - - @Override - public void fatalf(final Throwable t, final String format, final Object param1, final Object param2) { - log.logf(FQCN, Logger.Level.FATAL, t, format, param1, param2); - } - - @Override - public void fatalf(final Throwable t, final String format, final Object param1, final Object param2, final Object param3) { - log.logf(FQCN, Logger.Level.FATAL, t, format, param1, param2, param3); - } - - - @Override - public void log(final Logger.Level level, final Object message) { - log.log(FQCN, level, message, null, null); - } - - @Override - public void log(final Logger.Level level, final Object message, final Throwable t) { - log.log(FQCN, level, message, null, t); - } - - @Override - public void log(final Logger.Level level, final String loggerFqcn, final Object message, final Throwable t) { - log.log(level, loggerFqcn, message, t); - } - - @Override - public void log(final String loggerFqcn, final Logger.Level level, final Object message, final Object[] params, final Throwable t) { - log.log(loggerFqcn, level, message, params, t); - } - - @Override - public void logv(final Logger.Level level, final String format, final Object... params) { - log.logv(FQCN, level, null, format, params); - } - - @Override - public void logv(final Logger.Level level, final String format, final Object param1) { - log.logv(FQCN, level, null, format, param1); - } - - @Override - public void logv(final Logger.Level level, final String format, final Object param1, final Object param2) { - log.logv(FQCN, level, null, format, param1, param2); - } - - @Override - public void logv(final Logger.Level level, final String format, final Object param1, final Object param2, final Object param3) { - log.logv(FQCN, level, null, format, param1, param2, param3); - } - - @Override - public void logv(final Logger.Level level, final Throwable t, final String format, final Object... params) { - log.logv(FQCN, level, t, format, params); - } - - @Override - public void logv(final Logger.Level level, final Throwable t, final String format, final Object param1) { - log.logv(FQCN, level, t, format, param1); - } - - @Override - public void logv(final Logger.Level level, final Throwable t, final String format, final Object param1, final Object param2) { - log.logv(FQCN, level, t, format, param1, param2); - } - - @Override - public void logv(final Logger.Level level, final Throwable t, final String format, final Object param1, final Object param2, final Object param3) { - log.logv(FQCN, level, t, format, param1, param2, param3); - } - - @Override - public void logv(final String loggerFqcn, final Logger.Level level, final Throwable t, final String format, final Object... params) { - log.logv(loggerFqcn, level, t, format, params); - } - - @Override - public void logv(final String loggerFqcn, final Logger.Level level, final Throwable t, final String format, final Object param1) { - log.logv(loggerFqcn, level, t, format, param1); - } - - @Override - public void logv(final String loggerFqcn, final Logger.Level level, final Throwable t, final String format, final Object param1, final Object param2) { - log.logv(loggerFqcn, level, t, format, param1, param2); - } - - @Override - public void logv(final String loggerFqcn, final Logger.Level level, final Throwable t, final String format, final Object param1, final Object param2, final Object param3) { - log.logv(loggerFqcn, level, t, format, param1, param2, param3); - } - - @Override - public void logf(final Logger.Level level, final String format, final Object... params) { - log.logf(FQCN, level, null, format, params); - } - - @Override - public void logf(final Logger.Level level, final String format, final Object param1) { - log.logf(FQCN, level, null, format, param1); - } - - @Override - public void logf(final Logger.Level level, final String format, final Object param1, final Object param2) { - log.logf(FQCN, level, null, format, param1, param2); - } - - @Override - public void logf(final Logger.Level level, final String format, final Object param1, final Object param2, final Object param3) { - log.logf(FQCN, level, null, format, param1, param2, param3); - } - - @Override - public void logf(final Logger.Level level, final Throwable t, final String format, final Object... params) { - log.logf(FQCN, level, t, format, params); - } - - @Override - public void logf(final Logger.Level level, final Throwable t, final String format, final Object param1) { - log.logf(FQCN, level, t, format, param1); - } - - @Override - public void logf(final Logger.Level level, final Throwable t, final String format, final Object param1, final Object param2) { - log.logf(FQCN, level, t, format, param1, param2); - } - - @Override - public void logf(final Logger.Level level, final Throwable t, final String format, final Object param1, final Object param2, final Object param3) { - log.logf(FQCN, level, t, format, param1, param2, param3); - } - - @Override - public void logf(final String loggerFqcn, final Logger.Level level, final Throwable t, final String format, final Object param1) { - log.logf(loggerFqcn, level, t, format, param1); - } - - @Override - public void logf(final String loggerFqcn, final Logger.Level level, final Throwable t, final String format, final Object param1, final Object param2) { - log.logf(loggerFqcn, level, t, format, param1, param2); - } - - @Override - public void logf(final String loggerFqcn, final Logger.Level level, final Throwable t, final String format, final Object param1, final Object param2, final Object param3) { - log.logf(loggerFqcn, level, t, format, param1, param2, param3); - } - - @Override - public void logf(final String loggerFqcn, final Logger.Level level, final Throwable t, final String format, final Object... params) { - log.logf(loggerFqcn, level, t, format, params); - } - - @Override - public boolean isEnabled(final Logger.Level level) { - return log.isEnabled(level); - } -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/Field.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/Field.java deleted file mode 100644 index 749eab720..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/Field.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2011 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed 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 com.fr.third.org.jboss.logging; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.CLASS; - -/** - * Indicate that a method parameter value should be applied to a field on the resultant exception object. - * - * @deprecated Use com.fr.third.org.jboss.logging.annotations.Field provided in module org.jboss.logging:jboss-logging-annotations - * - * @author David M. Lloyd - */ -@Retention(CLASS) -@Target(PARAMETER) -@Documented -@Deprecated -public @interface Field { - - /** - * The field name. If not specified, the parameter name is assumed to be the field name. - * - * @return the field name - */ - String name() default ""; -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/FormatWith.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/FormatWith.java deleted file mode 100644 index 696b4f74f..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/FormatWith.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2011 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed 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 com.fr.third.org.jboss.logging; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.CLASS; - -/** - * Indicate that the given parameter should be wrapped with a formatting object of the given class. The class - * must have a one-argument constructor which unambiguously accepts a value of this parameter's type. The resultant - * object will be passed in as a parameter to the underlying format type; thus its {@link Object#toString() toString()} - * method will be invoked (or, if the format style is {@link Message.Format#PRINTF PRINTF}, the - * object may implement {@link java.util.Formattable Formattable} to get extra functionality). - * - * @deprecated Use com.fr.third.org.jboss.logging.annotations.FormatWith provided in module org.jboss.logging:jboss-logging-annotations - * - * @author David M. Lloyd - */ -@Target(PARAMETER) -@Retention(CLASS) -@Documented -@Deprecated -public @interface FormatWith { - - /** - * The class of the formatting object to use. - * - * @return the class - */ - Class value(); -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/JBossLogManagerLogger.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/JBossLogManagerLogger.java deleted file mode 100644 index dcd3d2b67..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/JBossLogManagerLogger.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2010 Red Hat, Inc. - * - * Licensed 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 com.fr.third.org.jboss.logging; - -import org.jboss.logmanager.ExtLogRecord; - -final class JBossLogManagerLogger extends Logger { - - private static final long serialVersionUID = 7429618317727584742L; - - private final org.jboss.logmanager.Logger logger; - - JBossLogManagerLogger(final String name, final org.jboss.logmanager.Logger logger) { - super(name); - this.logger = logger; - } - - public boolean isEnabled(final Level level) { - return logger.isLoggable(translate(level)); - } - - protected void doLog(final Level level, final String loggerClassName, final Object message, final Object[] parameters, final Throwable thrown) { - java.util.logging.Level translatedLevel = translate(level); - if (logger.isLoggable(translatedLevel)) { - if (parameters == null) { - logger.log(loggerClassName, translatedLevel, String.valueOf(message), thrown); - } else { - logger.log(loggerClassName, translatedLevel, String.valueOf(message), ExtLogRecord.FormatStyle.MESSAGE_FORMAT, parameters, thrown); - } - } - } - - protected void doLogf(final Level level, final String loggerClassName, final String format, final Object[] parameters, final Throwable thrown) { - if (parameters == null) { - logger.log(loggerClassName, translate(level), format, thrown); - } else { - logger.log(loggerClassName, translate(level), format, ExtLogRecord.FormatStyle.PRINTF, parameters, thrown); - } - } - - private static java.util.logging.Level translate(final Level level) { - if (level != null) switch (level) { - case FATAL: return org.jboss.logmanager.Level.FATAL; - case ERROR: return org.jboss.logmanager.Level.ERROR; - case WARN: return org.jboss.logmanager.Level.WARN; - case INFO: return org.jboss.logmanager.Level.INFO; - case DEBUG: return org.jboss.logmanager.Level.DEBUG; - case TRACE: return org.jboss.logmanager.Level.TRACE; - } - return org.jboss.logmanager.Level.ALL; - } -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/JBossLogManagerProvider.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/JBossLogManagerProvider.java deleted file mode 100644 index 1d6eea2ce..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/JBossLogManagerProvider.java +++ /dev/null @@ -1,150 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2010 Red Hat, Inc. - * - * Licensed 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 com.fr.third.org.jboss.logging; - -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentMap; - -import org.jboss.logmanager.LogContext; -import org.jboss.logmanager.MDC; -import org.jboss.logmanager.NDC; - -import static org.jboss.logmanager.Logger.AttachmentKey; - -final class JBossLogManagerProvider implements LoggerProvider { - - private static final AttachmentKey KEY = new AttachmentKey(); - private static final AttachmentKey> LEGACY_KEY = new AttachmentKey>(); - - public Logger getLogger(final String name) { - final SecurityManager sm = System.getSecurityManager(); - if (sm != null) { - return AccessController.doPrivileged(new PrivilegedAction() { - public Logger run() { - try { - return doGetLogger(name) ; - } catch (NoSuchMethodError ignore) { - } - // fallback - return doLegacyGetLogger(name); - } - }); - } else { - try { - return doGetLogger(name) ; - } catch (NoSuchMethodError ignore) { - } - // fallback - return doLegacyGetLogger(name); - } - } - - private static Logger doLegacyGetLogger(final String name) { - final org.jboss.logmanager.Logger lmLogger = LogContext.getLogContext().getLogger(""); - ConcurrentMap loggers = lmLogger.getAttachment(LEGACY_KEY); - if (loggers == null) { - loggers = new ConcurrentHashMap(); - final ConcurrentMap appearing = lmLogger.attachIfAbsent(LEGACY_KEY, loggers); - if (appearing != null) { - loggers = appearing; - } - } - - Logger l = loggers.get(name); - if (l != null) { - return l; - } - - final org.jboss.logmanager.Logger logger = org.jboss.logmanager.Logger.getLogger(name); - l = new JBossLogManagerLogger(name, logger); - final Logger appearing = loggers.putIfAbsent(name, l); - if (appearing == null) { - return l; - } - return appearing; - } - - private static Logger doGetLogger(final String name) { - Logger l = LogContext.getLogContext().getAttachment(name, KEY); - if (l != null) { - return l; - } - final org.jboss.logmanager.Logger logger = org.jboss.logmanager.Logger.getLogger(name); - l = new JBossLogManagerLogger(name, logger); - Logger a = logger.attachIfAbsent(KEY, l); - if (a == null) { - return l; - } else { - return a; - } - } - - public void clearMdc() { - MDC.clear(); - } - - public Object putMdc(final String key, final Object value) { - return MDC.put(key, String.valueOf(value)); - } - - public Object getMdc(final String key) { - return MDC.get(key); - } - - public void removeMdc(final String key) { - MDC.remove(key); - } - - @SuppressWarnings({ "unchecked" }) - public Map getMdcMap() { - // we can re-define the erasure of this map because MDC does not make further use of the copy - return (Map)MDC.copy(); - } - - public void clearNdc() { - NDC.clear(); - } - - public String getNdc() { - return NDC.get(); - } - - public int getNdcDepth() { - return NDC.getDepth(); - } - - public String popNdc() { - return NDC.pop(); - } - - public String peekNdc() { - return NDC.get(); - } - - public void pushNdc(final String message) { - NDC.push(message); - } - - public void setNdcMaxDepth(final int maxDepth) { - NDC.trimTo(maxDepth); - } -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/JBossLogRecord.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/JBossLogRecord.java deleted file mode 100644 index 6c1a790fb..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/JBossLogRecord.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2010 Red Hat, Inc. - * - * Licensed 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 com.fr.third.org.jboss.logging; - -import java.util.logging.Level; -import java.util.logging.LogRecord; - -class JBossLogRecord extends LogRecord { - - private static final long serialVersionUID = 2492784413065296060L; - private static final String LOGGER_CLASS_NAME = Logger.class.getName(); - - private boolean resolved; - private final String loggerClassName; - - JBossLogRecord(final Level level, final String msg) { - super(level, msg); - loggerClassName = LOGGER_CLASS_NAME; - } - - JBossLogRecord(final Level level, final String msg, final String loggerClassName) { - super(level, msg); - this.loggerClassName = loggerClassName; - } - - public String getSourceClassName() { - if (! resolved) { - resolve(); - } - return super.getSourceClassName(); - } - - public void setSourceClassName(final String sourceClassName) { - resolved = true; - super.setSourceClassName(sourceClassName); - } - - public String getSourceMethodName() { - if (! resolved) { - resolve(); - } - return super.getSourceMethodName(); - } - - public void setSourceMethodName(final String sourceMethodName) { - resolved = true; - super.setSourceMethodName(sourceMethodName); - } - - private void resolve() { - resolved = true; - final StackTraceElement[] stack = new Throwable().getStackTrace(); - boolean found = false; - for (StackTraceElement element : stack) { - final String className = element.getClassName(); - if (found) { - if (! loggerClassName.equals(className)) { - setSourceClassName(className); - setSourceMethodName(element.getMethodName()); - return; - } - } else { - found = loggerClassName.equals(className); - } - } - setSourceClassName(""); - setSourceMethodName(""); - } - - protected Object writeReplace() { - final LogRecord replacement = new LogRecord(getLevel(), getMessage()); - replacement.setResourceBundle(getResourceBundle()); - replacement.setLoggerName(getLoggerName()); - replacement.setMillis(getMillis()); - replacement.setParameters(getParameters()); - replacement.setResourceBundleName(getResourceBundleName()); - replacement.setSequenceNumber(getSequenceNumber()); - replacement.setSourceClassName(getSourceClassName()); - replacement.setSourceMethodName(getSourceMethodName()); - replacement.setThreadID(getThreadID()); - replacement.setThrown(getThrown()); - return replacement; - } - -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/JDKLevel.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/JDKLevel.java deleted file mode 100644 index aae9e6383..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/JDKLevel.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2010 Red Hat, Inc. - * - * Licensed 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 com.fr.third.org.jboss.logging; - -import java.util.logging.Level; - -/** - * Levels used by the JDK logging back end. - */ -final class JDKLevel extends Level { - - private static final long serialVersionUID = 1L; - - protected JDKLevel(final String name, final int value) { - super(name, value); - } - - protected JDKLevel(final String name, final int value, final String resourceBundleName) { - super(name, value, resourceBundleName); - } - - public static final JDKLevel FATAL = new JDKLevel("FATAL", 1100); - public static final JDKLevel ERROR = new JDKLevel("ERROR", 1000); - public static final JDKLevel WARN = new JDKLevel("WARN", 900); - @SuppressWarnings("hiding") - public static final JDKLevel INFO = new JDKLevel("INFO", 800); - public static final JDKLevel DEBUG = new JDKLevel("DEBUG", 500); - public static final JDKLevel TRACE = new JDKLevel("TRACE", 400); -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/JDKLogger.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/JDKLogger.java deleted file mode 100644 index 316fe5e79..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/JDKLogger.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2010 Red Hat, Inc. - * - * Licensed 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 com.fr.third.org.jboss.logging; - -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -final class JDKLogger extends Logger { - - private static final long serialVersionUID = 2563174097983721393L; - - @SuppressWarnings({ "NonConstantLogger" }) - private transient final java.util.logging.Logger logger; - - public JDKLogger(final String name) { - super(name); - logger = java.util.logging.Logger.getLogger(name); - } - - protected void doLog(final Level level, final String loggerClassName, final Object message, final Object[] parameters, final Throwable thrown) { - if (isEnabled(level)) try { - final JBossLogRecord rec = new JBossLogRecord(translate(level), String.valueOf(message), loggerClassName); - if (thrown != null) rec.setThrown(thrown); - rec.setLoggerName(getName()); - rec.setParameters(parameters); - rec.setResourceBundleName(logger.getResourceBundleName()); - rec.setResourceBundle(logger.getResourceBundle()); - logger.log(rec); - } catch (Throwable ignored) {} - } - - protected void doLogf(final Level level, final String loggerClassName, String format, final Object[] parameters, final Throwable thrown) { - if (isEnabled(level)) try { - final ResourceBundle resourceBundle = logger.getResourceBundle(); - if (resourceBundle != null) try { - format = resourceBundle.getString(format); - } catch (MissingResourceException e) { - // ignore - } - final String msg = parameters == null ? String.format(format) : String.format(format, parameters); - final JBossLogRecord rec = new JBossLogRecord(translate(level), msg, loggerClassName); - if (thrown != null) rec.setThrown(thrown); - rec.setLoggerName(getName()); - rec.setResourceBundleName(logger.getResourceBundleName()); - // we've done all the business - rec.setResourceBundle(null); - rec.setParameters(null); - logger.log(rec); - } catch (Throwable ignored) {} - } - - private static java.util.logging.Level translate(final Level level) { - if (level != null) switch (level) { - case FATAL: return JDKLevel.FATAL; - case ERROR: return JDKLevel.ERROR; - case WARN: return JDKLevel.WARN; - case INFO: return JDKLevel.INFO; - case DEBUG: return JDKLevel.DEBUG; - case TRACE: return JDKLevel.TRACE; - } - return JDKLevel.ALL; - } - - public boolean isEnabled(final Level level) { - return logger.isLoggable(translate(level)); - } -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/JDKLoggerProvider.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/JDKLoggerProvider.java deleted file mode 100644 index b40fea84f..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/JDKLoggerProvider.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2010 Red Hat, Inc. - * - * Licensed 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 com.fr.third.org.jboss.logging; - -final class JDKLoggerProvider extends AbstractMdcLoggerProvider implements LoggerProvider { - - public Logger getLogger(final String name) { - return new JDKLogger(name); - } -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/Log4j2Logger.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/Log4j2Logger.java deleted file mode 100644 index ed8532b1e..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/Log4j2Logger.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2013 Red Hat, Inc. - * - * Licensed 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 com.fr.third.org.jboss.logging; - -import com.fr.third.apache.logging.log4j.LogManager; -import com.fr.third.apache.logging.log4j.LoggingException; -import com.fr.third.apache.logging.log4j.message.MessageFormatMessageFactory; -import com.fr.third.apache.logging.log4j.message.StringFormattedMessage; -import com.fr.third.apache.logging.log4j.spi.AbstractLogger; - -final class Log4j2Logger extends Logger { - - private static final long serialVersionUID = -2507841068232627725L; - - private final AbstractLogger logger; - private final MessageFormatMessageFactory messageFactory; - - Log4j2Logger(final String name) { - super(name); - com.fr.third.apache.logging.log4j.Logger logger = LogManager.getLogger(name); - if (!(logger instanceof AbstractLogger)) { - throw new LoggingException("The logger for [" + name + "] does not extend AbstractLogger. Actual logger: " + logger.getClass().getName()); - } - this.logger = (AbstractLogger)logger; - this.messageFactory = new MessageFormatMessageFactory(); - } - - @Override - public boolean isEnabled(final Level level) { - return this.logger.isEnabled(Log4j2Logger.translate(level)); - } - - @Override - protected void doLog(final Level level, final String loggerClassName, final Object message, final Object[] parameters, final Throwable thrown) { - final com.fr.third.apache.logging.log4j.Level translatedLevel = Log4j2Logger.translate(level); - if (this.logger.isEnabled(translatedLevel)) { - try { - this.logger.logMessage(loggerClassName, translatedLevel, null, - (parameters == null || parameters.length == 0) ? this.messageFactory.newMessage(message) : this.messageFactory.newMessage(String.valueOf(message), parameters), - thrown); - } catch (Throwable ignored) { } - } - } - - @Override - protected void doLogf(final Level level, final String loggerClassName, final String format, final Object[] parameters, final Throwable thrown) { - final com.fr.third.apache.logging.log4j.Level translatedLevel = Log4j2Logger.translate(level); - if (this.logger.isEnabled(translatedLevel)) { - try { - this.logger.logMessage(loggerClassName, translatedLevel, null, new StringFormattedMessage(format, parameters), thrown); - } catch (Throwable ignored) { } - } - } - - private static com.fr.third.apache.logging.log4j.Level translate(final Level level) { - if (level != null) { - switch (level) { - case FATAL: return com.fr.third.apache.logging.log4j.Level.FATAL; - case ERROR: return com.fr.third.apache.logging.log4j.Level.ERROR; - case WARN: return com.fr.third.apache.logging.log4j.Level.WARN; - case INFO: return com.fr.third.apache.logging.log4j.Level.INFO; - case DEBUG: return com.fr.third.apache.logging.log4j.Level.DEBUG; - case TRACE: return com.fr.third.apache.logging.log4j.Level.TRACE; - } - } - return com.fr.third.apache.logging.log4j.Level.ALL; - } -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/Log4j2LoggerProvider.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/Log4j2LoggerProvider.java deleted file mode 100644 index cec13b2ed..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/Log4j2LoggerProvider.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2013 Red Hat, Inc. - * - * Licensed 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 com.fr.third.org.jboss.logging; - -import java.util.HashMap; -import java.util.Map; - -import com.fr.third.apache.logging.log4j.ThreadContext; - -final class Log4j2LoggerProvider implements LoggerProvider { - - @Override - public Log4j2Logger getLogger(String name) { - return new Log4j2Logger(name); - } - - @Override - public void clearMdc() { - ThreadContext.clearMap(); - } - - @Override - public Object putMdc(String key, Object value) { - try { - return ThreadContext.get(key); - } finally { - ThreadContext.put(key, String.valueOf(value)); - } - } - - @Override - public Object getMdc(String key) { - return ThreadContext.get(key); - } - - @Override - public void removeMdc(String key) { - ThreadContext.remove(key); - } - - @Override - public Map getMdcMap() { - return new HashMap(ThreadContext.getImmutableContext()); - } - - @Override - public void clearNdc() { - ThreadContext.clearStack(); - } - - @Override - public String getNdc() { - return ThreadContext.peek(); - } - - @Override - public int getNdcDepth() { - return ThreadContext.getDepth(); - } - - @Override - public String popNdc() { - return ThreadContext.pop(); - } - - @Override - public String peekNdc() { - return ThreadContext.peek(); - } - - @Override - public void pushNdc(String message) { - ThreadContext.push(message); - } - - @Override - public void setNdcMaxDepth(int maxDepth) { - ThreadContext.trim(maxDepth); - } -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/Log4jLogger.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/Log4jLogger.java deleted file mode 100644 index 505eccbdb..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/Log4jLogger.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2010 Red Hat, Inc. - * - * Licensed 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 com.fr.third.org.jboss.logging; - -import java.text.MessageFormat; - -final class Log4jLogger extends Logger { - - private static final long serialVersionUID = -5446154366955151335L; - - private final org.apache.log4j.Logger logger; - - Log4jLogger(final String name) { - super(name); - logger = org.apache.log4j.Logger.getLogger(name); - } - - public boolean isEnabled(final Level level) { - final org.apache.log4j.Level l = translate(level); - return logger.isEnabledFor(l) && l.isGreaterOrEqual(logger.getEffectiveLevel()); - } - - protected void doLog(final Level level, final String loggerClassName, final Object message, final Object[] parameters, final Throwable thrown) { - final org.apache.log4j.Level translatedLevel = translate(level); - if (logger.isEnabledFor(translatedLevel)) try { - logger.log(loggerClassName, translatedLevel, parameters == null || parameters.length == 0 ? message : MessageFormat.format(String.valueOf(message), parameters), thrown); - } catch (Throwable ignored) {} - } - - protected void doLogf(final Level level, final String loggerClassName, final String format, final Object[] parameters, final Throwable thrown) { - final org.apache.log4j.Level translatedLevel = translate(level); - if (logger.isEnabledFor(translatedLevel)) try { - logger.log(loggerClassName, translatedLevel, parameters == null ? String.format(format) : String.format(format, parameters), thrown); - } catch (Throwable ignored) {} - } - - private static org.apache.log4j.Level translate(final Level level) { - if (level != null) switch (level) { - case FATAL: return org.apache.log4j.Level.FATAL; - case ERROR: return org.apache.log4j.Level.ERROR; - case WARN: return org.apache.log4j.Level.WARN; - case INFO: return org.apache.log4j.Level.INFO; - case DEBUG: return org.apache.log4j.Level.DEBUG; - case TRACE: return org.apache.log4j.Level.TRACE; - } - return org.apache.log4j.Level.ALL; - } -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/Log4jLoggerProvider.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/Log4jLoggerProvider.java deleted file mode 100644 index d002951f3..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/Log4jLoggerProvider.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2010 Red Hat, Inc. - * - * Licensed 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 com.fr.third.org.jboss.logging; - -import java.util.Collections; -import java.util.Map; - -import org.apache.log4j.MDC; -import org.apache.log4j.NDC; - -final class Log4jLoggerProvider implements LoggerProvider { - - public Logger getLogger(final String name) { - return new Log4jLogger("".equals(name) ? "ROOT" : name); - } - - public void clearMdc() { - MDC.clear(); - } - - public Object getMdc(String key) { - return MDC.get(key); - } - - public Map getMdcMap() { - @SuppressWarnings("unchecked") - final Map map = MDC.getContext(); - return map == null ? Collections.emptyMap() : map; - } - - public Object putMdc(String key, Object val) { - try { - return MDC.get(key); - } finally { - MDC.put(key, val); - } - } - - public void removeMdc(String key) { - MDC.remove(key); - } - - public void clearNdc() { - NDC.remove(); - } - - public String getNdc() { - return NDC.get(); - } - - public int getNdcDepth() { - return NDC.getDepth(); - } - - public String peekNdc() { - return NDC.peek(); - } - - public String popNdc() { - return NDC.pop(); - } - - public void pushNdc(String message) { - NDC.push(message); - } - - public void setNdcMaxDepth(int maxDepth) { - NDC.setMaxDepth(maxDepth); - } -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/LogMessage.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/LogMessage.java deleted file mode 100644 index d3517341a..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/LogMessage.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2010 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed 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 com.fr.third.org.jboss.logging; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.RetentionPolicy.CLASS; - -/** - * A typed logger method. Indicates that this method will log the associated {@link Message} to the logger system, as - * opposed to being a simple message lookup. - * - * @deprecated Use com.fr.third.org.jboss.logging.annotations.LogMessage provided in module org.jboss.logging:jboss-logging-annotations - * - * @author David M. Lloyd - */ -@Retention(CLASS) -@Target(METHOD) -@Documented -@Deprecated -public @interface LogMessage { - - /** - * The log level at which this message should be logged. Defaults to {@code INFO}. - * - * @return the log level - */ - Logger.Level level() default Logger.Level.INFO; - - /** - * The logging class name to use for this message, if any. - * - * @return the logging class name - */ - Class loggingClass() default Void.class; -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/Logger.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/Logger.java deleted file mode 100644 index 4c990c85f..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/Logger.java +++ /dev/null @@ -1,2594 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2011 Red Hat, Inc. - * - * Licensed 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 com.fr.third.org.jboss.logging; - -import java.io.Serializable; -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; -import java.security.PrivilegedAction; -import java.util.Locale; - -import static java.security.AccessController.doPrivileged; - -/** - * An abstracted logging entry point. - */ -public abstract class Logger implements Serializable, BasicLogger { - - private static final long serialVersionUID = 4232175575988879434L; - - private static final String FQCN = Logger.class.getName(); - - /** - * Levels used by this logging API. - */ - public enum Level { - FATAL, - ERROR, - WARN, - INFO, - DEBUG, - TRACE, - } - - private final String name; - - /** - * Construct a new instance. - * - * @param name the logger category name - */ - protected Logger(final String name) { - this.name = name; - } - - /** - * Return the name of this logger. - * - * @return The name of this logger. - */ - public String getName() { - return name; - } - - /** - * Implementation log method (standard parameter formatting). - * - * @param level the level - * @param loggerClassName the logger class name - * @param message the message to log - * @param parameters the parameters of the message - * @param thrown the exception which was thrown, if any - */ - protected abstract void doLog(Level level, String loggerClassName, Object message, Object[] parameters, Throwable thrown); - - /** - * Implementation log method (printf formatting). - * - * @param level the level - * @param loggerClassName the logger class name - * @param format the format string to log - * @param parameters the parameters of the message - * @param thrown the exception which was thrown, if any - */ - protected abstract void doLogf(Level level, String loggerClassName, String format, Object[] parameters, Throwable thrown); - - /** - * Check to see if the {@code TRACE} level is enabled for this logger. - * - * @return {@code true} if messages logged at {@link Level#TRACE} may be accepted, {@code false} otherwise - */ - public boolean isTraceEnabled() { - return isEnabled(Level.TRACE); - } - - /** - * Issue a log message with a level of TRACE. - * - * @param message the message - */ - public void trace(Object message) { - doLog(Level.TRACE, FQCN, message, null, null); - } - - /** - * Issue a log message and throwable with a level of TRACE. - * - * @param message the message - * @param t the throwable - */ - public void trace(Object message, Throwable t) { - doLog(Level.TRACE, FQCN, message, null, t); - } - - /** - * Issue a log message and throwable with a level of TRACE and a specific logger class name. - * - * @param loggerFqcn the logger class name - * @param message the message - * @param t the throwable - */ - public void trace(String loggerFqcn, Object message, Throwable t) { - doLog(Level.TRACE, loggerFqcn, message, null, t); - } - - /** - * Issue a log message with parameters with a level of TRACE. - * - * @param message the message - * @param params the message parameters - * @deprecated To log a message with parameters, using {@link #tracev(String, Object...)} is recommended. - */ - @Deprecated - public void trace(Object message, Object[] params) { - doLog(Level.TRACE, FQCN, message, params, null); - } - - /** - * Issue a log message with parameters and a throwable with a level of TRACE. - * - * @param message the message - * @param params the message parameters - * @param t the throwable - * @deprecated To log a message with parameters, using {@link #tracev(Throwable, String, Object...)} is recommended. - */ - @Deprecated - public void trace(Object message, Object[] params, Throwable t) { - doLog(Level.TRACE, FQCN, message, params, t); - } - - /** - * Issue a log message with parameters and a throwable with a level of TRACE. - * - * @param loggerFqcn the logger class name - * @param message the message - * @param params the message parameters - * @param t the throwable - */ - public void trace(String loggerFqcn, Object message, Object[] params, Throwable t) { - doLog(Level.TRACE, loggerFqcn, message, params, t); - } - - /** - * Issue a log message with a level of TRACE using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param params the parameters - */ - public void tracev(String format, Object... params) { - doLog(Level.TRACE, FQCN, format, params, null); - } - - /** - * Issue a log message with a level of TRACE using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param param1 the sole parameter - */ - public void tracev(String format, Object param1) { - if (isEnabled(Level.TRACE)) { - doLog(Level.TRACE, FQCN, format, new Object[] { param1 }, null); - } - } - - /** - * Issue a log message with a level of TRACE using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - */ - public void tracev(String format, Object param1, Object param2) { - if (isEnabled(Level.TRACE)) { - doLog(Level.TRACE, FQCN, format, new Object[] { param1, param2 }, null); - } - } - - /** - * Issue a log message with a level of TRACE using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - public void tracev(String format, Object param1, Object param2, Object param3) { - if (isEnabled(Level.TRACE)) { - doLog(Level.TRACE, FQCN, format, new Object[] { param1, param2, param3 }, null); - } - } - - /** - * Issue a log message with a level of TRACE using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param params the parameters - */ - public void tracev(Throwable t, String format, Object... params) { - doLog(Level.TRACE, FQCN, format, params, t); - } - - /** - * Issue a log message with a level of TRACE using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param param1 the sole parameter - */ - public void tracev(Throwable t, String format, Object param1) { - if (isEnabled(Level.TRACE)) { - doLog(Level.TRACE, FQCN, format, new Object[] { param1 }, t); - } - } - - /** - * Issue a log message with a level of TRACE using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - */ - public void tracev(Throwable t, String format, Object param1, Object param2) { - if (isEnabled(Level.TRACE)) { - doLog(Level.TRACE, FQCN, format, new Object[] { param1, param2 }, t); - } - } - - /** - * Issue a log message with a level of TRACE using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - public void tracev(Throwable t, String format, Object param1, Object param2, Object param3) { - if (isEnabled(Level.TRACE)) { - doLog(Level.TRACE, FQCN, format, new Object[] { param1, param2, param3 }, t); - } - } - - /** - * Issue a formatted log message with a level of TRACE. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param params the parameters - */ - public void tracef(String format, Object... params) { - doLogf(Level.TRACE, FQCN, format, params, null); - } - - /** - * Issue a formatted log message with a level of TRACE. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the sole parameter - */ - public void tracef(String format, Object param1) { - if (isEnabled(Level.TRACE)) { - doLogf(Level.TRACE, FQCN, format, new Object[] { param1 }, null); - } - } - - /** - * Issue a formatted log message with a level of TRACE. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the first parameter - * @param param2 the second parameter - */ - public void tracef(String format, Object param1, Object param2) { - if (isEnabled(Level.TRACE)) { - doLogf(Level.TRACE, FQCN, format, new Object[] { param1, param2 }, null); - } - } - - /** - * Issue a formatted log message with a level of TRACE. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - public void tracef(String format, Object param1, Object param2, Object param3) { - if (isEnabled(Level.TRACE)) { - doLogf(Level.TRACE, FQCN, format, new Object[] { param1, param2, param3 }, null); - } - } - - /** - * Issue a formatted log message with a level of TRACE. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param params the parameters - */ - public void tracef(Throwable t, String format, Object... params) { - doLogf(Level.TRACE, FQCN, format, params, t); - } - - /** - * Issue a formatted log message with a level of TRACE. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param param1 the sole parameter - */ - public void tracef(Throwable t, String format, Object param1) { - if (isEnabled(Level.TRACE)) { - doLogf(Level.TRACE, FQCN, format, new Object[] { param1 }, t); - } - } - - /** - * Issue a formatted log message with a level of TRACE. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param param1 the first parameter - * @param param2 the second parameter - */ - public void tracef(Throwable t, String format, Object param1, Object param2) { - if (isEnabled(Level.TRACE)) { - doLogf(Level.TRACE, FQCN, format, new Object[] { param1, param2 }, t); - } - } - - /** - * Issue a formatted log message with a level of TRACE. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - public void tracef(Throwable t, String format, Object param1, Object param2, Object param3) { - if (isEnabled(Level.TRACE)) { - doLogf(Level.TRACE, FQCN, format, new Object[] { param1, param2, param3 }, t); - } - } - - public void tracef(final String format, final int arg) { - if (isEnabled(Level.TRACE)) { - doLogf(Level.TRACE, FQCN, format, new Object[] { arg }, null); - } - } - - public void tracef(final String format, final int arg1, final int arg2) { - if (isEnabled(Level.TRACE)) { - doLogf(Level.TRACE, FQCN, format, new Object[] { arg1, arg2 }, null); - } - } - - public void tracef(final String format, final int arg1, final Object arg2) { - if (isEnabled(Level.TRACE)) { - doLogf(Level.TRACE, FQCN, format, new Object[] { arg1, arg2 }, null); - } - } - - public void tracef(final String format, final int arg1, final int arg2, final int arg3) { - if (isEnabled(Level.TRACE)) { - doLogf(Level.TRACE, FQCN, format, new Object[] { arg1, arg2, arg3 }, null); - } - } - - public void tracef(final String format, final int arg1, final int arg2, final Object arg3) { - if (isEnabled(Level.TRACE)) { - doLogf(Level.TRACE, FQCN, format, new Object[] { arg1, arg2, arg3 }, null); - } - } - - public void tracef(final String format, final int arg1, final Object arg2, final Object arg3) { - if (isEnabled(Level.TRACE)) { - doLogf(Level.TRACE, FQCN, format, new Object[] { arg1, arg2, arg3 }, null); - } - } - - public void tracef(final Throwable t, final String format, final int arg) { - if (isEnabled(Level.TRACE)) { - doLogf(Level.TRACE, FQCN, format, new Object[] { arg }, t); - } - } - - public void tracef(final Throwable t, final String format, final int arg1, final int arg2) { - if (isEnabled(Level.TRACE)) { - doLogf(Level.TRACE, FQCN, format, new Object[] { arg1, arg2 }, t); - } - } - - public void tracef(final Throwable t, final String format, final int arg1, final Object arg2) { - if (isEnabled(Level.TRACE)) { - doLogf(Level.TRACE, FQCN, format, new Object[] { arg1, arg2 }, t); - } - } - - public void tracef(final Throwable t, final String format, final int arg1, final int arg2, final int arg3) { - if (isEnabled(Level.TRACE)) { - doLogf(Level.TRACE, FQCN, format, new Object[] { arg1, arg2, arg3 }, t); - } - } - - public void tracef(final Throwable t, final String format, final int arg1, final int arg2, final Object arg3) { - if (isEnabled(Level.TRACE)) { - doLogf(Level.TRACE, FQCN, format, new Object[] { arg1, arg2, arg3 }, t); - } - } - - public void tracef(final Throwable t, final String format, final int arg1, final Object arg2, final Object arg3) { - if (isEnabled(Level.TRACE)) { - doLogf(Level.TRACE, FQCN, format, new Object[] { arg1, arg2, arg3 }, t); - } - } - - public void tracef(final String format, final long arg) { - if (isEnabled(Level.TRACE)) { - doLogf(Level.TRACE, FQCN, format, new Object[] { arg }, null); - } - } - - public void tracef(final String format, final long arg1, final long arg2) { - if (isEnabled(Level.TRACE)) { - doLogf(Level.TRACE, FQCN, format, new Object[] { arg1, arg2 }, null); - } - } - - public void tracef(final String format, final long arg1, final Object arg2) { - if (isEnabled(Level.TRACE)) { - doLogf(Level.TRACE, FQCN, format, new Object[] { arg1, arg2 }, null); - } - } - - public void tracef(final String format, final long arg1, final long arg2, final long arg3) { - if (isEnabled(Level.TRACE)) { - doLogf(Level.TRACE, FQCN, format, new Object[] { arg1, arg2, arg3 }, null); - } - } - - public void tracef(final String format, final long arg1, final long arg2, final Object arg3) { - if (isEnabled(Level.TRACE)) { - doLogf(Level.TRACE, FQCN, format, new Object[] { arg1, arg2, arg3 }, null); - } - } - - public void tracef(final String format, final long arg1, final Object arg2, final Object arg3) { - if (isEnabled(Level.TRACE)) { - doLogf(Level.TRACE, FQCN, format, new Object[] { arg1, arg2, arg3 }, null); - } - } - - public void tracef(final Throwable t, final String format, final long arg) { - if (isEnabled(Level.TRACE)) { - doLogf(Level.TRACE, FQCN, format, new Object[] { arg }, t); - } - } - - public void tracef(final Throwable t, final String format, final long arg1, final long arg2) { - if (isEnabled(Level.TRACE)) { - doLogf(Level.TRACE, FQCN, format, new Object[] { arg1, arg2 }, t); - } - } - - public void tracef(final Throwable t, final String format, final long arg1, final Object arg2) { - if (isEnabled(Level.TRACE)) { - doLogf(Level.TRACE, FQCN, format, new Object[] { arg1, arg2 }, t); - } - } - - public void tracef(final Throwable t, final String format, final long arg1, final long arg2, final long arg3) { - if (isEnabled(Level.TRACE)) { - doLogf(Level.TRACE, FQCN, format, new Object[] { arg1, arg2, arg3 }, t); - } - } - - public void tracef(final Throwable t, final String format, final long arg1, final long arg2, final Object arg3) { - if (isEnabled(Level.TRACE)) { - doLogf(Level.TRACE, FQCN, format, new Object[] { arg1, arg2, arg3 }, t); - } - } - - public void tracef(final Throwable t, final String format, final long arg1, final Object arg2, final Object arg3) { - if (isEnabled(Level.TRACE)) { - doLogf(Level.TRACE, FQCN, format, new Object[] { arg1, arg2, arg3 }, t); - } - } - - /** - * Check to see if the {@code DEBUG} level is enabled for this logger. - * - * @return {@code true} if messages logged at {@link Level#DEBUG} may be accepted, {@code false} otherwise - */ - public boolean isDebugEnabled() { - return isEnabled(Level.DEBUG); - } - - /** - * Issue a log message with a level of DEBUG. - * - * @param message the message - */ - public void debug(Object message) { - doLog(Level.DEBUG, FQCN, message, null, null); - } - - /** - * Issue a log message and throwable with a level of DEBUG. - * - * @param message the message - * @param t the throwable - */ - public void debug(Object message, Throwable t) { - doLog(Level.DEBUG, FQCN, message, null, t); - } - - /** - * Issue a log message and throwable with a level of DEBUG and a specific logger class name. - * - * @param loggerFqcn the logger class name - * @param message the message - * @param t the throwable - */ - public void debug(String loggerFqcn, Object message, Throwable t) { - doLog(Level.DEBUG, loggerFqcn, message, null, t); - } - - /** - * Issue a log message with parameters with a level of DEBUG. - * - * @param message the message - * @param params the message parameters - * @deprecated To log a message with parameters, using {@link #debugv(String, Object...)} is recommended. - */ - @Deprecated - public void debug(Object message, Object[] params) { - doLog(Level.DEBUG, FQCN, message, params, null); - } - - /** - * Issue a log message with parameters and a throwable with a level of DEBUG. - * - * @param message the message - * @param params the message parameters - * @param t the throwable - * @deprecated To log a message with parameters, using {@link #debugv(Throwable, String, Object...)} is recommended. - */ - @Deprecated - public void debug(Object message, Object[] params, Throwable t) { - doLog(Level.DEBUG, FQCN, message, params, t); - } - - /** - * Issue a log message with parameters and a throwable with a level of DEBUG. - * - * @param loggerFqcn the logger class name - * @param message the message - * @param params the message parameters - * @param t the throwable - */ - public void debug(String loggerFqcn, Object message, Object[] params, Throwable t) { - doLog(Level.DEBUG, loggerFqcn, message, params, t); - } - - /** - * Issue a log message with a level of DEBUG using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param params the parameters - */ - public void debugv(String format, Object... params) { - doLog(Level.DEBUG, FQCN, format, params, null); - } - - /** - * Issue a log message with a level of DEBUG using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param param1 the sole parameter - */ - public void debugv(String format, Object param1) { - if (isEnabled(Level.DEBUG)) { - doLog(Level.DEBUG, FQCN, format, new Object[] { param1 }, null); - } - } - - /** - * Issue a log message with a level of DEBUG using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - */ - public void debugv(String format, Object param1, Object param2) { - if (isEnabled(Level.DEBUG)) { - doLog(Level.DEBUG, FQCN, format, new Object[] { param1, param2 }, null); - } - } - - /** - * Issue a log message with a level of DEBUG using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - public void debugv(String format, Object param1, Object param2, Object param3) { - if (isEnabled(Level.DEBUG)) { - doLog(Level.DEBUG, FQCN, format, new Object[] { param1, param2, param3 }, null); - } - } - - /** - * Issue a log message with a level of DEBUG using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param params the parameters - */ - public void debugv(Throwable t, String format, Object... params) { - doLog(Level.DEBUG, FQCN, format, params, t); - } - - /** - * Issue a log message with a level of DEBUG using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param param1 the sole parameter - */ - public void debugv(Throwable t, String format, Object param1) { - if (isEnabled(Level.DEBUG)) { - doLog(Level.DEBUG, FQCN, format, new Object[] { param1 }, t); - } - } - - /** - * Issue a log message with a level of DEBUG using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - */ - public void debugv(Throwable t, String format, Object param1, Object param2) { - if (isEnabled(Level.DEBUG)) { - doLog(Level.DEBUG, FQCN, format, new Object[] { param1, param2 }, t); - } - } - - /** - * Issue a log message with a level of DEBUG using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - public void debugv(Throwable t, String format, Object param1, Object param2, Object param3) { - if (isEnabled(Level.DEBUG)) { - doLog(Level.DEBUG, FQCN, format, new Object[] { param1, param2, param3 }, t); - } - } - - /** - * Issue a formatted log message with a level of DEBUG. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param params the parameters - */ - public void debugf(String format, Object... params) { - doLogf(Level.DEBUG, FQCN, format, params, null); - } - - /** - * Issue a formatted log message with a level of DEBUG. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the sole parameter - */ - public void debugf(String format, Object param1) { - if (isEnabled(Level.DEBUG)) { - doLogf(Level.DEBUG, FQCN, format, new Object[] { param1 }, null); - } - } - - /** - * Issue a formatted log message with a level of DEBUG. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the first parameter - * @param param2 the second parameter - */ - public void debugf(String format, Object param1, Object param2) { - if (isEnabled(Level.DEBUG)) { - doLogf(Level.DEBUG, FQCN, format, new Object[] { param1, param2 }, null); - } - } - - /** - * Issue a formatted log message with a level of DEBUG. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - public void debugf(String format, Object param1, Object param2, Object param3) { - if (isEnabled(Level.DEBUG)) { - doLogf(Level.DEBUG, FQCN, format, new Object[] { param1, param2, param3 }, null); - } - } - - /** - * Issue a formatted log message with a level of DEBUG. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param params the parameters - */ - public void debugf(Throwable t, String format, Object... params) { - doLogf(Level.DEBUG, FQCN, format, params, t); - } - - /** - * Issue a formatted log message with a level of DEBUG. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param param1 the sole parameter - */ - public void debugf(Throwable t, String format, Object param1) { - if (isEnabled(Level.DEBUG)) { - doLogf(Level.DEBUG, FQCN, format, new Object[] { param1 }, t); - } - } - - /** - * Issue a formatted log message with a level of DEBUG. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param param1 the first parameter - * @param param2 the second parameter - */ - public void debugf(Throwable t, String format, Object param1, Object param2) { - if (isEnabled(Level.DEBUG)) { - doLogf(Level.DEBUG, FQCN, format, new Object[] { param1, param2 }, t); - } - } - - /** - * Issue a formatted log message with a level of DEBUG. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - public void debugf(Throwable t, String format, Object param1, Object param2, Object param3) { - if (isEnabled(Level.DEBUG)) { - doLogf(Level.DEBUG, FQCN, format, new Object[] { param1, param2, param3 }, t); - } - } - - public void debugf(final String format, final int arg) { - if (isEnabled(Level.DEBUG)) { - doLogf(Level.DEBUG, FQCN, format, new Object[] { arg }, null); - } - } - - public void debugf(final String format, final int arg1, final int arg2) { - if (isEnabled(Level.DEBUG)) { - doLogf(Level.DEBUG, FQCN, format, new Object[] { arg1, arg2 }, null); - } - } - - public void debugf(final String format, final int arg1, final Object arg2) { - if (isEnabled(Level.DEBUG)) { - doLogf(Level.DEBUG, FQCN, format, new Object[] { arg1, arg2 }, null); - } - } - - public void debugf(final String format, final int arg1, final int arg2, final int arg3) { - if (isEnabled(Level.DEBUG)) { - doLogf(Level.DEBUG, FQCN, format, new Object[] { arg1, arg2, arg3 }, null); - } - } - - public void debugf(final String format, final int arg1, final int arg2, final Object arg3) { - if (isEnabled(Level.DEBUG)) { - doLogf(Level.DEBUG, FQCN, format, new Object[] { arg1, arg2, arg3 }, null); - } - } - - public void debugf(final String format, final int arg1, final Object arg2, final Object arg3) { - if (isEnabled(Level.DEBUG)) { - doLogf(Level.DEBUG, FQCN, format, new Object[] { arg1, arg2, arg3 }, null); - } - } - - public void debugf(final Throwable t, final String format, final int arg) { - if (isEnabled(Level.DEBUG)) { - doLogf(Level.DEBUG, FQCN, format, new Object[] { arg }, t); - } - } - - public void debugf(final Throwable t, final String format, final int arg1, final int arg2) { - if (isEnabled(Level.DEBUG)) { - doLogf(Level.DEBUG, FQCN, format, new Object[] { arg1, arg2 }, t); - } - } - - public void debugf(final Throwable t, final String format, final int arg1, final Object arg2) { - if (isEnabled(Level.DEBUG)) { - doLogf(Level.DEBUG, FQCN, format, new Object[] { arg1, arg2 }, t); - } - } - - public void debugf(final Throwable t, final String format, final int arg1, final int arg2, final int arg3) { - if (isEnabled(Level.DEBUG)) { - doLogf(Level.DEBUG, FQCN, format, new Object[] { arg1, arg2, arg3 }, t); - } - } - - public void debugf(final Throwable t, final String format, final int arg1, final int arg2, final Object arg3) { - if (isEnabled(Level.DEBUG)) { - doLogf(Level.DEBUG, FQCN, format, new Object[] { arg1, arg2, arg3 }, t); - } - } - - public void debugf(final Throwable t, final String format, final int arg1, final Object arg2, final Object arg3) { - if (isEnabled(Level.DEBUG)) { - doLogf(Level.DEBUG, FQCN, format, new Object[] { arg1, arg2, arg3 }, t); - } - } - - public void debugf(final String format, final long arg) { - if (isEnabled(Level.DEBUG)) { - doLogf(Level.DEBUG, FQCN, format, new Object[] { arg }, null); - } - } - - public void debugf(final String format, final long arg1, final long arg2) { - if (isEnabled(Level.DEBUG)) { - doLogf(Level.DEBUG, FQCN, format, new Object[] { arg1, arg2 }, null); - } - } - - public void debugf(final String format, final long arg1, final Object arg2) { - if (isEnabled(Level.DEBUG)) { - doLogf(Level.DEBUG, FQCN, format, new Object[] { arg1, arg2 }, null); - } - } - - public void debugf(final String format, final long arg1, final long arg2, final long arg3) { - if (isEnabled(Level.DEBUG)) { - doLogf(Level.DEBUG, FQCN, format, new Object[] { arg1, arg2, arg3 }, null); - } - } - - public void debugf(final String format, final long arg1, final long arg2, final Object arg3) { - if (isEnabled(Level.DEBUG)) { - doLogf(Level.DEBUG, FQCN, format, new Object[] { arg1, arg2, arg3 }, null); - } - } - - public void debugf(final String format, final long arg1, final Object arg2, final Object arg3) { - if (isEnabled(Level.DEBUG)) { - doLogf(Level.DEBUG, FQCN, format, new Object[] { arg1, arg2, arg3 }, null); - } - } - - public void debugf(final Throwable t, final String format, final long arg) { - if (isEnabled(Level.DEBUG)) { - doLogf(Level.DEBUG, FQCN, format, new Object[] { arg }, t); - } - } - - public void debugf(final Throwable t, final String format, final long arg1, final long arg2) { - if (isEnabled(Level.DEBUG)) { - doLogf(Level.DEBUG, FQCN, format, new Object[] { arg1, arg2 }, t); - } - } - - public void debugf(final Throwable t, final String format, final long arg1, final Object arg2) { - if (isEnabled(Level.DEBUG)) { - doLogf(Level.DEBUG, FQCN, format, new Object[] { arg1, arg2 }, t); - } - } - - public void debugf(final Throwable t, final String format, final long arg1, final long arg2, final long arg3) { - if (isEnabled(Level.DEBUG)) { - doLogf(Level.DEBUG, FQCN, format, new Object[] { arg1, arg2, arg3 }, t); - } - } - - public void debugf(final Throwable t, final String format, final long arg1, final long arg2, final Object arg3) { - if (isEnabled(Level.DEBUG)) { - doLogf(Level.DEBUG, FQCN, format, new Object[] { arg1, arg2, arg3 }, t); - } - } - - public void debugf(final Throwable t, final String format, final long arg1, final Object arg2, final Object arg3) { - if (isEnabled(Level.DEBUG)) { - doLogf(Level.DEBUG, FQCN, format, new Object[] { arg1, arg2, arg3 }, t); - } - } - - /** - * Check to see if the {@code INFO} level is enabled for this logger. - * - * @return {@code true} if messages logged at {@link Level#INFO} may be accepted, {@code false} otherwise - */ - public boolean isInfoEnabled() { - return isEnabled(Level.INFO); - } - - /** - * Issue a log message with a level of INFO. - * - * @param message the message - */ - public void info(Object message) { - doLog(Level.INFO, FQCN, message, null, null); - } - - /** - * Issue a log message and throwable with a level of INFO. - * - * @param message the message - * @param t the throwable - */ - public void info(Object message, Throwable t) { - doLog(Level.INFO, FQCN, message, null, t); - } - - /** - * Issue a log message and throwable with a level of INFO and a specific logger class name. - * - * @param loggerFqcn the logger class name - * @param message the message - * @param t the throwable - */ - public void info(String loggerFqcn, Object message, Throwable t) { - doLog(Level.INFO, loggerFqcn, message, null, t); - } - - /** - * Issue a log message with parameters with a level of INFO. - * - * @param message the message - * @param params the message parameters - * @deprecated To log a message with parameters, using {@link #infov(String, Object...)} is recommended. - */ - @Deprecated - public void info(Object message, Object[] params) { - doLog(Level.INFO, FQCN, message, params, null); - } - - /** - * Issue a log message with parameters and a throwable with a level of INFO. - * - * @param message the message - * @param params the message parameters - * @param t the throwable - * @deprecated To log a message with parameters, using {@link #infov(Throwable, String, Object...)} is recommended. - */ - @Deprecated - public void info(Object message, Object[] params, Throwable t) { - doLog(Level.INFO, FQCN, message, params, t); - } - - /** - * Issue a log message with parameters and a throwable with a level of INFO. - * - * @param loggerFqcn the logger class name - * @param message the message - * @param params the message parameters - * @param t the throwable - */ - public void info(String loggerFqcn, Object message, Object[] params, Throwable t) { - doLog(Level.INFO, loggerFqcn, message, params, t); - } - - /** - * Issue a log message with a level of INFO using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param params the parameters - */ - public void infov(String format, Object... params) { - doLog(Level.INFO, FQCN, format, params, null); - } - - /** - * Issue a log message with a level of INFO using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param param1 the sole parameter - */ - public void infov(String format, Object param1) { - if (isEnabled(Level.INFO)) { - doLog(Level.INFO, FQCN, format, new Object[] { param1 }, null); - } - } - - /** - * Issue a log message with a level of INFO using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - */ - public void infov(String format, Object param1, Object param2) { - if (isEnabled(Level.INFO)) { - doLog(Level.INFO, FQCN, format, new Object[] { param1, param2 }, null); - } - } - - /** - * Issue a log message with a level of INFO using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - public void infov(String format, Object param1, Object param2, Object param3) { - if (isEnabled(Level.INFO)) { - doLog(Level.INFO, FQCN, format, new Object[] { param1, param2, param3 }, null); - } - } - - /** - * Issue a log message with a level of INFO using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param params the parameters - */ - public void infov(Throwable t, String format, Object... params) { - doLog(Level.INFO, FQCN, format, params, t); - } - - /** - * Issue a log message with a level of INFO using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param param1 the sole parameter - */ - public void infov(Throwable t, String format, Object param1) { - if (isEnabled(Level.INFO)) { - doLog(Level.INFO, FQCN, format, new Object[] { param1 }, t); - } - } - - /** - * Issue a log message with a level of INFO using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - */ - public void infov(Throwable t, String format, Object param1, Object param2) { - if (isEnabled(Level.INFO)) { - doLog(Level.INFO, FQCN, format, new Object[] { param1, param2 }, t); - } - } - - /** - * Issue a log message with a level of INFO using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - public void infov(Throwable t, String format, Object param1, Object param2, Object param3) { - if (isEnabled(Level.INFO)) { - doLog(Level.INFO, FQCN, format, new Object[] { param1, param2, param3 }, t); - } - } - - /** - * Issue a formatted log message with a level of INFO. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param params the parameters - */ - public void infof(String format, Object... params) { - doLogf(Level.INFO, FQCN, format, params, null); - } - - /** - * Issue a formatted log message with a level of INFO. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the sole parameter - */ - public void infof(String format, Object param1) { - if (isEnabled(Level.INFO)) { - doLogf(Level.INFO, FQCN, format, new Object[] { param1 }, null); - } - } - - /** - * Issue a formatted log message with a level of INFO. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the first parameter - * @param param2 the second parameter - */ - public void infof(String format, Object param1, Object param2) { - if (isEnabled(Level.INFO)) { - doLogf(Level.INFO, FQCN, format, new Object[] { param1, param2 }, null); - } - } - - /** - * Issue a formatted log message with a level of INFO. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - public void infof(String format, Object param1, Object param2, Object param3) { - if (isEnabled(Level.INFO)) { - doLogf(Level.INFO, FQCN, format, new Object[] { param1, param2, param3 }, null); - } - } - - /** - * Issue a formatted log message with a level of INFO. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param params the parameters - */ - public void infof(Throwable t, String format, Object... params) { - doLogf(Level.INFO, FQCN, format, params, t); - } - - /** - * Issue a formatted log message with a level of INFO. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param param1 the sole parameter - */ - public void infof(Throwable t, String format, Object param1) { - if (isEnabled(Level.INFO)) { - doLogf(Level.INFO, FQCN, format, new Object[] { param1 }, t); - } - } - - /** - * Issue a formatted log message with a level of INFO. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param param1 the first parameter - * @param param2 the second parameter - */ - public void infof(Throwable t, String format, Object param1, Object param2) { - if (isEnabled(Level.INFO)) { - doLogf(Level.INFO, FQCN, format, new Object[] { param1, param2 }, t); - } - } - - /** - * Issue a formatted log message with a level of INFO. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - public void infof(Throwable t, String format, Object param1, Object param2, Object param3) { - if (isEnabled(Level.INFO)) { - doLogf(Level.INFO, FQCN, format, new Object[] { param1, param2, param3 }, t); - } - } - - /** - * Issue a log message with a level of WARN. - * - * @param message the message - */ - public void warn(Object message) { - doLog(Level.WARN, FQCN, message, null, null); - } - - /** - * Issue a log message and throwable with a level of WARN. - * - * @param message the message - * @param t the throwable - */ - public void warn(Object message, Throwable t) { - doLog(Level.WARN, FQCN, message, null, t); - } - - /** - * Issue a log message and throwable with a level of WARN and a specific logger class name. - * - * @param loggerFqcn the logger class name - * @param message the message - * @param t the throwable - */ - public void warn(String loggerFqcn, Object message, Throwable t) { - doLog(Level.WARN, loggerFqcn, message, null, t); - } - - /** - * Issue a log message with parameters with a level of WARN. - * - * @param message the message - * @param params the message parameters - * @deprecated To log a message with parameters, using {@link #warnv(String, Object...)} is recommended. - */ - @Deprecated - public void warn(Object message, Object[] params) { - doLog(Level.WARN, FQCN, message, params, null); - } - - /** - * Issue a log message with parameters and a throwable with a level of WARN. - * - * @param message the message - * @param params the message parameters - * @param t the throwable - * @deprecated To log a message with parameters, using {@link #warnv(Throwable, String, Object...)} is recommended. - */ - @Deprecated - public void warn(Object message, Object[] params, Throwable t) { - doLog(Level.WARN, FQCN, message, params, t); - } - - /** - * Issue a log message with parameters and a throwable with a level of WARN. - * - * @param loggerFqcn the logger class name - * @param message the message - * @param params the message parameters - * @param t the throwable - */ - public void warn(String loggerFqcn, Object message, Object[] params, Throwable t) { - doLog(Level.WARN, loggerFqcn, message, params, t); - } - - /** - * Issue a log message with a level of WARN using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param params the parameters - */ - public void warnv(String format, Object... params) { - doLog(Level.WARN, FQCN, format, params, null); - } - - /** - * Issue a log message with a level of WARN using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param param1 the sole parameter - */ - public void warnv(String format, Object param1) { - if (isEnabled(Level.WARN)) { - doLog(Level.WARN, FQCN, format, new Object[] { param1 }, null); - } - } - - /** - * Issue a log message with a level of WARN using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - */ - public void warnv(String format, Object param1, Object param2) { - if (isEnabled(Level.WARN)) { - doLog(Level.WARN, FQCN, format, new Object[] { param1, param2 }, null); - } - } - - /** - * Issue a log message with a level of WARN using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - public void warnv(String format, Object param1, Object param2, Object param3) { - if (isEnabled(Level.WARN)) { - doLog(Level.WARN, FQCN, format, new Object[] { param1, param2, param3 }, null); - } - } - - /** - * Issue a log message with a level of WARN using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param params the parameters - */ - public void warnv(Throwable t, String format, Object... params) { - doLog(Level.WARN, FQCN, format, params, t); - } - - /** - * Issue a log message with a level of WARN using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param param1 the sole parameter - */ - public void warnv(Throwable t, String format, Object param1) { - if (isEnabled(Level.WARN)) { - doLog(Level.WARN, FQCN, format, new Object[] { param1 }, t); - } - } - - /** - * Issue a log message with a level of WARN using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - */ - public void warnv(Throwable t, String format, Object param1, Object param2) { - if (isEnabled(Level.WARN)) { - doLog(Level.WARN, FQCN, format, new Object[] { param1, param2 }, t); - } - } - - /** - * Issue a log message with a level of WARN using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - public void warnv(Throwable t, String format, Object param1, Object param2, Object param3) { - if (isEnabled(Level.WARN)) { - doLog(Level.WARN, FQCN, format, new Object[] { param1, param2, param3 }, t); - } - } - - /** - * Issue a formatted log message with a level of WARN. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param params the parameters - */ - public void warnf(String format, Object... params) { - doLogf(Level.WARN, FQCN, format, params, null); - } - - /** - * Issue a formatted log message with a level of WARN. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the sole parameter - */ - public void warnf(String format, Object param1) { - if (isEnabled(Level.WARN)) { - doLogf(Level.WARN, FQCN, format, new Object[] { param1 }, null); - } - } - - /** - * Issue a formatted log message with a level of WARN. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the first parameter - * @param param2 the second parameter - */ - public void warnf(String format, Object param1, Object param2) { - if (isEnabled(Level.WARN)) { - doLogf(Level.WARN, FQCN, format, new Object[] { param1, param2 }, null); - } - } - - /** - * Issue a formatted log message with a level of WARN. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - public void warnf(String format, Object param1, Object param2, Object param3) { - if (isEnabled(Level.WARN)) { - doLogf(Level.WARN, FQCN, format, new Object[] { param1, param2, param3 }, null); - } - } - - /** - * Issue a formatted log message with a level of WARN. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param params the parameters - */ - public void warnf(Throwable t, String format, Object... params) { - doLogf(Level.WARN, FQCN, format, params, t); - } - - /** - * Issue a formatted log message with a level of WARN. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param param1 the sole parameter - */ - public void warnf(Throwable t, String format, Object param1) { - if (isEnabled(Level.WARN)) { - doLogf(Level.WARN, FQCN, format, new Object[] { param1 }, t); - } - } - - /** - * Issue a formatted log message with a level of WARN. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param param1 the first parameter - * @param param2 the second parameter - */ - public void warnf(Throwable t, String format, Object param1, Object param2) { - if (isEnabled(Level.WARN)) { - doLogf(Level.WARN, FQCN, format, new Object[] { param1, param2 }, t); - } - } - - /** - * Issue a formatted log message with a level of WARN. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - public void warnf(Throwable t, String format, Object param1, Object param2, Object param3) { - if (isEnabled(Level.WARN)) { - doLogf(Level.WARN, FQCN, format, new Object[] { param1, param2, param3 }, t); - } - } - - /** - * Issue a log message with a level of ERROR. - * - * @param message the message - */ - public void error(Object message) { - doLog(Level.ERROR, FQCN, message, null, null); - } - - /** - * Issue a log message and throwable with a level of ERROR. - * - * @param message the message - * @param t the throwable - */ - public void error(Object message, Throwable t) { - doLog(Level.ERROR, FQCN, message, null, t); - } - - /** - * Issue a log message and throwable with a level of ERROR and a specific logger class name. - * - * @param loggerFqcn the logger class name - * @param message the message - * @param t the throwable - */ - public void error(String loggerFqcn, Object message, Throwable t) { - doLog(Level.ERROR, loggerFqcn, message, null, t); - } - - /** - * Issue a log message with parameters with a level of ERROR. - * - * @param message the message - * @param params the message parameters - * @deprecated To log a message with parameters, using {@link #errorv(String, Object...)} is recommended. - */ - @Deprecated - public void error(Object message, Object[] params) { - doLog(Level.ERROR, FQCN, message, params, null); - } - - /** - * Issue a log message with parameters and a throwable with a level of ERROR. - * - * @param message the message - * @param params the message parameters - * @param t the throwable - * @deprecated To log a message with parameters, using {@link #errorv(Throwable, String, Object...)} is recommended. - */ - @Deprecated - public void error(Object message, Object[] params, Throwable t) { - doLog(Level.ERROR, FQCN, message, params, t); - } - - /** - * Issue a log message with parameters and a throwable with a level of ERROR. - * - * @param loggerFqcn the logger class name - * @param message the message - * @param params the message parameters - * @param t the throwable - */ - public void error(String loggerFqcn, Object message, Object[] params, Throwable t) { - doLog(Level.ERROR, loggerFqcn, message, params, t); - } - - /** - * Issue a log message with a level of ERROR using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param params the parameters - */ - public void errorv(String format, Object... params) { - doLog(Level.ERROR, FQCN, format, params, null); - } - - /** - * Issue a log message with a level of ERROR using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param param1 the sole parameter - */ - public void errorv(String format, Object param1) { - if (isEnabled(Level.ERROR)) { - doLog(Level.ERROR, FQCN, format, new Object[] { param1 }, null); - } - } - - /** - * Issue a log message with a level of ERROR using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - */ - public void errorv(String format, Object param1, Object param2) { - if (isEnabled(Level.ERROR)) { - doLog(Level.ERROR, FQCN, format, new Object[] { param1, param2 }, null); - } - } - - /** - * Issue a log message with a level of ERROR using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - public void errorv(String format, Object param1, Object param2, Object param3) { - if (isEnabled(Level.ERROR)) { - doLog(Level.ERROR, FQCN, format, new Object[] { param1, param2, param3 }, null); - } - } - - /** - * Issue a log message with a level of ERROR using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param params the parameters - */ - public void errorv(Throwable t, String format, Object... params) { - doLog(Level.ERROR, FQCN, format, params, t); - } - - /** - * Issue a log message with a level of ERROR using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param param1 the sole parameter - */ - public void errorv(Throwable t, String format, Object param1) { - if (isEnabled(Level.ERROR)) { - doLog(Level.ERROR, FQCN, format, new Object[] { param1 }, t); - } - } - - /** - * Issue a log message with a level of ERROR using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - */ - public void errorv(Throwable t, String format, Object param1, Object param2) { - if (isEnabled(Level.ERROR)) { - doLog(Level.ERROR, FQCN, format, new Object[] { param1, param2 }, t); - } - } - - /** - * Issue a log message with a level of ERROR using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - public void errorv(Throwable t, String format, Object param1, Object param2, Object param3) { - if (isEnabled(Level.ERROR)) { - doLog(Level.ERROR, FQCN, format, new Object[] { param1, param2, param3 }, t); - } - } - - /** - * Issue a formatted log message with a level of ERROR. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param params the parameters - */ - public void errorf(String format, Object... params) { - doLogf(Level.ERROR, FQCN, format, params, null); - } - - /** - * Issue a formatted log message with a level of ERROR. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the sole parameter - */ - public void errorf(String format, Object param1) { - if (isEnabled(Level.ERROR)) { - doLogf(Level.ERROR, FQCN, format, new Object[] { param1 }, null); - } - } - - /** - * Issue a formatted log message with a level of ERROR. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the first parameter - * @param param2 the second parameter - */ - public void errorf(String format, Object param1, Object param2) { - if (isEnabled(Level.ERROR)) { - doLogf(Level.ERROR, FQCN, format, new Object[] { param1, param2 }, null); - } - } - - /** - * Issue a formatted log message with a level of ERROR. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - public void errorf(String format, Object param1, Object param2, Object param3) { - if (isEnabled(Level.ERROR)) { - doLogf(Level.ERROR, FQCN, format, new Object[] { param1, param2, param3 }, null); - } - } - - /** - * Issue a formatted log message with a level of ERROR. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param params the parameters - */ - public void errorf(Throwable t, String format, Object... params) { - doLogf(Level.ERROR, FQCN, format, params, t); - } - - /** - * Issue a formatted log message with a level of ERROR. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param param1 the sole parameter - */ - public void errorf(Throwable t, String format, Object param1) { - if (isEnabled(Level.ERROR)) { - doLogf(Level.ERROR, FQCN, format, new Object[] { param1 }, t); - } - } - - /** - * Issue a formatted log message with a level of ERROR. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param param1 the first parameter - * @param param2 the second parameter - */ - public void errorf(Throwable t, String format, Object param1, Object param2) { - if (isEnabled(Level.ERROR)) { - doLogf(Level.ERROR, FQCN, format, new Object[] { param1, param2 }, t); - } - } - - /** - * Issue a formatted log message with a level of ERROR. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - public void errorf(Throwable t, String format, Object param1, Object param2, Object param3) { - if (isEnabled(Level.ERROR)) { - doLogf(Level.ERROR, FQCN, format, new Object[] { param1, param2, param3 }, t); - } - } - - /** - * Issue a log message with a level of FATAL. - * - * @param message the message - */ - public void fatal(Object message) { - doLog(Level.FATAL, FQCN, message, null, null); - } - - /** - * Issue a log message and throwable with a level of FATAL. - * - * @param message the message - * @param t the throwable - */ - public void fatal(Object message, Throwable t) { - doLog(Level.FATAL, FQCN, message, null, t); - } - - /** - * Issue a log message and throwable with a level of FATAL and a specific logger class name. - * - * @param loggerFqcn the logger class name - * @param message the message - * @param t the throwable - */ - public void fatal(String loggerFqcn, Object message, Throwable t) { - doLog(Level.FATAL, loggerFqcn, message, null, t); - } - - /** - * Issue a log message with parameters with a level of FATAL. - * - * @param message the message - * @param params the message parameters - * @deprecated To log a message with parameters, using {@link #fatalv(String, Object...)} is recommended. - */ - @Deprecated - public void fatal(Object message, Object[] params) { - doLog(Level.FATAL, FQCN, message, params, null); - } - - /** - * Issue a log message with parameters and a throwable with a level of FATAL. - * - * @param message the message - * @param params the message parameters - * @param t the throwable - * @deprecated To log a message with parameters, using {@link #fatalv(Throwable, String, Object...)} is recommended. - */ - @Deprecated - public void fatal(Object message, Object[] params, Throwable t) { - doLog(Level.FATAL, FQCN, message, params, t); - } - - /** - * Issue a log message with parameters and a throwable with a level of FATAL. - * - * @param loggerFqcn the logger class name - * @param message the message - * @param params the message parameters - * @param t the throwable - */ - public void fatal(String loggerFqcn, Object message, Object[] params, Throwable t) { - doLog(Level.FATAL, loggerFqcn, message, params, t); - } - - /** - * Issue a log message with a level of FATAL using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param params the parameters - */ - public void fatalv(String format, Object... params) { - doLog(Level.FATAL, FQCN, format, params, null); - } - - /** - * Issue a log message with a level of FATAL using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param param1 the sole parameter - */ - public void fatalv(String format, Object param1) { - if (isEnabled(Level.FATAL)) { - doLog(Level.FATAL, FQCN, format, new Object[] { param1 }, null); - } - } - - /** - * Issue a log message with a level of FATAL using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - */ - public void fatalv(String format, Object param1, Object param2) { - if (isEnabled(Level.FATAL)) { - doLog(Level.FATAL, FQCN, format, new Object[] { param1, param2 }, null); - } - } - - /** - * Issue a log message with a level of FATAL using {@link java.text.MessageFormat}-style formatting. - * - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - public void fatalv(String format, Object param1, Object param2, Object param3) { - if (isEnabled(Level.FATAL)) { - doLog(Level.FATAL, FQCN, format, new Object[] { param1, param2, param3 }, null); - } - } - - /** - * Issue a log message with a level of FATAL using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param params the parameters - */ - public void fatalv(Throwable t, String format, Object... params) { - doLog(Level.FATAL, FQCN, format, params, t); - } - - /** - * Issue a log message with a level of FATAL using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param param1 the sole parameter - */ - public void fatalv(Throwable t, String format, Object param1) { - if (isEnabled(Level.FATAL)) { - doLog(Level.FATAL, FQCN, format, new Object[] { param1 }, t); - } - } - - /** - * Issue a log message with a level of FATAL using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - */ - public void fatalv(Throwable t, String format, Object param1, Object param2) { - if (isEnabled(Level.FATAL)) { - doLog(Level.FATAL, FQCN, format, new Object[] { param1, param2 }, t); - } - } - - /** - * Issue a log message with a level of FATAL using {@link java.text.MessageFormat}-style formatting. - * - * @param t the throwable - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - public void fatalv(Throwable t, String format, Object param1, Object param2, Object param3) { - if (isEnabled(Level.FATAL)) { - doLog(Level.FATAL, FQCN, format, new Object[] { param1, param2, param3 }, t); - } - } - - /** - * Issue a formatted log message with a level of FATAL. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param params the parameters - */ - public void fatalf(String format, Object... params) { - doLogf(Level.FATAL, FQCN, format, params, null); - } - - /** - * Issue a formatted log message with a level of FATAL. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the sole parameter - */ - public void fatalf(String format, Object param1) { - if (isEnabled(Level.FATAL)) { - doLogf(Level.FATAL, FQCN, format, new Object[] { param1 }, null); - } - } - - /** - * Issue a formatted log message with a level of FATAL. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the first parameter - * @param param2 the second parameter - */ - public void fatalf(String format, Object param1, Object param2) { - if (isEnabled(Level.FATAL)) { - doLogf(Level.FATAL, FQCN, format, new Object[] { param1, param2 }, null); - } - } - - /** - * Issue a formatted log message with a level of FATAL. - * - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - public void fatalf(String format, Object param1, Object param2, Object param3) { - if (isEnabled(Level.FATAL)) { - doLogf(Level.FATAL, FQCN, format, new Object[] { param1, param2, param3 }, null); - } - } - - /** - * Issue a formatted log message with a level of FATAL. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param params the parameters - */ - public void fatalf(Throwable t, String format, Object... params) { - doLogf(Level.FATAL, FQCN, format, params, t); - } - - /** - * Issue a formatted log message with a level of FATAL. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param param1 the sole parameter - */ - public void fatalf(Throwable t, String format, Object param1) { - if (isEnabled(Level.FATAL)) { - doLogf(Level.FATAL, FQCN, format, new Object[] { param1 }, t); - } - } - - /** - * Issue a formatted log message with a level of FATAL. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param param1 the first parameter - * @param param2 the second parameter - */ - public void fatalf(Throwable t, String format, Object param1, Object param2) { - if (isEnabled(Level.FATAL)) { - doLogf(Level.FATAL, FQCN, format, new Object[] { param1, param2 }, t); - } - } - - /** - * Issue a formatted log message with a level of FATAL. - * - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - public void fatalf(Throwable t, String format, Object param1, Object param2, Object param3) { - if (isEnabled(Level.FATAL)) { - doLogf(Level.FATAL, FQCN, format, new Object[] { param1, param2, param3 }, t); - } - } - - /** - * Log a message at the given level. - * - * @param level the level - * @param message the message - */ - public void log(Level level, Object message) { - doLog(level, FQCN, message, null, null); - } - - /** - * Issue a log message and throwable at the given log level. - * - * @param level the level - * @param message the message - * @param t the throwable - */ - public void log(Level level, Object message, Throwable t) { - doLog(level, FQCN, message, null, t); - } - - /** - * Issue a log message and throwable at the given log level and a specific logger class name. - * - * @param level the level - * @param loggerFqcn the logger class name - * @param message the message - * @param t the throwable - */ - public void log(Level level, String loggerFqcn, Object message, Throwable t) { - doLog(level, loggerFqcn, message, null, t); - } - - /** - * Issue a log message with parameters at the given log level. - * - * @param level the level - * @param message the message - * @param params the message parameters - * @deprecated To log a message with parameters, using {@link #logv(Level, String, Object...)} is recommended. - */ - @Deprecated - public void log(Level level, Object message, Object[] params) { - doLog(level, FQCN, message, params, null); - } - - /** - * Issue a log message with parameters and a throwable at the given log level. - * - * @param level the level - * @param message the message - * @param params the message parameters - * @param t the throwable - * @deprecated To log a message with parameters, using {@link #logv(Level, Throwable, String, Object...)} is recommended. - */ - @Deprecated - public void log(Level level, Object message, Object[] params, Throwable t) { - doLog(level, FQCN, message, params, t); - } - - /** - * Issue a log message with parameters and a throwable at the given log level. - * - * @param loggerFqcn the logger class name - * @param level the level - * @param message the message - * @param params the message parameters - * @param t the throwable - */ - public void log(String loggerFqcn, Level level, Object message, Object[] params, Throwable t) { - doLog(level, loggerFqcn, message, params, t); - } - - /** - * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. - * - * @param level the level - * @param format the message format string - * @param params the parameters - */ - public void logv(Level level, String format, Object... params) { - doLog(level, FQCN, format, params, null); - } - - /** - * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. - * - * @param level the level - * @param format the message format string - * @param param1 the sole parameter - */ - public void logv(Level level, String format, Object param1) { - if (isEnabled(level)) { - doLog(level, FQCN, format, new Object[] { param1 }, null); - } - } - - /** - * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. - * - * @param level the level - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - */ - public void logv(Level level, String format, Object param1, Object param2) { - if (isEnabled(level)) { - doLog(level, FQCN, format, new Object[] { param1, param2 }, null); - } - } - - /** - * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. - * - * @param level the level - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - public void logv(Level level, String format, Object param1, Object param2, Object param3) { - if (isEnabled(level)) { - doLog(level, FQCN, format, new Object[] { param1, param2, param3 }, null); - } - } - - /** - * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. - * - * @param level the level - * @param t the throwable - * @param format the message format string - * @param params the parameters - */ - public void logv(Level level, Throwable t, String format, Object... params) { - doLog(level, FQCN, format, params, t); - } - - /** - * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. - * - * @param level the level - * @param t the throwable - * @param format the message format string - * @param param1 the sole parameter - */ - public void logv(Level level, Throwable t, String format, Object param1) { - if (isEnabled(level)) { - doLog(level, FQCN, format, new Object[] { param1 }, t); - } - } - - /** - * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. - * - * @param level the level - * @param t the throwable - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - */ - public void logv(Level level, Throwable t, String format, Object param1, Object param2) { - if (isEnabled(level)) { - doLog(level, FQCN, format, new Object[] { param1, param2 }, t); - } - } - - /** - * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. - * - * @param level the level - * @param t the throwable - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - public void logv(Level level, Throwable t, String format, Object param1, Object param2, Object param3) { - if (isEnabled(level)) { - doLog(level, FQCN, format, new Object[] { param1, param2, param3 }, t); - } - } - - /** - * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. - * - * @param loggerFqcn the logger class name - * @param level the level - * @param t the throwable - * @param format the message format string - * @param params the parameters - */ - public void logv(String loggerFqcn, Level level, Throwable t, String format, Object... params) { - doLog(level, loggerFqcn, format, params, t); - } - - /** - * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. - * - * @param loggerFqcn the logger class name - * @param level the level - * @param t the throwable - * @param format the message format string - * @param param1 the sole parameter - */ - public void logv(String loggerFqcn, Level level, Throwable t, String format, Object param1) { - if (isEnabled(level)) { - doLog(level, loggerFqcn, format, new Object[] { param1 }, t); - } - } - - /** - * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. - * - * @param loggerFqcn the logger class name - * @param level the level - * @param t the throwable - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - */ - public void logv(String loggerFqcn, Level level, Throwable t, String format, Object param1, Object param2) { - if (isEnabled(level)) { - doLog(level, loggerFqcn, format, new Object[] { param1, param2 }, t); - } - } - - /** - * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. - * - * @param loggerFqcn the logger class name - * @param level the level - * @param t the throwable - * @param format the message format string - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - public void logv(String loggerFqcn, Level level, Throwable t, String format, Object param1, Object param2, Object param3) { - if (isEnabled(level)) { - doLog(level, loggerFqcn, format, new Object[] { param1, param2, param3 }, t); - } - } - - /** - * Issue a formatted log message at the given log level. - * - * @param level the level - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param params the parameters - */ - public void logf(Level level, String format, Object... params) { - doLogf(level, FQCN, format, params, null); - } - - /** - * Issue a formatted log message at the given log level. - * - * @param level the level - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the sole parameter - */ - public void logf(Level level, String format, Object param1) { - if (isEnabled(level)) { - doLogf(level, FQCN, format, new Object[] { param1 }, null); - } - } - - /** - * Issue a formatted log message at the given log level. - * - * @param level the level - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the first parameter - * @param param2 the second parameter - */ - public void logf(Level level, String format, Object param1, Object param2) { - if (isEnabled(level)) { - doLogf(level, FQCN, format, new Object[] { param1, param2 }, null); - } - } - - /** - * Issue a formatted log message at the given log level. - * - * @param level the level - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - public void logf(Level level, String format, Object param1, Object param2, Object param3) { - if (isEnabled(level)) { - doLogf(level, FQCN, format, new Object[] { param1, param2, param3 }, null); - } - } - - /** - * Issue a formatted log message at the given log level. - * - * @param level the level - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param params the parameters - */ - public void logf(Level level, Throwable t, String format, Object... params) { - doLogf(level, FQCN, format, params, t); - } - - /** - * Issue a formatted log message at the given log level. - * - * @param level the level - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param param1 the sole parameter - */ - public void logf(Level level, Throwable t, String format, Object param1) { - if (isEnabled(level)) { - doLogf(level, FQCN, format, new Object[] { param1 }, t); - } - } - - /** - * Issue a formatted log message at the given log level. - * - * @param level the level - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param param1 the first parameter - * @param param2 the second parameter - */ - public void logf(Level level, Throwable t, String format, Object param1, Object param2) { - if (isEnabled(level)) { - doLogf(level, FQCN, format, new Object[] { param1, param2 }, t); - } - } - - /** - * Issue a formatted log message at the given log level. - * - * @param level the level - * @param t the throwable - * @param format the format string, as per {@link String#format(String, Object...)} - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - public void logf(Level level, Throwable t, String format, Object param1, Object param2, Object param3) { - if (isEnabled(level)) { - doLogf(level, FQCN, format, new Object[] { param1, param2, param3 }, t); - } - } - - /** - * Log a message at the given level. - * - * @param loggerFqcn the logger class name - * @param level the level - * @param t the throwable cause - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the sole parameter - */ - public void logf(String loggerFqcn, Level level, Throwable t, String format, Object param1) { - if (isEnabled(level)) { - doLogf(level, loggerFqcn, format, new Object[] { param1 }, t); - } - } - - /** - * Log a message at the given level. - * - * @param loggerFqcn the logger class name - * @param level the level - * @param t the throwable cause - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the first parameter - * @param param2 the second parameter - */ - public void logf(String loggerFqcn, Level level, Throwable t, String format, Object param1, Object param2) { - if (isEnabled(level)) { - doLogf(level, loggerFqcn, format, new Object[] { param1, param2 }, t); - } - } - - /** - * Log a message at the given level. - * - * @param loggerFqcn the logger class name - * @param level the level - * @param t the throwable cause - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param param1 the first parameter - * @param param2 the second parameter - * @param param3 the third parameter - */ - public void logf(String loggerFqcn, Level level, Throwable t, String format, Object param1, Object param2, Object param3) { - if (isEnabled(level)) { - doLogf(level, loggerFqcn, format, new Object[] { param1, param2, param3 }, t); - } - } - - /** - * Log a message at the given level. - * - * @param loggerFqcn the logger class name - * @param level the level - * @param t the throwable cause - * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor - * @param params the message parameters - */ - public void logf(String loggerFqcn, Level level, Throwable t, String format, Object... params) { - doLogf(level, loggerFqcn, format, params, t); - } - - /** - * Read resolver; replaces deserialized instance with a canonical instance. - * - * @return the canonical logger instance - */ - protected final Object writeReplace() { - return new SerializedLogger(name); - } - - /** - * Get a Logger instance given the logger name. - * - * @param name the logger name - * - * @return the logger - */ - public static Logger getLogger(String name) { - return LoggerProviders.PROVIDER.getLogger(name); - } - - /** - * Get a Logger instance given the logger name with the given suffix. - *

- *

This will include a logger separator between logger name and suffix. - * - * @param name the logger name - * @param suffix a suffix to append to the logger name - * - * @return the logger - */ - public static Logger getLogger(String name, String suffix) { - return getLogger(name == null || name.length() == 0 ? suffix : name + "." + suffix); - } - - /** - * Get a Logger instance given the name of a class. This simply calls create(clazz.getName()). - * - * @param clazz the Class whose name will be used as the logger name - * - * @return the logger - */ - public static Logger getLogger(Class clazz) { - return getLogger(clazz.getName()); - } - - /** - * Get a Logger instance given the name of a class with the given suffix. - *

- *

This will include a logger separator between logger name and suffix - * - * @param clazz the Class whose name will be used as the logger name - * @param suffix a suffix to append to the logger name - * - * @return the logger - */ - public static Logger getLogger(Class clazz, String suffix) { - return getLogger(clazz.getName(), suffix); - } - - /** - * Get a typed logger which implements the given interface. The current default locale will be used for the new logger. - * - * @param type the interface to implement - * @param category the logger category - * @param the logger type - * @return the typed logger - */ - public static T getMessageLogger(Class type, String category) { - return getMessageLogger(type, category, Locale.getDefault()); - } - - /** - * Get a typed logger which implements the given interface. The given locale will be used for the new logger. - * - * @param type the interface to implement - * @param category the logger category - * @param locale the locale for the new logger - * @param the logger type - * @return the typed logger - */ - public static T getMessageLogger(final Class type, final String category, final Locale locale) { - return doPrivileged(new PrivilegedAction() { - public T run() { - String language = locale.getLanguage(); - String country = locale.getCountry(); - String variant = locale.getVariant(); - - Class loggerClass = null; - final ClassLoader classLoader = type.getClassLoader(); - final String typeName = type.getName(); - if (variant != null && variant.length() > 0) try { - loggerClass = Class.forName(join(typeName, "$logger", language, country, variant), true, classLoader).asSubclass(type); - } catch (ClassNotFoundException e) { - // ignore - } - if (loggerClass == null && country != null && country.length() > 0) try { - loggerClass = Class.forName(join(typeName, "$logger", language, country, null), true, classLoader).asSubclass(type); - } catch (ClassNotFoundException e) { - // ignore - } - if (loggerClass == null && language != null && language.length() > 0) try { - loggerClass = Class.forName(join(typeName, "$logger", language, null, null), true, classLoader).asSubclass(type); - } catch (ClassNotFoundException e) { - // ignore - } - if (loggerClass == null) try { - loggerClass = Class.forName(join(typeName, "$logger", null, null, null), true, classLoader).asSubclass(type); - } catch (ClassNotFoundException e) { - throw new IllegalArgumentException("Invalid logger " + type + " (implementation not found in " + classLoader + ")"); - } - final Constructor constructor; - try { - constructor = loggerClass.getConstructor(Logger.class); - } catch (NoSuchMethodException e) { - throw new IllegalArgumentException("Logger implementation " + loggerClass + " has no matching constructor"); - } - try { - return constructor.newInstance(Logger.getLogger(category)); - } catch (InstantiationException e) { - throw new IllegalArgumentException("Logger implementation " + loggerClass + " could not be instantiated", e); - } catch (IllegalAccessException e) { - throw new IllegalArgumentException("Logger implementation " + loggerClass + " could not be instantiated", e); - } catch (InvocationTargetException e) { - throw new IllegalArgumentException("Logger implementation " + loggerClass + " could not be instantiated", e.getCause()); - } - } - }); - } - - private static String join(String interfaceName, String a, String b, String c, String d) { - final StringBuilder build = new StringBuilder(); - build.append(interfaceName).append('_').append(a); - if (b != null && b.length() > 0) { - build.append('_'); - build.append(b); - } - if (c != null && c.length() > 0) { - build.append('_'); - build.append(c); - } - if (d != null && d.length() > 0) { - build.append('_'); - build.append(d); - } - return build.toString(); - } -} \ No newline at end of file diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/LoggerProvider.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/LoggerProvider.java deleted file mode 100644 index fa916c93d..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/LoggerProvider.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2010 Red Hat, Inc. - * - * Licensed 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 com.fr.third.org.jboss.logging; - -import java.util.Collections; -import java.util.Map; - -/** - * A contract for the log provider implementation. - */ -public interface LoggerProvider { - /** - * Returns a logger which is backed by a logger from the log provider. - * - *

- * Note: this should never be {@code null} - *

- * - * @param name the name of the logger - * - * @return a logger for the log provider logger. - */ - Logger getLogger(String name); - - /** - * Removes all entries from the message diagnostics context. - */ - void clearMdc(); - - /** - * Puts the value onto the message diagnostics context. - * - * @param key the key for the value - * @param value the value - * - * @return the previous value set or {@code null} if no value was set - */ - Object putMdc(String key, Object value); - - /** - * Returns the value for the key on the message diagnostics context or {@code null} if no value was found. - * - * @param key the key to lookup the value for - * - * @return the value or {@code null} if not found - */ - Object getMdc(String key); - - /** - * Removes the value from the message diagnostics context. - * - * @param key the key of the value to remove - */ - void removeMdc(String key); - - /** - * Returns the map from the context. - * - *

- * Note that in most implementations this is an expensive operation and should be used sparingly. - *

- * - * @return the map from the context or an {@linkplain Collections#emptyMap() empty map} if the context is {@code - * null} - */ - Map getMdcMap(); - - /** - * Clears the nested diagnostics context. - */ - void clearNdc(); - - /** - * Retrieves the current values set for the nested diagnostics context. - * - * @return the current value set or {@code null} if no value was set - */ - String getNdc(); - - /** - * The current depth of the nested diagnostics context. - * - * @return the current depth of the stack - */ - int getNdcDepth(); - - /** - * Pops top value from the stack and returns it. - * - * @return the top value from the stack or an empty string if no value was set - */ - String popNdc(); - - /** - * Peeks at the top value from the stack and returns it. - * - * @return the value or an empty string - */ - String peekNdc(); - - /** - * Pushes a value to the nested diagnostics context stack. - * - * @param message the message to push - */ - void pushNdc(String message); - - /** - * Sets maximum depth of the stack removing any entries below the maximum depth. - * - * @param maxDepth the maximum depth to set - */ - void setNdcMaxDepth(int maxDepth); -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/LoggerProviders.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/LoggerProviders.java deleted file mode 100644 index f19b8285b..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/LoggerProviders.java +++ /dev/null @@ -1,166 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2011 Red Hat, Inc. - * - * Licensed 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 com.fr.third.org.jboss.logging; - -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.util.Iterator; -import java.util.ServiceConfigurationError; -import java.util.ServiceLoader; -import java.util.logging.LogManager; - -final class LoggerProviders { - static final String LOGGING_PROVIDER_KEY = "org.jboss.logging.provider"; - - static final LoggerProvider PROVIDER = find(); - - private static LoggerProvider find() { - return findProvider(); - } - - private static LoggerProvider findProvider() { - // Since the impl classes refer to the back-end frameworks directly, if this classloader can't find the target - // log classes, then it doesn't really matter if they're possibly available from the TCCL because we won't be - // able to find it anyway - final ClassLoader cl = LoggerProviders.class.getClassLoader(); - try { - // Check the system property - final String loggerProvider = AccessController.doPrivileged(new PrivilegedAction() { - public String run() { - return System.getProperty(LOGGING_PROVIDER_KEY); - } - }); - if (loggerProvider != null) { - if ("jboss".equalsIgnoreCase(loggerProvider)) { - return tryJBossLogManager(cl, "system property"); - } else if ("jdk".equalsIgnoreCase(loggerProvider)) { - return tryJDK("system property"); - } else if ("log4j2".equalsIgnoreCase(loggerProvider)) { - return tryLog4j2(cl, "system property"); - } else if ("log4j".equalsIgnoreCase(loggerProvider)) { - return tryLog4j(cl, "system property"); - } else if ("slf4j".equalsIgnoreCase(loggerProvider)) { - return trySlf4j("system property"); - } - } - } catch (Throwable t) { - // nope... - } - - // Next try for a service provider - try { - final ServiceLoader loader = ServiceLoader.load(LoggerProvider.class, cl); - final Iterator iter = loader.iterator(); - for (; ; ) - try { - if (!iter.hasNext()) break; - LoggerProvider provider = iter.next(); - // Attempt to get a logger, if it fails keep trying - logProvider(provider, "service loader"); - return provider; - } catch (ServiceConfigurationError ignore) { - } - } catch (Throwable ignore) { - // TODO consider printing the stack trace as it should only happen once - } - - // Finally search the class path - try { - return tryJBossLogManager(cl, null); - } catch (Throwable t) { - // nope... - } - try { - // MUST try Log4j 2.x BEFORE Log4j 1.x because Log4j 2.x also passes Log4j 1.x test in some circumstances - return tryLog4j2(cl, null); - } catch (Throwable t) { - // nope... - } - try { - return tryLog4j(cl, null); - } catch (Throwable t) { - // nope... - } - try { - // only use slf4j if Logback is in use - Class.forName("ch.qos.logback.classic.Logger", false, cl); - return trySlf4j(null); - } catch (Throwable t) { - // nope... - } - return tryJDK(null); - } - - private static JDKLoggerProvider tryJDK(final String via) { - final JDKLoggerProvider provider = new JDKLoggerProvider(); - logProvider(provider, via); - return provider; - } - - private static LoggerProvider trySlf4j(final String via) { - final LoggerProvider provider = new Slf4jLoggerProvider(); - logProvider(provider, via); - return provider; - } - - // JBLOGGING-95 - Add support for Log4j 2.x - private static LoggerProvider tryLog4j2(final ClassLoader cl, final String via) throws ClassNotFoundException { - Class.forName("com.fr.third.apache.logging.log4j.Logger", true, cl); - Class.forName("com.fr.third.apache.logging.log4j.LogManager", true, cl); - Class.forName("com.fr.third.apache.logging.log4j.spi.AbstractLogger", true, cl); - LoggerProvider provider = new Log4j2LoggerProvider(); - // if Log4j 2 has a bad implementation that doesn't extend AbstractLogger, we won't know until getting the first logger throws an exception - logProvider(provider, via); - return provider; - } - - private static LoggerProvider tryLog4j(final ClassLoader cl, final String via) throws ClassNotFoundException { - Class.forName("org.apache.log4j.LogManager", true, cl); - // JBLOGGING-65 - slf4j can disguise itself as log4j. Test for a class that slf4j doesn't provide. - // JBLOGGING-94 - JBoss Logging does not detect org.apache.logging.log4j:log4j-1.2-api:2.0 - Class.forName("org.apache.log4j.config.PropertySetter", true, cl); - final LoggerProvider provider = new Log4jLoggerProvider(); - logProvider(provider, via); - return provider; - } - - private static LoggerProvider tryJBossLogManager(final ClassLoader cl, final String via) throws ClassNotFoundException { - final Class logManagerClass = LogManager.getLogManager().getClass(); - if (logManagerClass == Class.forName("org.jboss.logmanager.LogManager", false, cl) - && Class.forName("org.jboss.logmanager.Logger$AttachmentKey", true, cl).getClassLoader() == logManagerClass.getClassLoader()) { - final LoggerProvider provider = new JBossLogManagerProvider(); - logProvider(provider, via); - return provider; - } - throw new IllegalStateException(); - } - - private static void logProvider(final LoggerProvider provider, final String via) { - // Log a debug message indicating which logger we are using - final Logger logger = provider.getLogger(LoggerProviders.class.getPackage().getName()); - if (via == null) { - logger.debugf("Logging Provider: %s", provider.getClass().getName()); - } else { - logger.debugf("Logging Provider: %s found via %s", provider.getClass().getName(), via); - } - } - - private LoggerProviders() { - } -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/LoggingClass.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/LoggingClass.java deleted file mode 100644 index ad052b50a..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/LoggingClass.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2010 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed 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 com.fr.third.org.jboss.logging; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.CLASS; - -/** - * Mark a parameter as specifying the name of the logging class to use. The parameter - * may have a type of {@link String} or {@link Class}. - * - * @deprecated Use com.fr.third.org.jboss.logging.annotations.LoggingClass provided in module org.jboss.logging:jboss-logging-annotations - * - * @author David M. Lloyd - */ -@Retention(CLASS) -@Target(PARAMETER) -@Documented -@Deprecated -public @interface LoggingClass { -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/MDC.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/MDC.java deleted file mode 100644 index 808c9ee00..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/MDC.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2010 Red Hat, Inc. - * - * Licensed 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 com.fr.third.org.jboss.logging; - -import java.util.Collections; -import java.util.Map; - -/** - * Mapped diagnostic context. Each log provider implementation may behave different. - */ -public final class MDC { - - private MDC() { - } - - /** - * Puts the value onto the context. - * - * @param key the key for the value - * @param val the value - * - * @return the previous value set or {@code null} if no value was set - */ - public static Object put(String key, Object val) { - return LoggerProviders.PROVIDER.putMdc(key, val); - } - - /** - * Returns the value for the key or {@code null} if no value was found. - * - * @param key the key to lookup the value for - * - * @return the value or {@code null} if not found - */ - public static Object get(String key) { - return LoggerProviders.PROVIDER.getMdc(key); - } - - /** - * Removes the value from the context. - * - * @param key the key of the value to remove - */ - public static void remove(String key) { - LoggerProviders.PROVIDER.removeMdc(key); - } - - /** - * Returns the map from the context. - * - *

- * Note that in most implementations this is an expensive operation and should be used sparingly. - *

- * - * @return the map from the context or an {@linkplain Collections#emptyMap() empty map} if the context is {@code - * null} - */ - public static Map getMap() { - return LoggerProviders.PROVIDER.getMdcMap(); - } - - /** - * Clears the message diagnostics context. - */ - public static void clear() { - LoggerProviders.PROVIDER.clearMdc(); - } -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/Message.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/Message.java deleted file mode 100644 index 8296caed8..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/Message.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2010 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed 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 com.fr.third.org.jboss.logging; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.RetentionPolicy.CLASS; - -/** - * Assigns a message string to a resource method. The method arguments are used to supply the positional parameter - * values for the method. - * - * @deprecated Use com.fr.third.org.jboss.logging.annotations.Message provided in module org.jboss.logging:jboss-logging-annotations - * - * @author David M. Lloyd - */ -@Target(METHOD) -@Retention(CLASS) -@Documented -@Deprecated -public @interface Message { - - /** - * Indicates that this message has no ID. - */ - int NONE = 0; - /** - * Indicates that this message should inherit the ID from another message with the same name. - */ - int INHERIT = -1; - - /** - * The message ID number. Only one message with a given name may specify an ID other than {@link #INHERIT}. - * - * @return the message ID number - */ - int id() default INHERIT; - - /** - * The default format string of this message. - * - * @return the format string - */ - String value(); - - /** - * The format type of this method (defaults to {@link Format#PRINTF}). - * - * @return the format type - */ - Format format() default Format.PRINTF; - - /** - * The possible format types. - */ - enum Format { - - /** - * A {@link java.util.Formatter}-type format string. - */ - PRINTF, - /** - * A {@link java.text.MessageFormat}-type format string. - */ - MESSAGE_FORMAT, - - /** - * Indicates the message should not be formatted. - */ - NO_FORMAT, - } - -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/MessageBundle.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/MessageBundle.java deleted file mode 100644 index f1e88b51a..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/MessageBundle.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2010 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed 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 com.fr.third.org.jboss.logging; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.CLASS; - -/** - * Signify that an interface is a message bundle interface. - * - * @deprecated Use com.fr.third.org.jboss.logging.annotations.MessageBundle provided in module org.jboss.logging:jboss-logging-annotations - * - * @author David M. Lloyd - */ -@Target(TYPE) -@Retention(CLASS) -@Documented -@Deprecated -public @interface MessageBundle { - - /** - * Get the project code for messages that have an associated code. If no project code is associated - * with this bundle, specify {@code ""} (the empty string). - * - * @return the project code - */ - String projectCode(); -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/MessageLogger.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/MessageLogger.java deleted file mode 100644 index 47f176099..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/MessageLogger.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2010 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed 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 com.fr.third.org.jboss.logging; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.CLASS; - -/** - * Signify that an interface is a typed logger interface. A message logger interface may optionally extend other message logger - * interfaces and message bundle interfaces (see {@link MessageBundle}, as well as the {@link BasicLogger} interface. - * - * @deprecated Use com.fr.third.org.jboss.logging.annotations.MessageLogger provided in module org.jboss.logging:jboss-logging-annotations - * - * @author David M. Lloyd - */ -@Retention(CLASS) -@Target(TYPE) -@Documented -@Deprecated -public @interface MessageLogger { - - /** - * Get the project code for messages that have an associated code. If no project code is associated - * with this logger, specify {@code ""} (the empty string). - * - * @return the project code - */ - String projectCode(); -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/Messages.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/Messages.java deleted file mode 100644 index 531255e7b..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/Messages.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2010 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed 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 com.fr.third.org.jboss.logging; - -import java.lang.reflect.Field; -import java.security.PrivilegedAction; -import java.util.Locale; - -import static java.security.AccessController.doPrivileged; - -/** - * A factory class to produce message bundle implementations. - * - * @author David M. Lloyd - */ -public final class Messages { - - private Messages() { - } - - /** - * Get a message bundle of the given type. Equivalent to {@link #getBundle(Class, java.util.Locale) getBundle}(type, Locale.getDefault()). - * - * @param type the bundle type class - * @param the bundle type - * @return the bundle - */ - public static T getBundle(Class type) { - return getBundle(type, Locale.getDefault()); - } - - /** - * Get a message bundle of the given type. - * - * @param type the bundle type class - * @param locale the message locale to use - * @param the bundle type - * @return the bundle - */ - public static T getBundle(final Class type, final Locale locale) { - return doPrivileged(new PrivilegedAction() { - public T run() { - String language = locale.getLanguage(); - String country = locale.getCountry(); - String variant = locale.getVariant(); - - Class bundleClass = null; - if (variant != null && variant.length() > 0) try { - bundleClass = Class.forName(join(type.getName(), "$bundle", language, country, variant), true, type.getClassLoader()).asSubclass(type); - } catch (ClassNotFoundException e) { - // ignore - } - if (bundleClass == null && country != null && country.length() > 0) try { - bundleClass = Class.forName(join(type.getName(), "$bundle", language, country, null), true, type.getClassLoader()).asSubclass(type); - } catch (ClassNotFoundException e) { - // ignore - } - if (bundleClass == null && language != null && language.length() > 0) try { - bundleClass = Class.forName(join(type.getName(), "$bundle", language, null, null), true, type.getClassLoader()).asSubclass(type); - } catch (ClassNotFoundException e) { - // ignore - } - if (bundleClass == null) try { - bundleClass = Class.forName(join(type.getName(), "$bundle", null, null, null), true, type.getClassLoader()).asSubclass(type); - } catch (ClassNotFoundException e) { - throw new IllegalArgumentException("Invalid bundle " + type + " (implementation not found)"); - } - final Field field; - try { - field = bundleClass.getField("INSTANCE"); - } catch (NoSuchFieldException e) { - throw new IllegalArgumentException("Bundle implementation " + bundleClass + " has no instance field"); - } - try { - return type.cast(field.get(null)); - } catch (IllegalAccessException e) { - throw new IllegalArgumentException("Bundle implementation " + bundleClass + " could not be instantiated", e); - } - } - }); - } - - private static String join(String interfaceName, String a, String b, String c, String d) { - final StringBuilder build = new StringBuilder(); - build.append(interfaceName).append('_').append(a); - if (b != null && b.length() > 0) { - build.append('_'); - build.append(b); - } - if (c != null && c.length() > 0) { - build.append('_'); - build.append(c); - } - if (d != null && d.length() > 0) { - build.append('_'); - build.append(d); - } - return build.toString(); - } -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/NDC.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/NDC.java deleted file mode 100644 index 4aed9e4dc..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/NDC.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2010 Red Hat, Inc. - * - * Licensed 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 com.fr.third.org.jboss.logging; - -public final class NDC { - - private NDC() { - } - - /** - * Clears the nested diagnostics context. - */ - public static void clear() { - LoggerProviders.PROVIDER.clearNdc(); - } - - /** - * Retrieves the current values set for the nested diagnostics context. - * - * @return the current value set or {@code null} if no value was set - */ - public static String get() { - return LoggerProviders.PROVIDER.getNdc(); - } - - /** - * The current depth of the nested diagnostics context. - * - * @return the current depth of the stack - */ - public static int getDepth() { - return LoggerProviders.PROVIDER.getNdcDepth(); - } - - /** - * Pops top value from the stack and returns it. - * - * @return the top value from the stack or an empty string if no value was set - */ - public static String pop() { - return LoggerProviders.PROVIDER.popNdc(); - } - - /** - * Peeks at the top value from the stack and returns it. - * - * @return the value or an empty string - */ - public static String peek() { - return LoggerProviders.PROVIDER.peekNdc(); - } - - /** - * Pushes a value to the nested diagnostics context stack. - * - * @param message the message to push - */ - public static void push(String message) { - LoggerProviders.PROVIDER.pushNdc(message); - } - - /** - * Sets maximum depth of the stack removing any entries below the maximum depth. - * - * @param maxDepth the maximum depth to set - */ - public static void setMaxDepth(int maxDepth) { - LoggerProviders.PROVIDER.setNdcMaxDepth(maxDepth); - } -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/Param.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/Param.java deleted file mode 100644 index 672ef5119..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/Param.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2011 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed 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 com.fr.third.org.jboss.logging; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.CLASS; - -/** - * Identifies a parameter is to be used for constructing an exception and excluded from the formatting of the message. - *

- * Parameters will be order-matched first, then type-matched to resolve ambiguity. If a match fails an error should - * occur. - *

- * The {@link #value()} option will allow an optional class to be specified which will have to match the exact type of - * the parameter in question, to enable unambiguous resolution. The value must be the fully qualified class name. - * - * @deprecated Use com.fr.third.org.jboss.logging.annotations.Param provided in module org.jboss.logging:jboss-logging-annotations - * - * @author James R. Perkins - */ -@Target(PARAMETER) -@Retention(CLASS) -@Documented -@Deprecated -public @interface Param { - - /** - * Defines an exact class the parameter must match for unambiguous resolution. - * - * @return the class the parameter must match. - */ - Class value() default Object.class; -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/ParameterConverter.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/ParameterConverter.java deleted file mode 100644 index 312f501c9..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/ParameterConverter.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2010 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed 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 com.fr.third.org.jboss.logging; - -import java.util.Locale; - -/** - * A converter for a specific parameter type. - * - * @author David M. Lloyd - * @param the input type - */ -public interface ParameterConverter { - - /** - * Convert the parameter to its string or string-equivalent representation. The returned value will be passed in - * as a parameter to either a {@link java.text.MessageFormat} or {@link java.util.Formatter} instance, depending - * on the setting of {@link Message#format()}. - * - * @param locale the locale - * @param parameter the parameter - * @return the converted value - */ - Object convert(Locale locale, I parameter); -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/Property.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/Property.java deleted file mode 100644 index 97bc8bf25..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/Property.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2011 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed 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 com.fr.third.org.jboss.logging; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.CLASS; - -/** - * Indicate that a method parameter value should be applied to a property (with a setter method) on the resultant exception object. - * - * @deprecated Use com.fr.third.org.jboss.logging.annotations.Property provided in module org.jboss.logging:jboss-logging-annotations - * - * @author David M. Lloyd - */ -@Retention(CLASS) -@Target(PARAMETER) -@Documented -@Deprecated -public @interface Property { - - /** - * The property name. If not specified, the parameter name is assumed to be the property name. - * - * @return the property name - */ - String name() default ""; -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/SerializedLogger.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/SerializedLogger.java deleted file mode 100644 index b861a377e..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/SerializedLogger.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2010 Red Hat, Inc. - * - * Licensed 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 com.fr.third.org.jboss.logging; - -import java.io.Serializable; - -final class SerializedLogger implements Serializable { - - private static final long serialVersionUID = 508779982439435831L; - - private final String name; - - SerializedLogger(final String name) { - this.name = name; - } - - protected Object readResolve() { - return Logger.getLogger(name); - } -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/Slf4jLocationAwareLogger.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/Slf4jLocationAwareLogger.java deleted file mode 100644 index 023475745..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/Slf4jLocationAwareLogger.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2010 Red Hat, Inc. - * - * Licensed 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 com.fr.third.org.jboss.logging; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.lang.reflect.UndeclaredThrowableException; -import java.text.MessageFormat; -import com.fr.third.slf4j.spi.LocationAwareLogger; - -final class Slf4jLocationAwareLogger extends Logger { - - private static final long serialVersionUID = 8685757928087758380L; - - private static final Object[] EMPTY = new Object[0]; - private static final boolean POST_1_6; - private static final Method LOG_METHOD; - - static { - Method[] methods = LocationAwareLogger.class.getDeclaredMethods(); - Method logMethod = null; - boolean post16 = false; - for (Method method : methods) { - if (method.getName().equals("log")) { - logMethod = method; - Class[] parameterTypes = method.getParameterTypes(); - post16 = parameterTypes.length == 6; - } - } - if (logMethod == null) { - throw new NoSuchMethodError("Cannot find LocationAwareLogger.log() method"); - } - POST_1_6 = post16; - LOG_METHOD = logMethod; - } - - private final LocationAwareLogger logger; - - Slf4jLocationAwareLogger(final String name, final LocationAwareLogger logger) { - super(name); - this.logger = logger; - } - - public boolean isEnabled(final Level level) { - if (level != null) switch (level) { - case FATAL: return logger.isErrorEnabled(); - case ERROR: return logger.isErrorEnabled(); - case WARN: return logger.isWarnEnabled(); - case INFO: return logger.isInfoEnabled(); - case DEBUG: return logger.isDebugEnabled(); - case TRACE: return logger.isTraceEnabled(); - } - return true; - } - - protected void doLog(final Level level, final String loggerClassName, final Object message, final Object[] parameters, final Throwable thrown) { - if (isEnabled(level)) { - final String text = parameters == null || parameters.length == 0 ? String.valueOf(message) : MessageFormat.format(String.valueOf(message), parameters); - doLog(logger, loggerClassName, translate(level), text, thrown); - } - } - - protected void doLogf(final Level level, final String loggerClassName, final String format, final Object[] parameters, final Throwable thrown) { - if (isEnabled(level)) { - final String text = parameters == null ? String.format(format) : String.format(format, parameters); - doLog(logger, loggerClassName, translate(level), text, thrown); - } - } - - private static void doLog(LocationAwareLogger logger, String className, int level, String text, Throwable thrown) { - try { - if (POST_1_6) { - LOG_METHOD.invoke(logger, null, className, Integer.valueOf(level), text, EMPTY, thrown); - } else { - LOG_METHOD.invoke(logger, null, className, Integer.valueOf(level), text, thrown); - } - } catch (InvocationTargetException e) { - try { - throw e.getCause(); - } catch (RuntimeException ex) { - throw ex; - } catch (Error er) { - throw er; - } catch (Throwable throwable) { - throw new UndeclaredThrowableException(throwable); - } - } catch (IllegalAccessException e) { - throw new IllegalAccessError(e.getMessage()); - } - } - - private static int translate(Level level) { - if (level != null) switch (level) { - case FATAL: - case ERROR: return LocationAwareLogger.ERROR_INT; - case WARN: return LocationAwareLogger.WARN_INT; - case INFO: return LocationAwareLogger.INFO_INT; - case DEBUG: return LocationAwareLogger.DEBUG_INT; - case TRACE: return LocationAwareLogger.TRACE_INT; - } - return LocationAwareLogger.TRACE_INT; - } -} \ No newline at end of file diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/Slf4jLogger.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/Slf4jLogger.java deleted file mode 100644 index c1d4a0bc0..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/Slf4jLogger.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2010 Red Hat, Inc. - * - * Licensed 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 com.fr.third.org.jboss.logging; - -import java.text.MessageFormat; - -final class Slf4jLogger extends Logger { - - private static final long serialVersionUID = 8685757928087758380L; - - private final com.fr.third.slf4j.Logger logger; - - Slf4jLogger(final String name, final com.fr.third.slf4j.Logger logger) { - super(name); - this.logger = logger; - } - - public boolean isEnabled(final Level level) { - if (level != null) switch (level) { - case FATAL: return logger.isErrorEnabled(); - case ERROR: return logger.isErrorEnabled(); - case WARN: return logger.isWarnEnabled(); - case INFO: return logger.isInfoEnabled(); - case DEBUG: return logger.isDebugEnabled(); - case TRACE: return logger.isTraceEnabled(); - } - return true; - } - - protected void doLog(final Level level, final String loggerClassName, final Object message, final Object[] parameters, final Throwable thrown) { - if (isEnabled(level)) try { - final String text = parameters == null || parameters.length == 0 ? String.valueOf(message) : MessageFormat.format(String.valueOf(message), parameters); - switch (level) { - case FATAL: - case ERROR: - logger.error(text, thrown); - return; - case WARN: - logger.warn(text, thrown); - return; - case INFO: - logger.info(text, thrown); - return; - case DEBUG: - logger.debug(text, thrown); - return; - case TRACE: - logger.trace(text, thrown); - return; - } - } catch (Throwable ignored) {} - } - - protected void doLogf(final Level level, final String loggerClassName, final String format, final Object[] parameters, final Throwable thrown) { - if (isEnabled(level)) try { - final String text = parameters == null ? String.format(format) : String.format(format, parameters); - switch (level) { - case FATAL: - case ERROR: - logger.error(text, thrown); - return; - case WARN: - logger.warn(text, thrown); - return; - case INFO: - logger.info(text, thrown); - return; - case DEBUG: - logger.debug(text, thrown); - return; - case TRACE: - logger.trace(text, thrown); - return; - } - } catch (Throwable ignored) {} - } -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/Slf4jLoggerProvider.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/Slf4jLoggerProvider.java deleted file mode 100644 index 41cffa7f0..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/Slf4jLoggerProvider.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2010 Red Hat, Inc. - * - * Licensed 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 com.fr.third.org.jboss.logging; - -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; - -import com.fr.third.slf4j.LoggerFactory; -import com.fr.third.slf4j.MDC; -import com.fr.third.slf4j.spi.LocationAwareLogger; - -final class Slf4jLoggerProvider extends AbstractLoggerProvider implements LoggerProvider { - - public Logger getLogger(final String name) { - com.fr.third.slf4j.Logger l = LoggerFactory.getLogger(name); - try { - return new Slf4jLocationAwareLogger(name, (LocationAwareLogger) l); - } catch (Throwable ignored) { - } - return new Slf4jLogger(name, l); - } - - public void clearMdc() { - MDC.clear(); - } - - public Object putMdc(final String key, final Object value) { - try { - return MDC.get(key); - } finally { - if (value == null) { - MDC.remove(key); - } else { - MDC.put(key, String.valueOf(value)); - } - } - } - - public Object getMdc(final String key) { - return MDC.get(key); - } - - public void removeMdc(final String key) { - MDC.remove(key); - } - - public Map getMdcMap() { - @SuppressWarnings({"unchecked"}) - final Map map = /*MDC.getCopyOfContextMap();*/new HashMap<>(); - return map == null ? Collections.emptyMap() : map; - } -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/Cause.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/Cause.java deleted file mode 100644 index 94801eaa4..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/Cause.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2015 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed 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 com.fr.third.org.jboss.logging.annotations; - -import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.CLASS; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -/** - * Mark a parameter as being the "exception cause" parameter rather than a positional format parameter. - * - * @author David M. Lloyd - */ -@Retention(CLASS) -@Target(PARAMETER) -@Documented -public @interface Cause { -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/ConstructType.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/ConstructType.java deleted file mode 100644 index 7ff50c1ee..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/ConstructType.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2015 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed 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 com.fr.third.org.jboss.logging.annotations; - -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.RetentionPolicy.CLASS; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -/** - * Indicates the value of this annotation should be constructed and returned. This does not change the return type of - * the method. - *

- * This annotation is only allowed on bundle messages that have a throwable return type. The value must be assignable - * to the return type. - *

- * - * @author James R. Perkins - * @since 2.0.0 - */ -@Retention(CLASS) -@Target(METHOD) -@Documented -public @interface ConstructType { - - /** - * The actual type that should be constructed for the return type. - * - * @return the class to construct - */ - Class value(); -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/Field.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/Field.java deleted file mode 100644 index b836e6cf7..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/Field.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2015 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed 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 com.fr.third.org.jboss.logging.annotations; - -import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.CLASS; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -/** - * Indicate that a method parameter value should be applied to a field on the resultant exception object. - * - * @author David M. Lloyd - */ -@Retention(CLASS) -@Target(PARAMETER) -@Documented -public @interface Field { - - /** - * The field name. If not specified, the parameter name is assumed to be the field name. - * - * @return the field name - */ - String name() default ""; -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/FormatWith.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/FormatWith.java deleted file mode 100644 index 5381761f6..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/FormatWith.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2015 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed 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 com.fr.third.org.jboss.logging.annotations; - -import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.CLASS; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -/** - * Indicate that the given parameter should be wrapped with a formatting object of the given class. The class - * must have a one-argument constructor which unambiguously accepts a value of this parameter's type. The resultant - * object will be passed in as a parameter to the underlying format type; thus its {@link Object#toString() toString()} - * method will be invoked (or, if the format style is {@link Message.Format#PRINTF PRINTF}, the object may implement - * {@link java.util.Formattable Formattable} to get extra functionality). - * - * @author David M. Lloyd - */ -@Target(PARAMETER) -@Retention(CLASS) -@Documented -public @interface FormatWith { - - /** - * The class of the formatting object to use. - * - * @return the class - */ - Class value(); -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/LogMessage.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/LogMessage.java deleted file mode 100644 index e49f5057a..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/LogMessage.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2015 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed 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 com.fr.third.org.jboss.logging.annotations; - -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.RetentionPolicy.CLASS; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import com.fr.third.org.jboss.logging.Logger; - -/** - * A typed logger method. Indicates that this method will log the associated {@link Message} to the logger system, as - * opposed to being a simple message lookup. - * - * @author David M. Lloyd - */ -@Retention(CLASS) -@Target(METHOD) -@Documented -public @interface LogMessage { - - /** - * The log level at which this message should be logged. Defaults to {@code INFO}. - * - * @return the log level - */ - Logger.Level level() default Logger.Level.INFO; - - /** - * The logging class name to use for this message, if any. - * - * @return the logging class name - */ - Class loggingClass() default Void.class; -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/LoggingClass.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/LoggingClass.java deleted file mode 100644 index 504792e9f..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/LoggingClass.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2015 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed 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 com.fr.third.org.jboss.logging.annotations; - -import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.CLASS; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -/** - * Mark a parameter as specifying the name of the logging class to use. The parameter - * may have a type of {@link Class}. - * - * @author David M. Lloyd - */ -@Retention(CLASS) -@Target(PARAMETER) -@Documented -public @interface LoggingClass { -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/Message.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/Message.java deleted file mode 100644 index a2155c9af..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/Message.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2015 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed 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 com.fr.third.org.jboss.logging.annotations; - -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.RetentionPolicy.CLASS; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -/** - * Assigns a message string to a resource method. The method arguments are used to supply the positional parameter - * values for the method. - * - * @author David M. Lloyd - */ -@Target(METHOD) -@Retention(CLASS) -@Documented -public @interface Message { - - /** - * Indicates that this message has no ID. - */ - int NONE = 0; - /** - * Indicates that this message should inherit the ID from another message with the same name. - */ - int INHERIT = -1; - - /** - * The message ID number. Only one message with a given name may specify an ID other than {@link #INHERIT}. - * - * @return the message ID number - */ - int id() default INHERIT; - - /** - * The default format string of this message. - * - * @return the format string - */ - String value(); - - /** - * The format type of this method (defaults to {@link Format#PRINTF}). - * - * @return the format type - */ - Format format() default Format.PRINTF; - - /** - * The possible format types. - */ - enum Format { - - /** - * A {@link java.util.Formatter}-type format string. - */ - PRINTF, - /** - * A {@link java.text.MessageFormat}-type format string. - */ - MESSAGE_FORMAT, - - /** - * Indicates the message should not be formatted. - */ - NO_FORMAT, - } - -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/MessageBundle.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/MessageBundle.java deleted file mode 100644 index 0575b4a59..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/MessageBundle.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2015 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed 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 com.fr.third.org.jboss.logging.annotations; - -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.CLASS; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -/** - * Signify that an interface is a message bundle interface. - * - * @author David M. Lloyd - */ -@Target(TYPE) -@Retention(CLASS) -@Documented -public @interface MessageBundle { - - /** - * Get the project code for messages that have an associated code. If no project code is associated - * with this bundle, specify {@code ""} (the empty string). - * - * @return the project code - */ - String projectCode(); - - /** - * The length of the padding used for each id in the message bundle. For example given the default padding length - * of 6 and a message with an id of 100 would result would be {@code "000100"}. - *

- * Valid values a range of 3 to 8. Any value less than 0 turns off padding. Any other value will result in an error - * being produced. - * - * @return the length the id should be padded - */ - int length() default 6; -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/MessageLogger.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/MessageLogger.java deleted file mode 100644 index edc31d296..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/MessageLogger.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2015 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed 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 com.fr.third.org.jboss.logging.annotations; - -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.CLASS; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -/** - * Signify that an interface is a typed logger interface. A message logger interface may optionally extend other - * message logger interfaces and message bundle interfaces (see {@link com.fr.third.org.jboss.logging.annotations.MessageBundle}, as - * well as the {@link org.jboss.logging.BasicLogger} interface. - * - * @author David M. Lloyd - */ -@Retention(CLASS) -@Target(TYPE) -@Documented -public @interface MessageLogger { - - /** - * Get the project code for messages that have an associated code. If no project code is associated - * with this logger, specify {@code ""} (the empty string). - * - * @return the project code - */ - String projectCode(); - - /** - * The length of the padding used for each id in the message bundle. For example given the default padding length - * of 6 and a message with an id of 100 would result would be {@code "000100"}. - *

- * Valid values a range of 3 to 8. Any value less than 0 turns off padding. Any other value will result in an error - * being produced. - * - * @return the length the id should be padded - */ - int length() default 6; -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/Once.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/Once.java deleted file mode 100644 index 8afbf4266..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/Once.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2015 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed 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 com.fr.third.org.jboss.logging.annotations; - -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.RetentionPolicy.CLASS; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -/** - * Indicates a message should only be logged once. - *

- * Methods that use this annotation must be {@linkplain com.fr.third.org.jboss.logging.annotations.LogMessage logger methods}. Overloaded - * methods also annotated with {@code @Once} will inherit the same check only logging the message from the first - * overloaded method invoked. - *

- * - * @author James R. Perkins - */ -@Target(METHOD) -@Retention(CLASS) -@Documented -public @interface Once { -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/Param.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/Param.java deleted file mode 100644 index 1e4ff861f..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/Param.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2015 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed 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 com.fr.third.org.jboss.logging.annotations; - -import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.CLASS; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -/** - * Identifies a parameter is to be used for constructing an exception and excluded from the formatting of the message. - *

- * Parameters will be order-matched first, then type-matched to resolve ambiguity. If a match fails an error should - * occur. - *

- * The {@link #value()} option will allow an optional class to be specified which will have to match the exact type of - * the parameter in question, to enable unambiguous resolution. The value must be the fully qualified class name. - * - * @author James R. Perkins - */ -@Target(PARAMETER) -@Retention(CLASS) -@Documented -public @interface Param { - - /** - * Defines an exact class the parameter must match for unambiguous resolution. - * - * @return the class the parameter must match. - */ - Class value() default Object.class; -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/Pos.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/Pos.java deleted file mode 100644 index 59edfec96..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/Pos.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2015 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed 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 com.fr.third.org.jboss.logging.annotations; - -import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.CLASS; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -/** - * @author James R. Perkins - * @since 1.1.0 - */ -@Retention(CLASS) -@Target(PARAMETER) -@Documented -public @interface Pos { - - /** - * The positions the value should be used at. - * - * @return an array of the positions for the parameter - */ - int[] value(); - - /** - * The transform types used on the parameter. - * - * @return an array of the transformer types - * - * @see Transform - */ - Transform[] transform() default {}; -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/Property.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/Property.java deleted file mode 100644 index 881d78792..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/Property.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2015 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed 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 com.fr.third.org.jboss.logging.annotations; - -import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.CLASS; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -/** - * Indicate that a method parameter value should be applied to a property (with a setter method) on the resultant exception object. - * - * @author David M. Lloyd - */ -@Retention(CLASS) -@Target(PARAMETER) -@Documented -public @interface Property { - - /** - * The property name. If not specified, the parameter name is assumed to be the property name. - * - * @return the property name - */ - String name() default ""; -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/Transform.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/Transform.java deleted file mode 100644 index a37c8b62e..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/Transform.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2015 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed 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 com.fr.third.org.jboss.logging.annotations; - -import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.CLASS; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -/** - * Indicate the given parameter should be transformed in each of the {@link com.fr.third.org.jboss.logging.annotations.Transform.TransformType transform types} - * provided. The parameter cannot be a primitive type. - *

- * For the {@link TransformType#SIZE} type, the object must be a {@link String}, a {@link java.util.Collection}, a - * {@link java.util.Map} or an array. - *

- * The type {@link TransformType#GET_CLASS} can be used with {@link TransformType#HASH_CODE} or {@link - * TransformType#IDENTITY_HASH_CODE}. The type {@link TransformType#SIZE} must be used on it's own. - * - * @author James R. Perkins - * @since 1.1.0 - */ -@Retention(CLASS) -@Target(PARAMETER) -@Documented -public @interface Transform { - - /** - * The transform type - */ - public enum TransformType { - /** - * Gets the class of the object object passed, {@link Object#getClass()}. - */ - GET_CLASS, - /** - * Gets the hash code of the object, {@link Object#hashCode()}. - */ - HASH_CODE, - /** - * Gets the identity hash code of the object, {@link System#identityHashCode(Object)}. - */ - IDENTITY_HASH_CODE, - /** - * Gets the size or length of a {@link String}, {@link java.util.Collection}, {@link java.util.Map} or array. - */ - SIZE, - } - - /** - * The transform types used on the parameter. - *

- * Valid combinations: - *

    - *
  • {@link TransformType#GET_CLASS}
  • - *
  • {@link TransformType#GET_CLASS}, {@link TransformType#HASH_CODE}
  • - *
  • {@link TransformType#GET_CLASS}, {@link TransformType#IDENTITY_HASH_CODE}
  • - *
  • {@link TransformType#HASH_CODE}
  • - *
  • {@link TransformType#IDENTITY_HASH_CODE}
  • - *
  • {@link TransformType#SIZE}
  • - *
- * - * @return an array of the transform types - */ - TransformType[] value(); -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/ValidIdRange.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/ValidIdRange.java deleted file mode 100644 index 42ff2b5b0..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/ValidIdRange.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2015 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed 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 com.fr.third.org.jboss.logging.annotations; - -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.CLASS; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -/** - * Sets a range of valid id's allowed on the {@link com.fr.third.org.jboss.logging.annotations.Message#id() message id}. Both {@link - * Message#INHERIT} and {@link Message#NONE} are ignored when validating. - *

- * Note: Message id's from inherited interfaces are not validated within the range provided. Super interfaces - * would need their own annotation for range validation. - *

- * - *

- *          @MessageLogger(projectCode = "EXAMPLE")
- *          @ValidIdRange(min = 100, max = 200)
- *          public interface ExampleLogger {
- *
- *              @LogMessage
- *              @Message(id = 100, value = "Example message")
- *              void example();
- *          }
- * 
- * - * - * @author James R. Perkins - */ -@Target(TYPE) -@Retention(CLASS) -@Documented -public @interface ValidIdRange { - - /** - * The minimum id allowed in the {@link com.fr.third.org.jboss.logging.annotations.Message#id() message id}. Both {@link - * Message#INHERIT} and {@link Message#NONE} are ignored when validating. - * - * @return the minimum id allowed - */ - int min() default 1; - - /** - * The maximum id allowed in the {@link com.fr.third.org.jboss.logging.annotations.Message#id() message id}. Both {@link - * Message#INHERIT} and {@link Message#NONE} are ignored when validating. - * - * @return the maximum id allowed - */ - int max() default 999999; -} diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/ValidIdRanges.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/ValidIdRanges.java deleted file mode 100644 index 81d4cf9f5..000000000 --- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/annotations/ValidIdRanges.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * Copyright 2015 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed 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 com.fr.third.org.jboss.logging.annotations; - -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.CLASS; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -/** - * @author James R. Perkins - */ -@Target(TYPE) -@Retention(CLASS) -@Documented -public @interface ValidIdRanges { - - /** - * An array of valid id ranges. - * - * @return an array of valid id ranges - */ - ValidIdRange[] value(); -} diff --git a/fine-skywalking-toolkit-trace/src/main/java/org/apache/skywalking/apm/toolkit/trace/Trace.java b/fine-skywalking-toolkit-trace/src/main/java/org/apache/skywalking/apm/toolkit/trace/Trace.java index a06bdab29..cea21f030 100644 --- a/fine-skywalking-toolkit-trace/src/main/java/org/apache/skywalking/apm/toolkit/trace/Trace.java +++ b/fine-skywalking-toolkit-trace/src/main/java/org/apache/skywalking/apm/toolkit/trace/Trace.java @@ -35,4 +35,9 @@ public @interface Trace { * @return operation name, the default value is blank string. */ String operationName() default ""; + + /** + * 是否可以被忽略 + */ + boolean ignorable() default true; }