saker.build Documentation TaskDoc JavaDoc
Annotation to define an exception type to rethrow instead of an RMI error. (Subclass of RMIRuntimeException)

If an RMI error occurs and a subclass of RMIRuntimeException would be thrown then annotating a method with this can be used to replace the thrown exception. The specified type must have a constructor with a single Throwable or RMIRuntimeException parameter.

If the exception type specified in value() is a checked exception, then the annotated method must declare it or any of its superclass in its throws clause.

This annotation can be used to signal exceptions to the caller using a different kind. E.g. If I/O operations are done over RMI, then rethrowing RMI errors using IOException can be a good idea.

If a method is annotated with RMIForbidden then no calls will be made over the connection and the exception specified using this annotation will be directly thrown.

Methods
public Class<extends Throwable>
The type of the exception that should be rethrown.
public abstract Class<extends Throwable> value()
The type of the exception that should be rethrown.
The exception type.