Subversion Repositories pub

Compare Revisions

Ignore whitespace Rev 48 → Rev 49

/pluggablejs/trunk/src/net/outlyer/plugins/sandboxing/SandboxAccessorImpl.java
0,0 → 1,23
package net.outlyer.plugins.sandboxing;
 
import java.util.concurrent.Callable;
 
/**
* {@see SandboxAccessor}
*/
public abstract class SandboxAccessorImpl implements SandboxAccessor {
public Callable<Sandbox> _getSandbox;
protected final Sandbox getSandbox() {
if (null == _getSandbox) {
throw new IllegalStateException(getClass()+" hasn't been correctly initialised");
}
try {
return _getSandbox.call();
}
catch (final Exception e) {
throw new IllegalStateException("getSandbox produced an exception, which is not expected!");
}
}
}