Package org.apache.thrift.server
Interface ServerContext
public interface ServerContext
-
Method Summary
Modifier and TypeMethodDescriptionboolean
isWrapperFor
(Class<?> iface) Returns true if this server context is a wrapper for the provided application specific context interface argument or returns false otherwise.<T> T
Returns an object that implements the given interface to allow access to application specific contexts.
-
Method Details
-
unwrap
Returns an object that implements the given interface to allow access to application specific contexts.- Parameters:
iface
- A Class defining an interface that the result must implement- Returns:
- an object that implements the interface
- Throws:
RuntimeException
- If the context cannot be unwrapped to the provided class
-
isWrapperFor
Returns true if this server context is a wrapper for the provided application specific context interface argument or returns false otherwise.- Parameters:
iface
- a Class defining the underlying context- Returns:
- true if this implements the interface can be unwrapped to the provided class
- Throws:
RuntimeException
- if an error occurs while determining whether the provided class can be unwrapped from this context.
-