/** * Determine whether this class is physically instrumented * * @param clazz Class * @return True if physically instrumented */ protected static boolean isPhysicallyInstrumented(final Class clazz) { return getManager().isPhysicallyInstrumented(clazz); }
/** * Find or create new TCObject * * @param obj The object instance * @return The TCObject */ protected static TCObject lookupOrCreate(final Object obj) { return getManager().lookupOrCreate(obj); }
/** * @return true if obj is an instance of a {@link com.tc.object.LiteralValues literal type}, e.g., Class, Integer, * etc. */ protected static boolean isLiteralInstance(final Object obj) { return getManager().isLiteralInstance(obj); }
/** * Get Unique Client identifier * * @return Unique Client identifier */ protected static String getUUID() { return getManager().getUUID(); }
/** * Look up or create a new root object in the particular group id */ protected static Object lookupRoot(final String name, GroupID gid) { return getManager().lookupRoot(name, gid); }
/** * Create or replace root, typically used for replaceable roots. * * @param rootName Root name * @param object Root object * @return Root object used * @throws AbortedOperationException */ protected static Object createOrReplaceRoot(final String rootName, final Object object) throws AbortedOperationException { return getManager().createOrReplaceRoot(rootName, object); }
/** * Find or create new TCObject * * @param obj The object instance * @return The TCObject */ protected static TCObject lookupOrCreate(final Object obj) { return getManager().lookupOrCreate(obj); }
/** * Check whether object is logically instrumented * * @param obj Instance * @return True if logically instrumented */ protected static boolean isLogical(final Object obj) { return getManager().isLogical(obj); }
/** * Check whether field is a root * * @param field Field * @return True if root */ protected static boolean isRoot(final Field field) { return getManager().isRoot(field); }
static DsoCluster determineDsoClusterInstance(DsoCluster cluster) { DsoCluster dsoCluster; try { dsoCluster = ManagerUtil.getManager().getDsoCluster(); } catch (UnsupportedOperationException e) { dsoCluster = cluster; } catch (NoClassDefFoundError e) { dsoCluster = cluster; } return dsoCluster; } }
/** * Get the named logger * * @param loggerName Logger name * @return The logger */ public static TCLogger getLogger(final String loggerName) { return getManager().getLogger(loggerName); }
public boolean tryLock(long timeout, TimeUnit unit) throws InterruptedException { try { return ManagerUtil.getManager().tryLock(lockId, LockLevel.fromInt(lockLevel), unit.toMillis(timeout)); } catch (Error e) { if (!"com.tc.exception.TCLockUpgradeNotSupportedError".equals(e.getClass().getName())) { throw e; } unit.sleep(timeout); return false; } }
public boolean tryLock(long timeout, TimeUnit unit) throws InterruptedException { try { return ManagerUtil.getManager().tryLock(lockId, LockLevel.fromInt(lockLevel), unit.toMillis(timeout)); } catch (Error e) { if (!"com.tc.exception.TCLockUpgradeNotSupportedError".equals(e.getClass().getName())) { throw e; } unit.sleep(timeout); return false; } }
protected static void lockIDWait(final Object lockID, long time, TimeUnit unit) throws InterruptedException, AbortedOperationException { Manager mgr = getManager(); LockID lock = mgr.generateLockIdentifier(lockID); mgr.lockIDWait(lock, unit.toMillis(time)); }
public boolean tryLock(final LockType lockType) { try { return ManagerUtil.getManager().tryLock(lockId, LockLevel.fromInt(LockingUtils.translateLockType(lockType))); } catch (Error e) { if (!"com.tc.exception.TCLockUpgradeNotSupportedError".equals(e.getClass().getName())) { throw e; } return false; } }
protected static boolean tryBeginLock(final Object obj, final LockLevel level) throws AbortedOperationException { Manager mgr = getManager(); LockID lock = mgr.generateLockIdentifier(obj); return mgr.tryLock(lock, level); }
/** * Perform untimed wait on obj * * @param obj Instance * @throws AbortedOperationException */ protected static void objectWait(final Object obj) throws InterruptedException, AbortedOperationException { Manager mgr = getManager(); LockID lock = mgr.generateLockIdentifier(obj); mgr.wait(lock, obj); }
protected static void pinLock0(final String lockID) { Manager mgr = getManager(); LockID lock = mgr.generateLockIdentifier(lockID); mgr.pinLock(lock); }
/** * Commit lock * * @param lockID Lock name * @throws AbortedOperationException */ protected static void commitLock(final Object lockID, final LockLevel level) throws AbortedOperationException { Manager mgr = getManager(); LockID lock = mgr.generateLockIdentifier(lockID); mgr.unlock(lock, level); }
private WANConcurrentMapDsoInstrumented(final int lockLevel) { // ensure that DSO is active at construction time, ie. fail fast Assert.pre(!(ManagerUtil.getManager() instanceof NullManager)); this.dsoLockType = lockLevel; store = new NonBlockingHashMap(); Assert.post(store != null); }