@Override public TCObject lookupOrCreate(final Object obj, GroupID gid) { if (obj instanceof Manageable) { TCObject tco = ((Manageable) obj).__tc_managed(); if (tco != null) { return tco; } } return this.objectManager.lookupOrCreate(obj, gid); }
@Override public TCObject lookupOrCreate(final Object obj, GroupID gid) { if (obj instanceof Manageable) { TCObject tco = ((Manageable) obj).__tc_managed(); if (tco != null) { return tco; } } return this.objectManager.lookupOrCreate(obj, gid); }
@Override public void deserialize(ObjectInput in) throws IOException { this.version = in.readLong(); ObjectID newId = new ObjectID(in.readLong()); if (oid != null) { throw new AssertionError("Old oid=" + oid + " id=" + newId); } this.oid = newId; // Assuming isNew to be false this.isNew = false; if (this instanceof Manageable) { ((Manageable) this).__tc_managed(this); } }
@Override public void deserialize(ObjectInput in) throws IOException { this.version = in.readLong(); ObjectID newId = new ObjectID(in.readLong()); if (oid != null) { throw new AssertionError("Old oid=" + oid + " id=" + newId); } this.oid = newId; // Assuming isNew to be false this.isNew = false; if (this instanceof Manageable) { ((Manageable) this).__tc_managed(this); } }
@Override public TCObject lookupOrCreate(final Object obj, GroupID gid) { if (obj instanceof Manageable) { TCObject tco = ((Manageable) obj).__tc_managed(); if (tco != null) { return tco; } } return this.objectManager.lookupOrCreate(obj, gid); }
@Override public TCObject lookupOrCreate(final Object obj) { if (obj instanceof Manageable) { TCObject tco = ((Manageable) obj).__tc_managed(); if (tco != null) { return tco; } } return this.objectManager.lookupOrCreate(obj); }
@Override public TCObject lookupOrCreate(final Object obj) { if (obj instanceof Manageable) { TCObject tco = ((Manageable) obj).__tc_managed(); if (tco != null) { return tco; } } return this.objectManager.lookupOrCreate(obj); }
@Override public TCObject lookupExistingOrNull(final Object pojo) { if (pojo == null) { return null; } if (pojo instanceof Manageable) { return ((Manageable) pojo).__tc_managed(); } try { return this.objectManager.lookupExistingOrNull(pojo); } catch (final Throwable t) { Util.printLogAndRethrowError(t, logger); // shouldn't get here throw new AssertionError(); } }
@Override public TCObject lookupExistingOrNull(final Object pojo) { if (pojo == null) { return null; } if (pojo instanceof Manageable) { return ((Manageable) pojo).__tc_managed(); } try { return this.objectManager.lookupExistingOrNull(pojo); } catch (final Throwable t) { Util.printLogAndRethrowError(t, logger); // shouldn't get here throw new AssertionError(); } }
@Override public TCObject getNewInstance(ObjectID id, Object peer, Class clazz, boolean isNew) { TCClass tcc = clazzFactory.getOrCreate(clazz, objectManager); TCObject rv = tcc.createTCObject(id, peer, isNew); if (peer instanceof Manageable) { ((Manageable) peer).__tc_managed(rv); } return rv; }
private String getInstanceDsoLockName() { if (this.instanceDsoLockName != null) { return this.instanceDsoLockName; } // The trailing colon (':') is relevant to avoid unintended lock collision when appending object ID to the key // Without the delimiter you'd get the same effective lock for oid 11, lockId 10 and oid 1 and lockId 110 this.instanceDsoLockName = "@" + "CDM" + ((Manageable) this).__tc_managed().getObjectID().toLong() + ":"; return this.instanceDsoLockName; }
private String getInstanceDsoLockName() { if (this.instanceDsoLockName != null) { return this.instanceDsoLockName; } // The trailing colon (':') is relevant to avoid unintended lock collision when appending object ID to the key // Without the delimiter you'd get the same effective lock for oid 11, lockId 10 and oid 1 and lockId 110 this.instanceDsoLockName = "@" + "CDM" + ((Manageable) this).__tc_managed().getObjectID().toLong() + ":"; return this.instanceDsoLockName; }
private String getInstanceDsoLockName() { if (this.instanceDsoLockName != null) { return this.instanceDsoLockName; } // The trailing colon (':') is relevant to avoid unintended lock collision when appending object ID to the key // Without the delimiter you'd get the same effective lock for oid 11, lockId 10 and oid 1 and lockId 110 this.instanceDsoLockName = "@" + "CDSM" + ((Manageable) this).__tc_managed().getObjectID().toLong() + ":"; return this.instanceDsoLockName; }
@Override public TCObject getNewInstance(ObjectID id, Object peer, Class clazz, boolean isNew) { TCClass tcc = clazzFactory.getOrCreate(clazz, objectManager); TCObject rv = tcc.createTCObject(id, peer, isNew); if (peer instanceof Manageable) { ((Manageable) peer).__tc_managed(rv); } return rv; }
@Override public boolean isManaged(final Object obj) { if (obj instanceof Manageable) { final TCObject tcobj = ((Manageable) obj).__tc_managed(); return tcobj != null && tcobj.isShared(); } return this.objectManager.isManaged(obj); }
private String getInstanceDsoLockName() { if (this.instanceDsoLockName != null) { return this.instanceDsoLockName; } // The trailing colon (':') is relevant to avoid unintended lock collision when appending object ID to the key // Without the delimiter you'd get the same effective lock for oid 11, lockId 10 and oid 1 and lockId 110 this.instanceDsoLockName = "@" + "CDM" + ((Manageable) this).__tc_managed().getObjectID().toLong() + ":"; return this.instanceDsoLockName; }
@Override public boolean isManaged(final Object obj) { if (obj instanceof Manageable) { final TCObject tcobj = ((Manageable) obj).__tc_managed(); return tcobj != null && tcobj.isShared(); } return this.objectManager.isManaged(obj); }
@Override public <K> Map<K, Set<NodeID>> getNodesWithKeys(final TCMap tcMap, final Collection<? extends K> keys) { waitUntilRunning(); final ObjectID mapObjectID = ((Manageable) tcMap).__tc_managed().getObjectID(); return getNodesWithKeys(keys, mapObjectID); }
@Override public <K> Map<K, Set<NodeID>> getNodesWithKeys(final TCMap tcMap, final Collection<? extends K> keys) { waitUntilRunning(); final ObjectID mapObjectID = ((Manageable) tcMap).__tc_managed().getObjectID(); return getNodesWithKeys(keys, mapObjectID); }
@Override public <K> Map<K, Set<NodeID>> getNodesWithKeys(final TCMap tcMap, final Collection<? extends K> keys) { waitUntilRunning(); final ObjectID mapObjectID = ((Manageable) tcMap).__tc_managed().getObjectID(); return getNodesWithKeys(keys, mapObjectID); }