/** The general lookup method. * @param template the template describing the services we are looking for * @return object containing the results */ public final Lookup.Result lookup (Lookup.Template template) { for (;;) { AbstractLookup.ISE toRun = null; AbstractLookup.Storage t = enterStorage (); try { R r = new R (); ReferenceToResult newRef = new ReferenceToResult (r, this, template); newRef.next = t.registerReferenceToResult (newRef); return r; } catch (AbstractLookup.ISE ex) { toRun = ex; } finally { exitStorage (); } toRun.recover (this); // and try again } }
/** The general lookup method. * @param template the template describing the services we are looking for * @return object containing the results */ public final Lookup.Result lookup (Lookup.Template template) { for (;;) { AbstractLookup.ISE toRun = null; AbstractLookup.Storage t = enterStorage (); try { R r = new R (); ReferenceToResult newRef = new ReferenceToResult (r, this, template); newRef.next = t.registerReferenceToResult (newRef); return r; } catch (AbstractLookup.ISE ex) { toRun = ex; } finally { exitStorage (); } toRun.recover (this); // and try again } }
@Override public final <T> Lookup.Result<T> lookup(Lookup.Template<T> template) { beforeLookupResult(template); for (;;) { AbstractLookup.ISE toRun = null; AbstractLookup.Storage<?> t = enterStorage(); try { R<T> r = new R<T>(); ReferenceToResult<T> newRef = new ReferenceToResult<T>(r, this, template); newRef.next = t.registerReferenceToResult(newRef); return r; } catch (AbstractLookup.ISE ex) { toRun = ex; } finally { exitStorage(); } toRun.recover(this); // and try again } }
public final <T> Lookup.Result<T> lookup(Lookup.Template<T> template) { for (;;) { AbstractLookup.ISE toRun = null; AbstractLookup.Storage<?> t = enterStorage(); try { R<T> r = new R<T>(); ReferenceToResult<T> newRef = new ReferenceToResult<T>(r, this, template); newRef.next = t.registerReferenceToResult(newRef); return r; } catch (AbstractLookup.ISE ex) { toRun = ex; } finally { exitStorage(); } toRun.recover(this); // and try again } }
@Override public final <T> Lookup.Result<T> lookup(Lookup.Template<T> template) { beforeLookupResult(template); for (;;) { AbstractLookup.ISE toRun = null; AbstractLookup.Storage<?> t = enterStorage(); try { R<T> r = new R<T>(); ReferenceToResult<T> newRef = new ReferenceToResult<T>(r, this, template); newRef.next = t.registerReferenceToResult(newRef); return r; } catch (AbstractLookup.ISE ex) { toRun = ex; } finally { exitStorage(); } toRun.recover(this); // and try again } }