Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion impl/src/main/java/org/jboss/weld/logging/BeanLogger.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

import static org.jboss.weld.logging.WeldLogger.WELD_PROJECT_CODE;

import java.lang.invoke.MethodHandles;

import org.jboss.logging.Logger;
import org.jboss.logging.Logger.Level;
import org.jboss.logging.annotations.Cause;
Expand All @@ -44,7 +46,7 @@
@MessageLogger(projectCode = WELD_PROJECT_CODE)
public interface BeanLogger extends WeldLogger {

BeanLogger LOG = Logger.getMessageLogger(BeanLogger.class, Category.BEAN.getName());
BeanLogger LOG = Logger.getMessageLogger(MethodHandles.lookup(), BeanLogger.class, Category.BEAN.getName());

@LogMessage(level = Level.TRACE)
@Message(id = 1, value = "Exactly one constructor ({0}) annotated with @Inject defined, using it as the bean constructor for {1}", format = Format.MESSAGE_FORMAT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

import static org.jboss.weld.logging.WeldLogger.WELD_PROJECT_CODE;

import java.lang.invoke.MethodHandles;

import javax.naming.NamingException;

import org.jboss.logging.Logger;
Expand All @@ -38,7 +40,8 @@
@MessageLogger(projectCode = WELD_PROJECT_CODE)
public interface BeanManagerLogger extends WeldLogger {

BeanManagerLogger LOG = Logger.getMessageLogger(BeanManagerLogger.class, Category.BEAN_MANAGER.getName());
BeanManagerLogger LOG = Logger.getMessageLogger(MethodHandles.lookup(), BeanManagerLogger.class,
Category.BEAN_MANAGER.getName());

@Message(id = 1300, value = "Unable to locate BeanManager")
NamingException cannotLocateBeanManager();
Expand Down Expand Up @@ -137,4 +140,4 @@ public interface BeanManagerLogger extends WeldLogger {
@Message(id = 1339, value = "Provided event type {0} cannot contain unresolvable type parameter", format = Format.MESSAGE_FORMAT)
IllegalArgumentException eventTypeUnresolvableWildcard(Object param1);

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

import static org.jboss.weld.logging.WeldLogger.WELD_PROJECT_CODE;

import java.lang.invoke.MethodHandles;

import jakarta.enterprise.inject.spi.ObserverMethod;

import org.jboss.logging.Logger;
Expand All @@ -41,9 +43,10 @@
@MessageLogger(projectCode = WELD_PROJECT_CODE)
public interface BootstrapLogger extends WeldLogger {

BootstrapLogger LOG = Logger.getMessageLogger(BootstrapLogger.class, Category.BOOTSTRAP.getName());
BootstrapLogger LOG = Logger.getMessageLogger(MethodHandles.lookup(), BootstrapLogger.class, Category.BOOTSTRAP.getName());

BootstrapLogger TRACKER_LOG = Logger.getMessageLogger(BootstrapLogger.class, Category.BOOTSTRAP_TRACKER.getName());
BootstrapLogger TRACKER_LOG = Logger.getMessageLogger(MethodHandles.lookup(), BootstrapLogger.class,
Category.BOOTSTRAP_TRACKER.getName());

@LogMessage(level = Level.DEBUG)
@Message(id = 100, value = "Weld initialized. Validating beans")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

import static org.jboss.weld.logging.WeldLogger.WELD_PROJECT_CODE;

import java.lang.invoke.MethodHandles;

import org.jboss.logging.Logger;
import org.jboss.logging.Logger.Level;
import org.jboss.logging.annotations.LogMessage;
Expand All @@ -34,7 +36,8 @@
@MessageLogger(projectCode = WELD_PROJECT_CODE)
public interface ConfigurationLogger extends WeldLogger {

ConfigurationLogger LOG = Logger.getMessageLogger(ConfigurationLogger.class, Category.CONFIGURATION.getName());
ConfigurationLogger LOG = Logger.getMessageLogger(MethodHandles.lookup(), ConfigurationLogger.class,
Category.CONFIGURATION.getName());

@Message(id = 1900, value = "Invalid configuration property value {0} for key {1}", format = Format.MESSAGE_FORMAT)
IllegalStateException invalidConfigurationPropertyValue(Object value, Object key);
Expand Down Expand Up @@ -69,4 +72,4 @@ public interface ConfigurationLogger extends WeldLogger {
@Message(id = 1908, value = "Configuration property {0} can only be set by integrator - value {1} ignored", format = Format.MESSAGE_FORMAT)
void cannotSetIntegratorOnlyConfigurationProperty(Object key, Object value);

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import static org.jboss.weld.logging.WeldLogger.WELD_PROJECT_CODE;

import java.lang.annotation.Annotation;
import java.lang.invoke.MethodHandles;

import jakarta.enterprise.context.spi.Context;

Expand All @@ -41,7 +42,7 @@
@MessageLogger(projectCode = WELD_PROJECT_CODE)
public interface ContextLogger extends WeldLogger {

ContextLogger LOG = Logger.getMessageLogger(ContextLogger.class, Category.CONTEXT.getName());
ContextLogger LOG = Logger.getMessageLogger(MethodHandles.lookup(), ContextLogger.class, Category.CONTEXT.getName());

@LogMessage(level = Level.TRACE)
@Message(id = 200, value = "Looked for {0} and got {1} in {2}", format = Format.MESSAGE_FORMAT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

import static org.jboss.weld.logging.WeldLogger.WELD_PROJECT_CODE;

import java.lang.invoke.MethodHandles;

import org.jboss.logging.Logger;
import org.jboss.logging.Logger.Level;
import org.jboss.logging.annotations.LogMessage;
Expand All @@ -35,7 +37,8 @@
@MessageLogger(projectCode = WELD_PROJECT_CODE)
public interface ConversationLogger extends WeldLogger {

ConversationLogger LOG = Logger.getMessageLogger(ConversationLogger.class, Category.CONVERSATION.getName());
ConversationLogger LOG = Logger.getMessageLogger(MethodHandles.lookup(), ConversationLogger.class,
Category.CONVERSATION.getName());

@LogMessage(level = Level.TRACE)
@Message(id = 304, value = "Cleaning up conversation {0}", format = Format.MESSAGE_FORMAT)
Expand Down
6 changes: 4 additions & 2 deletions impl/src/main/java/org/jboss/weld/logging/ElLogger.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

import static org.jboss.weld.logging.WeldLogger.WELD_PROJECT_CODE;

import java.lang.invoke.MethodHandles;

import org.jboss.logging.Logger;
import org.jboss.logging.Logger.Level;
import org.jboss.logging.annotations.LogMessage;
Expand All @@ -33,7 +35,7 @@
@MessageLogger(projectCode = WELD_PROJECT_CODE)
public interface ElLogger extends WeldLogger {

ElLogger LOG = Logger.getMessageLogger(ElLogger.class, Category.EL.getName());
ElLogger LOG = Logger.getMessageLogger(MethodHandles.lookup(), ElLogger.class, Category.EL.getName());

@Message(id = 1001, value = "Cannot pass null expressionFactory")
IllegalArgumentException nullExpressionFactory();
Expand All @@ -46,4 +48,4 @@ public interface ElLogger extends WeldLogger {
@Message(id = 1003, value = "EL property {0} resolved to {1}", format = Format.MESSAGE_FORMAT)
void propertyResolved(Object param1, Object param2);

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

import static org.jboss.weld.logging.WeldLogger.WELD_PROJECT_CODE;

import java.lang.invoke.MethodHandles;

import jakarta.enterprise.inject.spi.ObserverMethod;

import org.jboss.logging.Logger;
Expand All @@ -38,7 +40,7 @@
@MessageLogger(projectCode = WELD_PROJECT_CODE)
public interface EventLogger extends WeldLogger {

EventLogger LOG = Logger.getMessageLogger(EventLogger.class, Category.EVENT.getName());
EventLogger LOG = Logger.getMessageLogger(MethodHandles.lookup(), EventLogger.class, Category.EVENT.getName());

@LogMessage(level = Level.DEBUG)
@Message(id = 400, value = "Sending event {0} directly to observer {1}", format = Format.MESSAGE_FORMAT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

import static org.jboss.weld.logging.WeldLogger.WELD_PROJECT_CODE;

import java.lang.invoke.MethodHandles;

import org.jboss.logging.Logger;
import org.jboss.logging.Logger.Level;
import org.jboss.logging.annotations.LogMessage;
Expand All @@ -36,7 +38,8 @@
@MessageLogger(projectCode = WELD_PROJECT_CODE)
public interface InterceptorLogger extends WeldLogger {

InterceptorLogger LOG = Logger.getMessageLogger(InterceptorLogger.class, Category.INTERCEPTOR.getName());
InterceptorLogger LOG = Logger.getMessageLogger(MethodHandles.lookup(), InterceptorLogger.class,
Category.INTERCEPTOR.getName());

@LogMessage(level = Level.WARN)
@Message(id = 1700, value = "Interceptor annotation class {0} not found, interception based on it is not enabled", format = Format.MESSAGE_FORMAT)
Expand Down Expand Up @@ -82,4 +85,4 @@ public interface InterceptorLogger extends WeldLogger {
@Message(id = 1711, value = "InterceptionFactory is not supported on interfaces. Check InterceptionFactory<{0}>", format = Format.MESSAGE_FORMAT)
IllegalStateException interceptionFactoryNotOnInstance(Object param1);

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import static org.jboss.weld.logging.WeldLogger.WELD_PROJECT_CODE;

import java.lang.invoke.MethodHandles;

import org.jboss.logging.Logger;
import org.jboss.logging.annotations.Cause;
import org.jboss.logging.annotations.Message;
Expand All @@ -20,7 +22,7 @@
@MessageLogger(projectCode = WELD_PROJECT_CODE)
public interface InvokerLogger extends WeldLogger {

InvokerLogger LOG = Logger.getMessageLogger(InvokerLogger.class, Category.INVOKER.getName());
InvokerLogger LOG = Logger.getMessageLogger(MethodHandles.lookup(), InvokerLogger.class, Category.INVOKER.getName());

@Message(id = 2000, value = "Cannot apply {0} to method argument with position {1}; total number of method parameters is {2}", format = Message.Format.MESSAGE_FORMAT)
IllegalArgumentException invalidArgumentPosition(String kindOfTransformer, int position, int argLookupLength);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

import static org.jboss.weld.logging.WeldLogger.WELD_PROJECT_CODE;

import java.lang.invoke.MethodHandles;

import org.jboss.logging.Logger;
import org.jboss.logging.Logger.Level;
import org.jboss.logging.annotations.LogMessage;
Expand All @@ -37,7 +39,7 @@
@MessageLogger(projectCode = WELD_PROJECT_CODE)
public interface MetadataLogger extends WeldLogger {

MetadataLogger LOG = Logger.getMessageLogger(MetadataLogger.class, Category.BOOTSTRAP.getName());
MetadataLogger LOG = Logger.getMessageLogger(MethodHandles.lookup(), MetadataLogger.class, Category.BOOTSTRAP.getName());

@Message(id = 1100, value = "{0} can only be applied to an annotation. It was applied to {1}", format = Format.MESSAGE_FORMAT)
DefinitionException metaAnnotationOnWrongType(Object param1, Object param2);
Expand Down Expand Up @@ -129,4 +131,4 @@ void notInHierarchy(Object memberName, Object member, Object annotatedTypeJavaCl
@Message(id = 1127, value = "Stereotype {0} cannot declare @Alternative and @Reserve at the same time", format = Format.MESSAGE_FORMAT)
DefinitionException alternativeAndReserveSimultaneously(Object param1);

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import static org.jboss.weld.logging.WeldLogger.WELD_PROJECT_CODE;

import java.lang.invoke.MethodHandles;
import java.lang.reflect.Method;
import java.lang.reflect.Type;

Expand All @@ -40,7 +41,8 @@
@MessageLogger(projectCode = WELD_PROJECT_CODE)
public interface ReflectionLogger extends WeldLogger {

ReflectionLogger LOG = Logger.getMessageLogger(ReflectionLogger.class, Category.REFLECTION.getName());
ReflectionLogger LOG = Logger.getMessageLogger(MethodHandles.lookup(), ReflectionLogger.class,
Category.REFLECTION.getName());

@LogMessage(level = Level.DEBUG)
@Message(id = 600, value = "{0} is missing @Retention(RUNTIME). Weld will use this annotation, however this may make the application unportable.", format = Format.MESSAGE_FORMAT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

import static org.jboss.weld.logging.WeldLogger.WELD_PROJECT_CODE;

import java.lang.invoke.MethodHandles;

import org.jboss.logging.Logger;
import org.jboss.logging.annotations.Cause;
import org.jboss.logging.annotations.Message;
Expand All @@ -35,12 +37,13 @@
@MessageLogger(projectCode = WELD_PROJECT_CODE)
public interface ResolutionLogger extends WeldLogger {

ResolutionLogger LOG = Logger.getMessageLogger(ResolutionLogger.class, Category.RESOLUTION.getName());
ResolutionLogger LOG = Logger.getMessageLogger(MethodHandles.lookup(), ResolutionLogger.class,
Category.RESOLUTION.getName());

@Message(id = 1601, value = "Cannot extract rawType from {0}", format = Format.MESSAGE_FORMAT)
IllegalArgumentException cannotExtractRawType(Object param1);

@Message(id = 1602, value = "Cannot create qualifier instance model for {0}\n\tat {1}\n StackTrace:", format = Format.MESSAGE_FORMAT)
WeldException cannotCreateQualifierInstanceValues(Object annotation, Object stackElement, @Cause Exception cause);

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

import static org.jboss.weld.logging.WeldLogger.WELD_PROJECT_CODE;

import java.lang.invoke.MethodHandles;

import org.jboss.logging.Logger;
import org.jboss.logging.annotations.Cause;
import org.jboss.logging.annotations.Message;
Expand All @@ -34,12 +36,13 @@
@MessageLogger(projectCode = WELD_PROJECT_CODE)
public interface SerializationLogger extends WeldLogger {

SerializationLogger LOG = Logger.getMessageLogger(SerializationLogger.class, Category.SERIALIZATION.getName());
SerializationLogger LOG = Logger.getMessageLogger(MethodHandles.lookup(), SerializationLogger.class,
Category.SERIALIZATION.getName());

@Message(id = 1800, value = "Unable to get bean identifier at position {0} from {1}", format = Format.MESSAGE_FORMAT)
IllegalStateException unableToGetBeanIdentifier(int index, Object info);

@Message(id = 1801, value = "Unable to deserialize {0}", format = Format.MESSAGE_FORMAT)
InvalidObjectException unableToDeserialize(Object info, @Cause Throwable cause);

}
}
6 changes: 4 additions & 2 deletions impl/src/main/java/org/jboss/weld/logging/UtilLogger.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

import static org.jboss.weld.logging.WeldLogger.WELD_PROJECT_CODE;

import java.lang.invoke.MethodHandles;

import org.jboss.logging.Logger;
import org.jboss.logging.Logger.Level;
import org.jboss.logging.annotations.Cause;
Expand All @@ -39,7 +41,7 @@
@MessageLogger(projectCode = WELD_PROJECT_CODE)
public interface UtilLogger extends WeldLogger {

UtilLogger LOG = Logger.getMessageLogger(UtilLogger.class, Category.UTIL.getName());
UtilLogger LOG = Logger.getMessageLogger(MethodHandles.lookup(), UtilLogger.class, Category.UTIL.getName());

// log message with id 802 was removed

Expand Down Expand Up @@ -106,4 +108,4 @@ public interface UtilLogger extends WeldLogger {
@Message(id = 834, value = "Unable to inject resource - most probably incorrect InjectionServices SPI implementation: {0}\n\tat {1}", format = Format.MESSAGE_FORMAT)
void unableToInjectResource(Object member, Object stackElement);

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import static org.jboss.weld.logging.WeldLogger.WELD_PROJECT_CODE;

import java.lang.invoke.MethodHandles;
import java.lang.reflect.Method;
import java.util.Collection;

Expand All @@ -43,7 +44,7 @@
@MessageLogger(projectCode = WELD_PROJECT_CODE)
public interface ValidatorLogger extends WeldLogger {

ValidatorLogger LOG = Logger.getMessageLogger(ValidatorLogger.class, Category.VALIDATOR.getName());
ValidatorLogger LOG = Logger.getMessageLogger(MethodHandles.lookup(), ValidatorLogger.class, Category.VALIDATOR.getName());

MessageCallback<DefinitionException> INJECTION_INTO_DISPOSER_METHOD = (t) -> ValidatorLogger.LOG
.injectionIntoDisposerMethod(t[0], t[1]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

import static org.jboss.weld.logging.WeldLogger.WELD_PROJECT_CODE;

import java.lang.invoke.MethodHandles;

import org.jboss.logging.Logger;
import org.jboss.logging.Logger.Level;
import org.jboss.logging.annotations.LogMessage;
Expand All @@ -32,10 +34,10 @@
@MessageLogger(projectCode = WELD_PROJECT_CODE)
public interface VersionLogger extends WeldLogger {

VersionLogger LOG = Logger.getMessageLogger(VersionLogger.class, Category.VERSION.getName());
VersionLogger LOG = Logger.getMessageLogger(MethodHandles.lookup(), VersionLogger.class, Category.VERSION.getName());

@LogMessage(level = Level.INFO)
@Message(id = 900, value = "{0}", format = Format.MESSAGE_FORMAT)
void version(Object info);

}
}
6 changes: 4 additions & 2 deletions impl/src/main/java/org/jboss/weld/logging/XmlLogger.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

import static org.jboss.weld.logging.WeldLogger.WELD_PROJECT_CODE;

import java.lang.invoke.MethodHandles;

import org.jboss.logging.Logger;
import org.jboss.logging.Logger.Level;
import org.jboss.logging.annotations.Cause;
Expand All @@ -36,7 +38,7 @@
@MessageLogger(projectCode = WELD_PROJECT_CODE)
public interface XmlLogger extends WeldLogger {

XmlLogger LOG = Logger.getMessageLogger(XmlLogger.class, Category.BOOTSTRAP.getName());
XmlLogger LOG = Logger.getMessageLogger(MethodHandles.lookup(), XmlLogger.class, Category.BOOTSTRAP.getName());

@Message(id = 1200, value = "Error configuring XML parser")
IllegalStateException configurationError(@Cause Throwable cause);
Expand Down Expand Up @@ -67,4 +69,4 @@ public interface XmlLogger extends WeldLogger {
@Message(id = 1210, value = "Warning when validating {0}@{1} against xsd. {2}", format = Format.MESSAGE_FORMAT)
void xsdValidationWarning(Object param1, Object param2, Object param3);

}
}
Loading