com.threerings.presents.server
Class InvocationException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.threerings.presents.server.InvocationException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
Resulting.ReusableInvocationException

public class InvocationException
extends Exception

Used to report failures when executing service requests.

See Also:
Serialized Form

Constructor Summary
InvocationException(String cause)
          Constructs an invocation exception with the supplied cause code string.
InvocationException(String bundle, String code)
          Constructs an invocation exception with the supplied cause code string and qualifying message bundle.
 
Method Summary
static void require(boolean condition, String errmsg)
          Requires that the supplied condition be true, otherwise an invocation exception with the supplied error message is thrown.
static void requireAccess(ClientObject clobj, Permission perm)
          A version of requireAccess(ClientObject,Permission,Object) that takes no context.
static void requireAccess(ClientObject clobj, Permission perm, Object context)
          Requires that the specified client have the specified permissions.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InvocationException

public InvocationException(String cause)
Constructs an invocation exception with the supplied cause code string.


InvocationException

public InvocationException(String bundle,
                           String code)
Constructs an invocation exception with the supplied cause code string and qualifying message bundle. The error code will be qualified with the message bundle (see MessageBundle.qualify(java.lang.String, java.lang.String)).

Method Detail

requireAccess

public static void requireAccess(ClientObject clobj,
                                 Permission perm,
                                 Object context)
                          throws InvocationException
Requires that the specified client have the specified permissions.

Throws:
InvocationException - if they do not.

requireAccess

public static void requireAccess(ClientObject clobj,
                                 Permission perm)
                          throws InvocationException
A version of requireAccess(ClientObject,Permission,Object) that takes no context.

Throws:
InvocationException

require

public static void require(boolean condition,
                           String errmsg)
                    throws InvocationException
Requires that the supplied condition be true, otherwise an invocation exception with the supplied error message is thrown.

Throws:
InvocationException