[
https://issues.apache.org/jira/browse/JCLOUDS-82?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13665010#comment-13665010
]
Ignasi Barrera commented on JCLOUDS-82:
---------------------------------------
Not that concrete method, because you will need a more complex
TypeToken<ApiContext<A>> to be able to properly unwrap the context and the Api
respecting the types.
In previous jclouds versions we bypassed this by adding the CONTEXT_TOKEN in
the ApiMetadata classes, but those tokens have been deprecated as part of the
unasync refactor. In their absence, Everett suggested to add this convenience
'unwrapApi' method (which is the natural evolution of the View interface), to
avoid having to build such a context token every time.
> Add a method to unwrap the target API from the view
> ---------------------------------------------------
>
> Key: JCLOUDS-82
> URL: https://issues.apache.org/jira/browse/JCLOUDS-82
> Project: jclouds
> Issue Type: Sub-task
> Components: jclouds-core
> Reporter: Ignasi Barrera
> Assignee: Ignasi Barrera
> Fix For: 1.7.0
>
>
> See the comments in the parent issue.
> Add an unwrapApi() method to get at the underlying Api from a View. For
> example:
> ComputeServiceContext context =
> ContextBuilder.newBuilder("rackspace-cloudservers-us")
> .credentials(username, apiKey)
> .buildView(ComputeServiceContext.class);
> ComputeService compute = context.getComputeService();
> NovaApi novaApi = context.unwrapApi(NovaApi.class);
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira