public Transaction beginTransaction(int ensure) { try { return delegate.beginTransaction(ensure); } catch (UnsupportedOperationException ex) { // let's convert to InheritanceTree ArrayStorage arr = (ArrayStorage) delegate; InheritanceTree inh = new InheritanceTree(); changeDelegate(inh); // // Copy content // Enumeration<Pair<Object>> en = arr.lookup(Object.class); while (en.hasMoreElements()) { if (!inh.add(en.nextElement(), new ArrayList<Class>())) { throw new IllegalStateException("All objects have to be accepted"); // NOI18N } } // // Copy listeners // AbstractLookup.ReferenceToResult<?> ref = arr.cleanUpResult(null); if (ref != null) { ref.cloneList(inh); } // we have added the current content and now we can start transaction return delegate.beginTransaction(ensure); } }
ReferenceIterator it = new ReferenceIterator (first); while (it.next()) { Object result = it.current().getResult(); if (allAffectedResults != null) {
AbstractLookup.R result = it.current().getResult();
AbstractLookup.R result = it.current().getResult();
R<?> result = ref.get();
R<?> result = ref.get();
ReferenceIterator it = new ReferenceIterator (first); while (it.next()) { Object result = it.current().getResult(); if (allAffectedResults != null) {
R result = (R)ref.get (); if (result == null) { if (prev == null) {
R result = (R)ref.get (); if (result == null) { if (prev == null) {
public Transaction beginTransaction(int ensure) { try { return delegate.beginTransaction(ensure); } catch (UnsupportedOperationException ex) { // let's convert to InheritanceTree ArrayStorage arr = (ArrayStorage) delegate; InheritanceTree inh = new InheritanceTree(); changeDelegate(inh); // // Copy content // Enumeration<Pair<Object>> en = arr.lookup(Object.class); while (en.hasMoreElements()) { if (!inh.add(en.nextElement(), new ArrayList<Class>())) { throw new IllegalStateException("All objects have to be accepted"); // NOI18N } } // // Copy listeners // AbstractLookup.ReferenceToResult<?> ref = arr.cleanUpResult(null); if (ref != null) { ref.cloneList(inh); } // we have added the current content and now we can start transaction return delegate.beginTransaction(ensure); } }
public Transaction beginTransaction(int ensure) { try { return delegate.beginTransaction(ensure); } catch (UnsupportedOperationException ex) { // let's convert to InheritanceTree ArrayStorage arr = (ArrayStorage) delegate; InheritanceTree inh = new InheritanceTree(); changeDelegate(inh); // // Copy content // Enumeration<Pair<Object>> en = arr.lookup(Object.class); while (en.hasMoreElements()) { if (!inh.add(en.nextElement(), new ArrayList<Class>())) { throw new IllegalStateException("All objects have to be accepted"); // NOI18N } } // // Copy listeners // AbstractLookup.ReferenceToResult<?> ref = arr.cleanUpResult(null); if (ref != null) { ref.cloneList(inh); } // we have added the current content and now we can start transaction return delegate.beginTransaction(ensure); } }
ref.cloneList (delegate);
/** 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 } }