Skip to content
Permalink
Browse files

Merge pull request #12213 from rhusar/WFLY-9951

WFLY-9951 Remotable exception caused by non-remotable Infinispan Cach…
  • Loading branch information
pferraro committed Apr 6, 2019
2 parents db287c9 + 39acc63 commit 049e38e9d04df3c06707d2d54eb2e2a6ec7d4f23
@@ -190,8 +190,15 @@ public void stop() {
}

@Override
public boolean isRemotable(Throwable throwable) {
return !(throwable instanceof CacheException);
public boolean isRemotable(final Throwable throwable) {
Throwable subject = throwable;
while (subject != null) {
if (subject instanceof CacheException) {
return false;
}
subject = subject.getCause();
}
return true;
}

@Override
@@ -47,7 +47,8 @@
import org.junit.runner.RunWith;

/**
* Test for WFLY-5788.
* Test for WFLY-5788 and WFLY-9951.
*
* @author Radoslav Husar
*/
@RunWith(Arquillian.class)
@@ -25,20 +25,22 @@
import javax.ejb.Remote;
import javax.ejb.Stateful;

import org.infinispan.statetransfer.OutdatedTopologyException;
import org.infinispan.commons.CacheException;
import org.infinispan.util.concurrent.TimeoutException;

/**
* Implementation of {@link Incrementor} which always throws a {@link RuntimeException}: an Infinispan's {@link OutdatedTopologyException}.
* Implementation of {@link Incrementor} which always throws a standard remotable (known to a client classloader) exception
* which is caused by an Infinispan {@link RuntimeException} {@link CacheException} {@link TimeoutException} which the client
* typically cannot load the class for.
*
* @author Radoslav Husar
* @version January 2016
*/
@Stateful
@Remote(Incrementor.class)
public class InfinispanExceptionThrowingIncrementorBean implements Incrementor {

@Override
public Result<Integer> increment() {
throw new OutdatedTopologyException("Remote values are missing because of a topology change");
throw new IllegalStateException("standard remotable exception that is caused by non-remotable infinispan CacheException", new TimeoutException("the non-remotable infinispan cause"));
}
}

0 comments on commit 049e38e

Please sign in to comment.
You can’t perform that action at this time.