net.refractions.udig.core
Interface IBlockingAdaptable


public interface IBlockingAdaptable

Objects that implement this interface can adapt to other objects but require that it be done is a separate job because the adaptation may be blocking.

Author:
jeichar
See Also:
org.eclipse.core.runtime.IAdaptable

Method Summary
<T> boolean
canAdaptTo(java.lang.Class<T> adapter)
          Returns true if this class can adapt to an object of type Class
<T> T
getAdapter(java.lang.Class<T> adapter, IProgressMonitor monitor)
          The class will attempt to adapt into an object of the adapter class.
 

Method Detail

getAdapter

<T> T getAdapter(java.lang.Class<T> adapter,
                 IProgressMonitor monitor)
             throws java.io.IOException
The class will attempt to adapt into an object of the adapter class. This method may be blocking.

Parameters:
adapter - The class that the object will attempt to change into.
monitor - A monitor to track the progress of the adaptation.
Returns:
an object of type T or null if the adaptation is not possible.
Throws:
java.io.IOException - may throw an IOException if the adaptation fails.

canAdaptTo

<T> boolean canAdaptTo(java.lang.Class<T> adapter)
Returns true if this class can adapt to an object of type Class

It does not guarantee that the object can adapt, just that it believes it can

Parameters:
adapter - the adapter to adapt to.
Returns:
true if the object believes that it can adapt to an object class T.