@Override public boolean distributedMethodCall(final Object receiver, final String method, final Object[] params, final boolean runOnAllNodes) { final TCObject tco = lookupExistingOrNull(receiver); try { if (tco != null) { return this.methodCallManager.distributedInvoke(receiver, method, params, runOnAllNodes); } else { return false; } } catch (final Throwable t) { Util.printLogAndRethrowError(t, logger); return false; } }
private void resolveClasses() { // fix for deadlock on JDK 1.5 (MNK-2890, MNK-2914) new Date().toString(); // See LKC-2323 -- A number of Manager methods can be entered from the internals of URLClassLoader (specifically // sun.misc.URLClassPath.getLoader()) and can cause deadlocks. Making sure these methods are invoked once, thus // resolving any class loads, should eliminate the problem. // // NOTE: it is entirely possible more signatures might need to added here final Object o = new Manageable() { @Override public void __tc_managed(final TCObject t) { throw new AssertionError(); } @Override public TCObject __tc_managed() { return null; } @Override public boolean __tc_isManaged() { return false; } }; lookupExistingOrNull(o); // lock(new StringLockID("test"), LockLevel.WRITE); // unlock(new StringLockID("test"), LockLevel.WRITE); logicalInvoke(new FakeManageableObject(), SerializationUtil.CLEAR_SIGNATURE, new Object[] {}); }
private void resolveClasses() { // fix for deadlock on JDK 1.5 (MNK-2890, MNK-2914) new Date().toString(); // See LKC-2323 -- A number of Manager methods can be entered from the internals of URLClassLoader (specifically // sun.misc.URLClassPath.getLoader()) and can cause deadlocks. Making sure these methods are invoked once, thus // resolving any class loads, should eliminate the problem. // // NOTE: it is entirely possible more signatures might need to added here final Object o = new Manageable() { @Override public void __tc_managed(final TCObject t) { throw new AssertionError(); } @Override public TCObject __tc_managed() { return null; } @Override public boolean __tc_isManaged() { return false; } }; lookupExistingOrNull(o); // lock(new StringLockID("test"), LockLevel.WRITE); // unlock(new StringLockID("test"), LockLevel.WRITE); logicalInvoke(new FakeManageableObject(), SerializationUtil.CLEAR_SIGNATURE, new Object[] {}); }
@Override public void logicalInvoke(final Object object, final String methodSignature, final Object[] params) { final Manageable m = (Manageable) object; if (m.__tc_managed() != null) { final TCObject tco = lookupExistingOrNull(object); try { if (tco != null) { if (SerializationUtil.ADD_ALL_SIGNATURE.equals(methodSignature)) { logicalAddAllInvoke(this.serializer.methodToID(methodSignature), methodSignature, (Collection) params[0], tco); } else if (SerializationUtil.ADD_ALL_AT_SIGNATURE.equals(methodSignature)) { logicalAddAllAtInvoke(this.serializer.methodToID(methodSignature), methodSignature, ((Integer) params[0]).intValue(), (Collection) params[1], tco); } else { adjustForJava1ParametersIfNecessary(methodSignature, params); tco.logicalInvoke(this.serializer.methodToID(methodSignature), methodSignature, params); } } } catch (final Throwable t) { Util.printLogAndRethrowError(t, logger); } } }
@Override public void logicalInvoke(final Object object, final String methodSignature, final Object[] params) { final Manageable m = (Manageable) object; if (m.__tc_managed() != null) { final TCObject tco = lookupExistingOrNull(object); try { if (tco != null) { if (SerializationUtil.ADD_ALL_SIGNATURE.equals(methodSignature)) { logicalAddAllInvoke(this.serializer.methodToID(methodSignature), methodSignature, (Collection) params[0], tco); } else if (SerializationUtil.ADD_ALL_AT_SIGNATURE.equals(methodSignature)) { logicalAddAllAtInvoke(this.serializer.methodToID(methodSignature), methodSignature, ((Integer) params[0]).intValue(), (Collection) params[1], tco); } else { adjustForJava1ParametersIfNecessary(methodSignature, params); tco.logicalInvoke(this.serializer.methodToID(methodSignature), methodSignature, params); } } } catch (final Throwable t) { Util.printLogAndRethrowError(t, logger); } } }