Skip to content

Commit

Permalink
Deprecate org.wildfly.common.ref in favor of SmallRye
Browse files Browse the repository at this point in the history
Fixes #98
  • Loading branch information
dmlloyd committed Jan 19, 2024
1 parent edaa75d commit 6fd9865
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@
<groupId>io.smallrye.common</groupId>
<artifactId>smallrye-common-os</artifactId>
</dependency>
<dependency>
<groupId>io.smallrye.common</groupId>
<artifactId>smallrye-common-ref</artifactId>
</dependency>
<dependency>
<!-- This dependency is just for javadoc -->
<groupId>javax.annotation</groupId>
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/org/wildfly/common/ref/CleanerReference.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

package org.wildfly.common.ref;

import java.lang.ref.Cleaner;
import java.util.Collections;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
Expand All @@ -26,7 +27,10 @@
* A special version of {@link PhantomReference} that is strongly retained until it is reaped by the collection thread.
*
* @author <a href="mailto:[email protected]">David M. Lloyd</a>
*
* @deprecated Use {@link Cleaner} or {@link io.smallrye.common.ref.CleanerReference} instead.
*/
@Deprecated(forRemoval = true)
public class CleanerReference<T, A> extends PhantomReference<T, A> {
private static final Set<CleanerReference<?, ?>> set = Collections.newSetFromMap(new ConcurrentHashMap<CleanerReference<?, ?>, Boolean>());

Expand Down
3 changes: 3 additions & 0 deletions src/main/java/org/wildfly/common/ref/PhantomReference.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@
* @see java.lang.ref.PhantomReference
*
* @author <a href="mailto:[email protected]">David M. Lloyd</a>
*
* @deprecated Use {@link io.smallrye.common.ref.PhantomReference} instead.
*/
@Deprecated(forRemoval = true)
public class PhantomReference<T, A> extends java.lang.ref.PhantomReference<T> implements Reference<T, A>, Reapable<T, A> {
private final A attachment;
private final Reaper<T, A> reaper;
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/org/wildfly/common/ref/Reaper.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@
* @param <A> the reference attachment type
*
* @author <a href="mailto:[email protected]">David M. Lloyd</a>
*
* @deprecated Use {@link io.smallrye.common.ref.Reaper} instead.
*/
@Deprecated(forRemoval = true)
public interface Reaper<T, A> {

/**
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/org/wildfly/common/ref/Reference.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@
* @see java.lang.ref.Reference
*
* @author <a href="mailto:[email protected]">David M. Lloyd</a>
*
* @deprecated Use {@link io.smallrye.common.ref.Reference} instead.
*/
@Deprecated(forRemoval = true)
public interface Reference<T, A> {

/**
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/org/wildfly/common/ref/References.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@

/**
* A set of utility methods for reference types.
*
* @deprecated Use {@link io.smallrye.common.ref.References} instead.
*/
@Deprecated(forRemoval = true)
public final class References {
private References() {
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/org/wildfly/common/ref/SoftReference.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
* @see java.lang.ref.SoftReference
*
* @author <a href="mailto:[email protected]">David M. Lloyd</a>
*
* @deprecated Use {@link io.smallrye.common.ref.SoftReference} instead.
*/
public class SoftReference<T, A> extends java.lang.ref.SoftReference<T> implements Reference<T, A>, Reapable<T, A> {
private final A attachment;
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/org/wildfly/common/ref/StrongReference.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@
* @param <A> the attachment type
*
* @author <a href="mailto:[email protected]">David M. Lloyd</a>
*
* @deprecated Use {@link io.smallrye.common.ref.StrongReference} instead.
*/
@Deprecated(forRemoval = true)
public class StrongReference<T, A> implements Reference<T, A> {

private volatile T referent;
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/org/wildfly/common/ref/WeakReference.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@
* @see java.lang.ref.WeakReference
*
* @author <a href="mailto:[email protected]">David M. Lloyd</a>
*
* @deprecated Use {@link io.smallrye.common.ref.WeakReference} instead.
*/
@Deprecated(forRemoval = true)
public class WeakReference<T, A> extends java.lang.ref.WeakReference<T> implements Reference<T, A>, Reapable<T, A> {
private final A attachment;
private final Reaper<T, A> reaper;
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/org/wildfly/common/ref/package-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@
/**
* Classes which implement reference types which can be cleaned up automatically by a background thread. See
* {@link org.wildfly.common.ref.Reference Reference} and its subtypes, and {@link org.wildfly.common.ref.Reaper Reaper} for more information.
*
* @deprecated Use {@link io.smallrye.common.ref} instead.
*/
@Deprecated(forRemoval = true)
package org.wildfly.common.ref;

0 comments on commit 6fd9865

Please sign in to comment.