protected Handle executeDirectly(Object entity, Executable e, SynchronizerListener l) { Handle res = null; { Synchronizer synchronizer = executingSynchronizer; Handle handle = synchronizer.execute(entity, e, l); res = new ExecuteHandle(handle, entity, e); } return res; }
public void cancel(Handle h) { if (h != null) { if (!(h instanceof ExecuteHandle)) { throw new IllegalArgumentException(); } ExecuteHandle handle = (ExecuteHandle) h; Object entity = handle.entity; Executable e = handle.e; Handle subHandle = handle.handle; Synchronizer synchronizer = getSynchronizer(entity, e); synchronizer.cancel(subHandle); } }
public LockListener getLockListener() { LockListener res = null; { if (resource != null) { res = resource.getLockListener(); } } return res; }
public Properties getProperties() { Properties res = null; { if (resource != null) { res = resource.getProperties(); } } return res; }
public List<Object> getEntities() { List<Object> res = null; { if (resource != null) { res = resource.getEntities(); } } return res; }
public boolean awaitShutdown(long timeout) throws InterruptedException { boolean res = false; { if (resource != null) { res = resource.awaitShutdown(timeout); } } return res; }
public TimeModel getTimeModel() { TimeModel res = null; { if (resource != null) { res = resource.getTimeModel(); } } return res; }
public Handle execute(Object entity, Executable e, SynchronizerListener l) { Handle res = null; { if (resource != null) { resource.execute(entity, e, l); } } return res; }
public synchronized boolean awaitShutdown(long timeout) throws InterruptedException { boolean res = false; { long t0 = System.currentTimeMillis(); long t1 = t0 + timeout; long timeoutLeft = timeout; // Await shutdown of the executing synchronizer: { if (executingSynchronizer != null) { executingSynchronizer.awaitShutdown(timeoutLeft); } } // Await shutdown of the locking synchronizers: { if (lockingSynchronizers != null) { synchronized (lockingSynchronizers) { Collection<LockingSynchronizer> v = lockingSynchronizers.values(); if (v != null) { for (LockingSynchronizer synchronizer : v) { long t = System.currentTimeMillis(); timeoutLeft = t1 - t; if (timeoutLeft <= 0) { break; } else { synchronizer.awaitShutdown(timeoutLeft); } } } } } } } return res; }
public synchronized void shutdown() { // Shutdown the executing synchronizer: { if (executingSynchronizer != null) { executingSynchronizer.shutdown(); } } // Shutdown the locking synchronizers: { Map<Object, LockingSynchronizer> lockingSynchronizers = this.lockingSynchronizers; if (lockingSynchronizers != null) { synchronized (lockingSynchronizers) { Collection<LockingSynchronizer> v = lockingSynchronizers.values(); if (v != null) { for (LockingSynchronizer synchronizer : v) { synchronizer.shutdown(); } } } } } }
public void setTimeModel(TimeModel timeModel) { if (resource != null) { resource.setTimeModel(timeModel); } }
protected synchronized void disposeExecutingSynchronizer() { if (executingSynchronizer != null) { executingSynchronizer.dispose(); executingSynchronizer = null; } }
public void shutdown() { if (resource != null) { resource.shutdown(); } }
public void awaitShutdown() throws InterruptedException { if (resource != null) { resource.awaitShutdown(); } }
public void dispose() { if (resource != null) { resource.dispose(); resource = null; } }
public void setLockListener(LockListener lockListener) { if (resource != null) { resource.setLockListener(lockListener); } }
public void cancel(Handle h) { if (resource != null) { resource.cancel(h); } }