@Beta
public interface View
View
allows access to the provider-specific, or library-driven api
behind an abstraction. One backend context can support multiple views.
For example, the CloudStackContext
can be backend by both
ComputeServiceContext
and LoadBalancerServiceContext
, as the
api covers these features.Modifier and Type | Method and Description |
---|---|
com.google.common.reflect.TypeToken<?> |
getBackendType() |
<C extends Context> |
unwrap()
shortcut for
unwrap(getWrappedType()) |
<C extends Context> |
unwrap(Class<C> clazz)
shortcut for
unwrap(TypeToken.of(clazz)) |
<C extends Context> |
unwrap(com.google.common.reflect.TypeToken<C> type)
Return an object of the specified type to allow access to the backend
context.
|
com.google.common.reflect.TypeToken<?> getBackendType()
<C extends Context> C unwrap(com.google.common.reflect.TypeToken<C> type) throws IllegalArgumentException
IllegalArgumentException
is thrown.
ex.
RestContextbackendApi = computeContext.unwrap(NovaApiMetadata.CONTEXT_TOKEN);
type
- the type of the context to be returned. The backend context must
be assignable from this type.IllegalArgumentException
- if the backend context is not assignable from the specified
class.getBackendType()
<C extends Context> C unwrap(Class<C> clazz) throws IllegalArgumentException
unwrap(TypeToken.of(clazz))
IllegalArgumentException
unwrap(TypeToken)
<C extends Context> C unwrap() throws ClassCastException
unwrap(getWrappedType())
ClassCastException
- if the user supplied C
param is not assignableFrom
getBackendType()
Copyright © 2009-2013 jclouds. All Rights Reserved.