|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IResolve
Blocking IAdaptable, used to contact external services.
IAdaptable
Nested Class Summary | |
---|---|
static class |
IResolve.Status
|
Method Summary | ||
---|---|---|
|
canResolve(java.lang.Class<T> adaptee)
Required adaptions will be listed in Abstract Classes under the resolve() method. |
|
void |
dispose(IProgressMonitor monitor)
Clean up after aquired resources - the handle will not function after being disposed. |
|
java.net.URL |
getIdentifier()
A unique resource identifier ... |
|
java.lang.Throwable |
getMessage()
Text description for this serice status. |
|
IResolve.Status |
getStatus()
Status information for this service. |
|
java.util.List<? extends IResolve> |
members(IProgressMonitor monitor)
Contents of this handle, Collections.EMPTY_LIST iff this is a leaf. |
|
IResolve |
parent(IProgressMonitor monitor)
The parent of this handle, may be null if parent unknown. |
|
|
resolve(java.lang.Class<T> adaptee,
IProgressMonitor monitor)
Will attempt to morph into the adaptee, and return that object. |
Method Detail |
---|
<T> T resolve(java.lang.Class<T> adaptee, IProgressMonitor monitor) throws java.io.IOException
Required adaptions will be listed in Abstract Classes, along with the method they will call. IResolve implementations are encouraged to follow this practice - documenting what adapters are required.
The extensible interface pattern also demands that the set of adapters be open-ended; we have provided an extention point to let others teach the system new tricks at configuration time. Here is a code example that every implementation needs to follow in order to make use of the IResolveManager:
public T resolve( Class adaptee, IProgressMonitor monitor ) throws IOException {
if (monitor == null)
monitor = new NullProgressMonitor();
if (adaptee == null)
throw new NullPointerException("No adaptor specified" );
if (adaptee.isAssignableFrom(TYPE.class)) {
return adaptee.cast(METHOD(monitor));
}
...
IResolveManager rm = CatalogPlugin.getDefault().getResolveManager();
if (rm.canResolve(this, adaptee)) {
return rm.resolve(this, adaptee, monitor);
}
return null; // could not find adapter
}
May Block.
adaptee
- monitor
- May Be Null
java.io.IOException
- if result was unavailable due to a technical problem<T> boolean canResolve(java.lang.Class<T> adaptee)
Restrictions on implementations:
The following code example shows intended practice:
public boolean canResolve( Class adaptee ){
return adaptee != null && (
adaptee.isAssignableFrom(TYPE.class) ||
CatalogPlugin.getDefault().getResolveManager().canResolve(this, adaptee)
);
}
resolve(Class, IProgressMonitor);
IResolve parent(IProgressMonitor monitor) throws java.io.IOException
monitor
- used to provide feedback during parent lookup
java.io.IOException
- in the event of a technical problemjava.util.List<? extends IResolve> members(IProgressMonitor monitor) throws java.io.IOException
monitor
- Monitor used to provide feedback during member lookup
java.io.IOException
- in the event of a technical problemIResolve.Status getStatus()
In the future this may be extended into a bit mask of connection status.
java.lang.Throwable getMessage()
For a BROKEN status this will contain the error message, null will be returned if there is nothing interesting to report.
Not the Exception is ecpected to be in humar readable, terms.
java.net.URL getIdentifier()
void dispose(IProgressMonitor monitor)
monitor
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |