Fix warnings
This commit is contained in:
parent
49f2b81dc6
commit
935b7ea5c3
|
@ -27,12 +27,12 @@ public abstract class AbstractProxy<T> implements InvocationHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
|
public Object invoke(Object proxy, Method method, Object[] args) {
|
||||||
if (method.equals(toStringMethod)) {
|
if (method.equals(toStringMethod)) {
|
||||||
return this._ref.toString();
|
return this._ref.toString();
|
||||||
}
|
}
|
||||||
return dispatch(method, args);
|
return dispatch(method, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract Object dispatch(Method method, Object[] args) throws Throwable;
|
abstract Object dispatch(Method method, Object[] args);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package org.syndicate_lang.actors;
|
package org.syndicate_lang.actors;
|
||||||
|
|
||||||
public class ActorTerminated extends Exception {
|
public class ActorTerminated extends Exception {
|
||||||
private Actor _actor;
|
private final Actor _actor;
|
||||||
|
|
||||||
public ActorTerminated(Actor actor) {
|
public ActorTerminated(Actor actor) {
|
||||||
super("Actor terminated: " + actor, actor.getExitReason());
|
super("Actor terminated: " + actor, actor.getExitReason());
|
||||||
|
|
|
@ -9,7 +9,7 @@ public class AsyncProxy<T> extends AbstractProxy<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object dispatch(Method method, Object[] args) throws Throwable {
|
public Object dispatch(Method method, Object[] args) {
|
||||||
if (method.getReturnType().equals(void.class)) {
|
if (method.getReturnType().equals(void.class)) {
|
||||||
this._ref.async((v) -> {
|
this._ref.async((v) -> {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package org.syndicate_lang.actors;
|
package org.syndicate_lang.actors;
|
||||||
|
|
||||||
public class BrokenPromise extends RuntimeException {
|
public class BrokenPromise extends RuntimeException {
|
||||||
private Promise<?> _promise;
|
private final Promise<?> _promise;
|
||||||
|
|
||||||
public BrokenPromise(Promise<?> promise) {
|
public BrokenPromise(Promise<?> promise) {
|
||||||
super(promise.getReason());
|
super(promise.getReason());
|
||||||
|
|
|
@ -3,7 +3,7 @@ package org.syndicate_lang.actors;
|
||||||
import java.util.concurrent.ScheduledFuture;
|
import java.util.concurrent.ScheduledFuture;
|
||||||
|
|
||||||
public class PeriodicTimer {
|
public class PeriodicTimer {
|
||||||
private ScheduledFuture<?> _future;
|
private final ScheduledFuture<?> _future;
|
||||||
|
|
||||||
protected PeriodicTimer(ScheduledFuture<?> future) {
|
protected PeriodicTimer(ScheduledFuture<?> future) {
|
||||||
this._future = future;
|
this._future = future;
|
||||||
|
|
|
@ -5,7 +5,6 @@ import java.util.List;
|
||||||
import java.util.concurrent.*;
|
import java.util.concurrent.*;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.function.Supplier;
|
|
||||||
|
|
||||||
public class Promise<T> implements Future<T> {
|
public class Promise<T> implements Future<T> {
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
package org.syndicate_lang.actors;
|
package org.syndicate_lang.actors;
|
||||||
|
|
||||||
import java.lang.reflect.InvocationHandler;
|
|
||||||
import java.lang.reflect.InvocationTargetException;
|
|
||||||
import java.lang.reflect.Method;
|
|
||||||
import java.lang.reflect.Proxy;
|
import java.lang.reflect.Proxy;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package org.syndicate_lang.actors;
|
package org.syndicate_lang.actors;
|
||||||
|
|
||||||
import java.lang.reflect.InvocationHandler;
|
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
|
@ -10,7 +9,7 @@ public class SyncProxy<T> extends AbstractProxy<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object dispatch(Method method, Object[] args) throws Throwable {
|
public Object dispatch(Method method, Object[] args) {
|
||||||
return this._ref.sync((v) -> {
|
return this._ref.sync((v) -> {
|
||||||
try {
|
try {
|
||||||
return method.invoke(v, args);
|
return method.invoke(v, args);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
package org.syndicate_lang.actors;
|
package org.syndicate_lang.actors;
|
||||||
|
|
||||||
public interface ThrowingSupplier<T> {
|
public interface ThrowingSupplier<T> {
|
||||||
public T get() throws Throwable;
|
T get() throws Throwable;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
ring.beam
|
|
@ -1,6 +1,6 @@
|
||||||
package org.syndicate_lang.actors.example.example1;
|
package org.syndicate_lang.actors.example.example1;
|
||||||
|
|
||||||
public interface IValueHolder<T> {
|
public interface IValueHolder<T> {
|
||||||
public T get();
|
T get();
|
||||||
public void set(T newValue);
|
void set(T newValue);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package org.syndicate_lang.actors.example.example1;
|
package org.syndicate_lang.actors.example.example1;
|
||||||
|
|
||||||
import java.util.concurrent.Future;
|
|
||||||
|
|
||||||
public class ValueHolder<T> implements IValueHolder<T> {
|
public class ValueHolder<T> implements IValueHolder<T> {
|
||||||
private T value;
|
private T value;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package org.syndicate_lang.actors.example.example2;
|
package org.syndicate_lang.actors.example.example2;
|
||||||
|
|
||||||
import org.syndicate_lang.actors.Remote;
|
import org.syndicate_lang.actors.Remote;
|
||||||
// import java.util.Random;
|
|
||||||
|
|
||||||
public class Forwarder implements IForwarder {
|
public class Forwarder implements IForwarder {
|
||||||
private final Remote<IForwarder> _main;
|
private final Remote<IForwarder> _main;
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package org.syndicate_lang.actors.example.example2;
|
package org.syndicate_lang.actors.example.example2;
|
||||||
|
|
||||||
import org.syndicate_lang.actors.Actor;
|
|
||||||
import org.syndicate_lang.actors.Remote;
|
import org.syndicate_lang.actors.Remote;
|
||||||
|
|
||||||
public interface IForwarder {
|
public interface IForwarder {
|
||||||
|
|
Loading…
Reference in New Issue