Skip to content

Commit

Permalink
Merge pull request #222 from jamezp/proposed-refactor
Browse files Browse the repository at this point in the history
Move core some core components to the ext module
  • Loading branch information
jamezp authored Dec 17, 2018
2 parents 443244d + b9b23c9 commit a7d7f5c
Show file tree
Hide file tree
Showing 55 changed files with 302 additions and 533 deletions.
44 changes: 5 additions & 39 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,43 +54,18 @@
<artifactId>wildfly-common</artifactId>
</dependency>

<!-- test dependencies -->

<!-- Used in a test formatter -->
<dependency>
<groupId>javax.json</groupId>
<artifactId>javax.json-api</artifactId>
<!-- only required for the JsonFormatter -->
<optional>true</optional>
<scope>test</scope>
</dependency>
<!-- JSON implementation -->
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.json</artifactId>
<!-- only required for the JsonFormatter, another implementation of the JSON-P API may be used as well -->
<optional>true</optional>
</dependency>

<!-- test dependencies -->

<dependency>
<groupId>org.jboss.byteman</groupId>
<artifactId>byteman</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.jboss.byteman</groupId>
<artifactId>byteman-submit</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.jboss.byteman</groupId>
<artifactId>byteman-install</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.jboss.byteman</groupId>
<artifactId>byteman-bmunit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -120,18 +95,9 @@
<includes>
<include>**/*Tests.java</include>
</includes>
<argLine>-Djdk.attach.allowAttachSelf=true -Djava.util.logging.manager=org.jboss.logmanager.LogManager</argLine>
<argLine>-Djava.util.logging.manager=org.jboss.logmanager.LogManager</argLine>
<systemPropertyVariables>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<test.log.dir>${project.build.directory}${file.separator}logs${file.separator}</test.log.dir>
<!-- Configured for SocketHandler SSL test -->
<javax.net.ssl.keyStore>${project.basedir}/src/test/resources/server-keystore.jks</javax.net.ssl.keyStore>
<javax.net.ssl.keyStorePassword>testpassword</javax.net.ssl.keyStorePassword>
<javax.net.ssl.trustStore>${project.basedir}/src/test/resources/client-keystore.jks</javax.net.ssl.trustStore>
<javax.net.ssl.trustStorePassword>testpassword</javax.net.ssl.trustStorePassword>
<org.jboss.test.address>${org.jboss.test.address}</org.jboss.test.address>
<org.jboss.test.port>${org.jboss.test.port}</org.jboss.test.port>
<org.jboss.test.alt.port>${org.jboss.test.alt.port}</org.jboss.test.alt.port>
</systemPropertyVariables>
<trimStackTrace>false</trimStackTrace>
</configuration>
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/org/jboss/logmanager/ExtHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

package org.jboss.logmanager;

import java.io.Flushable;
import java.io.UnsupportedEncodingException;
import java.security.Permission;
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
Expand All @@ -31,13 +32,12 @@
import java.util.logging.LoggingPermission;

import org.jboss.logmanager.errormanager.OnlyOnceErrorManager;
import org.jboss.logmanager.handlers.FlushableCloseable;

/**
* An extended logger handler. Use this class as a base class for log handlers which require {@code ExtLogRecord}
* instances.
*/
public abstract class ExtHandler extends Handler implements FlushableCloseable {
public abstract class ExtHandler extends Handler implements AutoCloseable, Flushable {

private static final Permission CONTROL_PERMISSION = new LoggingPermission("control", null);
private volatile boolean autoFlush = true;
Expand Down

This file was deleted.

95 changes: 0 additions & 95 deletions core/src/main/java/org/jboss/logmanager/LogService.java

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
*
* @author <a href="mailto:[email protected]">James R. Perkins</a>
*/
class StackTraceFormatter {
public class StackTraceFormatter {
private static final String CAUSED_BY_CAPTION = "Caused by: ";
private static final String SUPPRESSED_CAPTION = "Suppressed: ";
// Used to guard against reentry when attempting to guess the class name
Expand All @@ -58,6 +58,17 @@ private StackTraceFormatter(final StringBuilder builder, final int suppressedDep
cache = extended ? new HashMap<String, String>() : null;
}

/**
* Writes the stack trace into the builder.
*
* @param builder the string builder ot append the stack trace to
* @param t the throwable to render
* @param suppressedDepth the number of suppressed messages to include
*/
public static void renderStackTrace(final StringBuilder builder, final Throwable t, final int suppressedDepth) {
renderStackTrace(builder, t, false, suppressedDepth);
}

/**
* Writes the stack trace into the builder.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@

import java.io.Writer;

final class StringBuilderWriter extends Writer {
public final class StringBuilderWriter extends Writer {

private final StringBuilder builder;

StringBuilderWriter() {
public StringBuilderWriter() {
this(new StringBuilder());
}

Expand All @@ -38,7 +38,7 @@ public StringBuilderWriter(final StringBuilder builder) {
*
* @see StringBuilder#setLength(int)
*/
void clear() {
public void clear() {
builder.setLength(0);
}

Expand Down

This file was deleted.

Loading

0 comments on commit a7d7f5c

Please sign in to comment.