The if is there to see what the actual provider/API is - this is from
Whirr, checking to see what API's in use so we can figure out what to do
about security groups/firewalls. I'll see if I can come up with something
cleaner...

A.

On Mon, Aug 5, 2013 at 11:30 AM, Andrew Phillips <[email protected]>wrote:

> So I guess we're stuck with that godawful amount of text for 1.6.x, and
>> slightly less for 1.7. It'd still be nice to have something like the old
>> CONTEXT_TOKEN for the de-async world, though.
>>
>
> If I understand correctly, the goal here is to verify that the "unwrap"
> call will succeed, and I guess we're looking to avoid nasty
> "try...catch"-style solutions?
>
> How about something like the following - not exactly less typing, but
> still:
>
> ApiMetadata apiMeta = ctx.getProviderMetadata().**getApiMetadata();
> if ((apiMeta instanceof HttpApiMetadata) && EC2Api.class.isAssignableFrom(
> **(HttpApiMetdata) apiMeta).getApi())){
>   ...
> }
>
> Of course, if you're expecting it to be an HttpApiMetdata, you can skip
> the instanceof check..?
>
> ap
>
>
> PS: Detail on the whole discussion around the deprecation of CONTEXT_TOKEN
> here:
>
> https://issues.apache.org/**jira/browse/JCLOUDS-82<https://issues.apache.org/jira/browse/JCLOUDS-82>
>

Reply via email to