Skip to content

Commit

Permalink
Transition to smallrye-common, remove wildfly-common
Browse files Browse the repository at this point in the history
  • Loading branch information
dmlloyd committed Mar 25, 2022
1 parent 5aa9ec9 commit 1b342df
Show file tree
Hide file tree
Showing 13 changed files with 54 additions and 32 deletions.
22 changes: 20 additions & 2 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,20 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wildfly.common</groupId>
<artifactId>wildfly-common</artifactId>
<groupId>io.smallrye.common</groupId>
<artifactId>smallrye-common-constraint</artifactId>
</dependency>
<dependency>
<groupId>io.smallrye.common</groupId>
<artifactId>smallrye-common-net</artifactId>
</dependency>
<dependency>
<groupId>io.smallrye.common</groupId>
<artifactId>smallrye-common-os</artifactId>
</dependency>
<dependency>
<groupId>io.smallrye.common</groupId>
<artifactId>smallrye-common-ref</artifactId>
</dependency>

<!-- test dependencies -->
Expand All @@ -62,6 +74,12 @@
<artifactId>jakarta.json-api</artifactId>
<scope>test</scope>
</dependency>
<!-- Used by DelayedHandlerTests -->
<dependency>
<groupId>io.smallrye.common</groupId>
<artifactId>smallrye-common-cpu</artifactId>
<scope>test</scope>
</dependency>
<!-- JSON implementation -->
<dependency>
<groupId>org.glassfish</groupId>
Expand Down
9 changes: 4 additions & 5 deletions core/src/main/java/org/jboss/logmanager/ExtLogRecord.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

package org.jboss.logmanager;

import io.smallrye.common.net.HostName;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
Expand All @@ -29,9 +31,6 @@

import java.util.logging.LogRecord;

import org.wildfly.common.net.HostName;
import org.wildfly.common.os.Process;

/**
* An extended log record, which includes additional information including MDC/NDC and correct
* caller location (even in the presence of a logging facade).
Expand Down Expand Up @@ -85,8 +84,8 @@ public ExtLogRecord(final java.util.logging.Level level, final String msg, final
ndc = NDC.get();
threadName = Thread.currentThread().getName();
hostName = HostName.getQualifiedHostName();
processName = Process.getProcessName();
processId = Process.getProcessId();
processName = io.smallrye.common.os.Process.getProcessName();
processId = io.smallrye.common.os.Process.getProcessId();
}

/**
Expand Down
6 changes: 3 additions & 3 deletions core/src/main/java/org/jboss/logmanager/LogContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@

package org.jboss.logmanager;

import org.wildfly.common.Assert;
import org.wildfly.common.ref.Reference;
import org.wildfly.common.ref.References;
import io.smallrye.common.constraint.Assert;
import io.smallrye.common.ref.Reference;
import io.smallrye.common.ref.References;

import java.security.AccessController;
import java.security.Permission;
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/org/jboss/logmanager/LogManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

package org.jboss.logmanager;

import org.wildfly.common.Assert;
import io.smallrye.common.constraint.Assert;

import java.beans.PropertyChangeListener;
import java.io.IOException;
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/org/jboss/logmanager/Logger.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

package org.jboss.logmanager;

import org.wildfly.common.Assert;
import io.smallrye.common.constraint.Assert;

import java.io.ObjectStreamException;
import java.io.Serializable;
Expand Down
8 changes: 4 additions & 4 deletions core/src/main/java/org/jboss/logmanager/LoggerNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@

package org.jboss.logmanager;

import org.wildfly.common.Assert;
import org.wildfly.common.ref.PhantomReference;
import org.wildfly.common.ref.Reaper;
import org.wildfly.common.ref.Reference;
import io.smallrye.common.constraint.Assert;
import io.smallrye.common.ref.PhantomReference;
import io.smallrye.common.ref.Reaper;
import io.smallrye.common.ref.Reference;

import java.lang.reflect.UndeclaredThrowableException;
import java.security.AccessController;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import java.util.logging.Handler;

import io.smallrye.common.constraint.Assert;
import org.jboss.logmanager.ExtErrorManager;
import org.wildfly.common.Assert;

/**
* An error manager which publishes errors to a handler.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@
import java.util.logging.Logger;
import java.util.stream.Collectors;

import io.smallrye.common.cpu.ProcessorInfo;
import org.jboss.logmanager.AssertingErrorManager;
import org.jboss.logmanager.ExtHandler;
import org.jboss.logmanager.ExtLogRecord;
import org.jboss.logmanager.LogContext;
import org.junit.After;
import org.junit.Assert;
import org.junit.Test;
import org.wildfly.common.cpu.ProcessorInfo;

/**
* @author <a href="mailto:[email protected]">James R. Perkins</a>
Expand Down
8 changes: 6 additions & 2 deletions ext/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,12 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wildfly.common</groupId>
<artifactId>wildfly-common</artifactId>
<groupId>io.smallrye.common</groupId>
<artifactId>smallrye-common-constraint</artifactId>
</dependency>
<dependency>
<groupId>io.smallrye.common</groupId>
<artifactId>smallrye-common-expression</artifactId>
</dependency>

<!-- Test dependencies -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
import java.util.logging.Level;
import java.util.logging.Logger;

import io.smallrye.common.constraint.Assert;
import io.smallrye.common.expression.Expression;
import org.jboss.logmanager.LogContext;
import org.jboss.logmanager.StandardOutputStreams;
import org.jboss.logmanager.ext.filters.FilterExpressions;
import org.jboss.logmanager.filters.AcceptAllFilter;
import org.jboss.logmanager.filters.DenyAllFilter;
import org.wildfly.common.Assert;
import org.wildfly.common.expression.Expression;

/**
* A utility to parse a {@code logging.properties} file and configure a {@link LogContext}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
import java.util.logging.Handler;
import java.util.logging.LogRecord;

import io.smallrye.common.constraint.Assert;
import org.jboss.logmanager.ExtHandler;
import org.jboss.logmanager.ExtLogRecord;
import org.wildfly.common.Assert;

/**
* A queue handler which retains the last few messages logged. The handler can be used as-is to remember recent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@

import org.jboss.logmanager.ExtHandler;
import org.jboss.logmanager.ExtLogRecord;
import org.wildfly.common.os.Process;

import static java.time.temporal.ChronoField.*;

Expand Down Expand Up @@ -471,7 +470,7 @@ public SyslogHandler(final InetAddress serverAddress, final int port, final Faci
this.serverAddress = serverAddress;
this.port = port;
this.facility = facility;
final long pid = Process.getProcessId();
final long pid = io.smallrye.common.os.Process.getProcessId();
this.pid = (pid != -1 ? Long.toString(pid) : null);
this.appName = "java";
this.hostname = checkPrintableAscii("host name", hostname);
Expand Down
16 changes: 9 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@

<properties>
<!-- Dependency versions -->
<version.io.smallrye.common.smallrye-common>2.0.0-RC3</version.io.smallrye.common.smallrye-common>
<version.jakarta.json.jakarta-json-api>1.1.6</version.jakarta.json.jakarta-json-api>
<version.org.byteman>4.0.17</version.org.byteman>
<version.org.glassfish.jakarta.json>1.1.6</version.org.glassfish.jakarta.json>
<version.org.jboss.logging.jboss-logging>3.4.0.Final</version.org.jboss.logging.jboss-logging>
<version.org.jboss.modules.jboss-modules>1.10.1.Final</version.org.jboss.modules.jboss-modules>
<version.org.kohsuke.metainf-services>1.8</version.org.kohsuke.metainf-services>
<version.org.wildfly.common.wildfly-common>1.5.1.Final</version.org.wildfly.common.wildfly-common>
<version.junit.junit>4.13.2</version.junit.junit>

<!-- Test properties -->
Expand All @@ -75,10 +75,10 @@
-->
<version.compiler.plugin>3.7.0-jboss-1</version.compiler.plugin>

<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>

<jdk.min.version>9</jdk.min.version>
<jdk.min.version>11</jdk.min.version>
</properties>

<dependencyManagement>
Expand All @@ -103,9 +103,11 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wildfly.common</groupId>
<artifactId>wildfly-common</artifactId>
<version>${version.org.wildfly.common.wildfly-common}</version>
<groupId>io.smallrye.common</groupId>
<artifactId>smallrye-common-bom</artifactId>
<version>${version.io.smallrye.common.smallrye-common}</version>
<type>pom</type>
<scope>import</scope>
</dependency>

<dependency>
Expand Down

0 comments on commit 1b342df

Please sign in to comment.