Quoting Andrew Bayer <[email protected]>:

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...

Am I guessing that a direct link between Context or View and Api would be ideal? So you could do something like e.g. EC2Api.class.isAssignableFrom(view.getBackendApi())..?

Perhaps worth looking at whether a

Class<? extends Closeable> getBackendApi()

or

TypeToken<? extends Closeable> getBackendApi()

method could be added to View, alongside potentially a

/**
 * equivalent to unwrapApi(getBackendApi())
 */
Closeable unwrapApi()

?

ap

Reply via email to