[ 
https://issues.apache.org/jira/browse/JCLOUDS-82?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13665022#comment-13665022
 ] 

Ignasi Barrera commented on JCLOUDS-82:
---------------------------------------

In fact Everett proposed to add the simple unwrapApi() method, without the 
class argument, but Adrian suggested to add just the one with the class (see 
parent issue comments).
I agree that if we add the unwrapApi() we would need to "un-deprecate" those 
context tokens again, because they are useful in that case.
In the end it is a matter of taste. You end up having to know which 
CONTEXT_TOKEN to use, or know which class to use. I personally like the idea of 
having to pass the api class, and not having the method without the parameter 
(most times users will need to manually provide the typetoken) so I don't think 
is widely used.

Anyway, if anyone feels like the unwrapApi() method should be added too, let's 
discuss it here and I'll add it as part of this issue :)
                
> 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

Reply via email to