Package net.jini.security
Interface TrustVerifier.Context
- Enclosing interface:
- TrustVerifier
public static interface TrustVerifier.Context
Defines the context for trust verification used by
TrustVerifier instances and Security.verifyObjectTrust. A context contains an ordered list of
TrustVerifier instances, a class loader, and a collection of other context objects
typically provided by the caller of Security.verifyObjectTrust.- Since:
- 2.0
-
Method Summary
Modifier and TypeMethodDescriptionReturns a collection of context objects for use by trust verifiers.Returns the class loader that can be used as a basis for trust verification.booleanisTrustedObject(Object obj) Returnstrueif the specified object is trusted to correctly implement its contract; returnsfalseotherwise.
-
Method Details
-
isTrustedObject
Returnstrueif the specified object is trusted to correctly implement its contract; returnsfalseotherwise.If the specified object is
null, this method returnstrue. Otherwise, theisTrustedObjectmethod of each verifier contained in this context is called (in order) with the specified object and this context. If any verifier call returnstrue, the object is trusted and this method returnstrue. If all of the verifier calls returnfalse, this method returnsfalse. If one or more verifier calls throw aRemoteExceptionorSecurityException, the last such exception is thrown to the caller (unless some verifier call returnstrue).- Parameters:
obj- the object in which to verify trust- Returns:
trueif the specified object is trusted to correctly implements its contract;falseotherwise- Throws:
RemoteException- if a communication-related exception occursSecurityException- if a security exception occurs
-
getClassLoader
ClassLoader getClassLoader()Returns the class loader that can be used as a basis for trust verification. In particular, classes and resources reachable from this class loader can be assumed to be trustworthy. Anullvalue is interpreted to mean the current context class loader.- Returns:
- the class loader that can be used as a basis for trust verification
-
getCallerContext
Collection getCallerContext()Returns a collection of context objects for use by trust verifiers. The meaning of an element in this collection is determined by its type. As a specific example, aMethodConstraintsinstance could be used to specify client constraints for any remote calls that trust verifiers might need to perform.- Returns:
- a collection of context objects for use by trust verifiers
-