Skip to content

Commit

Permalink
Upgrade to 3.0.0.Beta3 and the required updates for that release.
Browse files Browse the repository at this point in the history
Signed-off-by: James R. Perkins <[email protected]>
  • Loading branch information
jamezp committed Jul 6, 2023
1 parent b1b9840 commit 999f9c6
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
<!-- Allow javax->jakarta deployment transformation if this module is provided -->
<module name="org.wildfly.deployment.transformation" optional="true" services="import"/>
<module name="org.eclipse.jgit" optional="true"/>
<module name="org.wildfly.core.logmanager" services="import"/>
<module name="org.wildfly.installation-manager" services="import" />
</dependencies>
</module>
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ private static boolean equalValue(final AttributeDefinition attribute, final Ope
if (configuration.hasProperty(ENABLED.getPropertyName())) {
currentValue = Boolean.parseBoolean(configuration.getPropertyValueString(ENABLED.getPropertyName()));
} else {
currentValue = isEnabled(logContextConfiguration.getLogContext(), configuration.getName());
currentValue = isEnabled(logContextConfiguration.getContext(), configuration.getName());
}
result = resolvedValue == currentValue;
} else if (attribute.getName().equals(ENCODING.getName())) {
Expand Down Expand Up @@ -848,7 +848,7 @@ private static void enableHandler(final LogContextConfiguration configuration, f
} catch (IllegalArgumentException e) {
// do nothing
}
final Map<String, String> disableHandlers = configuration.getLogContext().getAttachment(CommonAttributes.ROOT_LOGGER_NAME, DISABLED_HANDLERS_KEY);
final Map<String, String> disableHandlers = configuration.getContext().getAttachment(CommonAttributes.ROOT_LOGGER_NAME, DISABLED_HANDLERS_KEY);
if (disableHandlers != null && disableHandlers.containsKey(handlerName)) {
synchronized (HANDLER_LOCK) {
final String filter = disableHandlers.get(handlerName);
Expand All @@ -874,7 +874,7 @@ private static void disableHandler(final LogContextConfiguration configuration,
} catch (IllegalArgumentException e) {
// do nothing
}
final Logger root = configuration.getLogContext().getLogger(CommonAttributes.ROOT_LOGGER_NAME);
final Logger root = configuration.getContext().getLogger(CommonAttributes.ROOT_LOGGER_NAME);
Map<String, String> disableHandlers = root.getAttachment(DISABLED_HANDLERS_KEY);
synchronized (HANDLER_LOCK) {
if (disableHandlers == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ private static void safeClose(final Closeable closeable) {
}

@Override
public LogContext getLogContext() {
public LogContext getContext() {
synchronized (LOCK) {
return config.getLogContext();
return config.getContext();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* @author <a href="mailto:[email protected]">James R. Perkins</a>
*/
class EmbeddedLogContextSelector extends WildFlyLogContextSelectorImpl {
private static final LogContext CONTEXT = LogContext.create(true, new WildFlyLogContextInitializer());
private static final LogContext CONTEXT = LogContext.create(false, new WildFlyLogContextInitializer());

EmbeddedLogContextSelector() {
super(CONTEXT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,6 @@ public static LogContextConfiguration getEmbedded() {
return (LogContextConfiguration) configuration;
}

// TODO (jrp) rename this to getContext() for refactoring
public LogContext getLogContext() {
return getContext();
}

public LoggerConfiguration addLoggerConfiguration(final String loggerName) {
if (loggers.containsKey(loggerName)) {
throw new IllegalArgumentException(String.format("Logger \"%s\" already exists", loggerName));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ final class LoggerConfigurationImpl extends AbstractBasicConfiguration<Logger, L
private ValueExpression<Boolean> useParentFilters;
private ValueExpression<Boolean> useParentHandlers;
private ValueExpression<String> level;
private final List<String> handlerNames = new ArrayList<String>(0);
private final List<String> handlerNames = new ArrayList<>(0);

LoggerConfigurationImpl(final String name, final LogContextConfiguration configuration) {
super(name, configuration, configuration.getLoggerConfigurations());
Expand All @@ -61,7 +61,7 @@ public void setFilter(final String filter) {

@Override
public void setFilter(final String expression, final String value) {
setFilter(new ValueExpressionImpl<String>(expression, value));
setFilter(new ValueExpressionImpl<>(expression, value));
}

private void setFilter(final ValueExpression<String> valueExpression) {
Expand Down Expand Up @@ -147,7 +147,7 @@ public ValueExpression<Boolean> getUseParentHandlersValueExpression() {
}

public void setUseParentHandlers(final Boolean useParentHandlers) {
setUseParentHandlers(new ValueExpressionImpl<Boolean>(null, useParentHandlers));
setUseParentHandlers(new ValueExpressionImpl<>(null, useParentHandlers));
}

@Override
Expand All @@ -157,7 +157,7 @@ public void setUseParentHandlers(final String expression) {

@Override
public void setUseParentHandlers(final String expression, final Boolean value) {
setUseParentHandlers(new ValueExpressionImpl<Boolean>(expression, value));
setUseParentHandlers(new ValueExpressionImpl<>(expression, value));
}

private void setUseParentHandlers(final ValueExpression<Boolean> valueExpression) {
Expand Down Expand Up @@ -199,7 +199,7 @@ public void setLevel(final String level) {

@Override
public void setLevel(final String expression, final String level) {
setLevelValueExpression(new ValueExpressionImpl<String>(expression, level));
setLevelValueExpression(new ValueExpressionImpl<>(expression, level));
}

private void setLevelValueExpression(final ValueExpression<String> expression) {
Expand All @@ -209,7 +209,7 @@ private void setLevelValueExpression(final ValueExpression<String> expression) {
final LogContextConfiguration configuration = getConfiguration();
configuration.addAction(new ConfigAction<Level>() {
public Level validate() throws IllegalArgumentException {
return resolvedLevel == null ? null : configuration.getLogContext().getLevelForName(resolvedLevel);
return resolvedLevel == null ? null : configuration.getContext().getLevelForName(resolvedLevel);
}

public void applyPreCreate(final Level param) {
Expand All @@ -226,7 +226,7 @@ public void rollback() {
}

public List<String> getHandlerNames() {
return new ArrayList<String>(handlerNames);
return new ArrayList<>(handlerNames);
}

public void setHandlerNames(final String... names) {
Expand Down Expand Up @@ -335,7 +335,12 @@ ConfigurationResource<Logger> removeInstance() {
@Override
ConfigAction<Void> getRemoveAction() {
final String name = getName();
final Logger refLogger = getConfiguration().getLogger(name);
final Logger refLogger;
if (getConfiguration().hasLogger(name)) {
refLogger = getConfiguration().getLogger(name);
} else {
refLogger = null;
}
final Filter filter;
final Handler[] handlers;
final Level level;
Expand Down Expand Up @@ -375,6 +380,7 @@ public void rollback() {
refLogger.setLevel(level);
refLogger.setUseParentHandlers(useParentHandlers);
configs.put(name, LoggerConfigurationImpl.this);
//getConfiguration().addLogger(refLogger);
}
clearRemoved();
}
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@
<version.org.jboss.logging.jboss-logging>3.4.3.Final</version.org.jboss.logging.jboss-logging>
<version.org.jboss.logging.jboss-logging-tools>2.2.1.Final</version.org.jboss.logging.jboss-logging-tools>
<version.org.jboss.logging.jul-to-slf4j-stub>1.0.1.Final</version.org.jboss.logging.jul-to-slf4j-stub>
<version.org.jboss.logmanager.jboss-logmanager>3.0.0.Beta2</version.org.jboss.logmanager.jboss-logmanager>
<version.org.jboss.logmanager.jboss-logmanager>3.0.0.Beta3</version.org.jboss.logmanager.jboss-logmanager>
<version.org.jboss.logmanager.log4j2-jboss-logmanager>1.1.1.Final</version.org.jboss.logmanager.log4j2-jboss-logmanager>
<version.org.jboss.marshalling.jboss-marshalling>2.1.1.Final</version.org.jboss.marshalling.jboss-marshalling>
<version.org.jboss.modules.jboss-modules>2.1.0.Final</version.org.jboss.modules.jboss-modules>
Expand Down

0 comments on commit 999f9c6

Please sign in to comment.