Performs operations on a proxy to prepare it for use, returning the prepared proxy, which may or may not be the argument itself.
The default implementation provides the following behavior. If proxy
is null
, throws a {@link NullPointerException}. Otherwise, calls {@link #verify(Object) verify}with proxy
. If the verify
call succeeds, calls {@link #grant grant} with proxy
. If the grant
call succeeds, returns the result of calling {@link #setConstraints setConstraints} with proxy
.
Subclasses may wish to override this method, for example, to perform additional operations, typically calling the default implementation via super
.
@param proxy the proxy to prepare
@return the prepared proxy
@throws NullPointerException if proxy
is null
@throws RemoteException if a communication-related exception occurs
@throws SecurityException if a security exception occurs
@see #verify(Object) verify
@see #grant grant
@see #setConstraints setConstraints