If you implement InvocationHandler , you override the following method:
@Override Object invoke( Object proxy, Method method, Object[] args ) throws Throwable { throw new DeadLockException(); }
As you can see, the signature of this method indicates that a Throwable Exception can be thrown. A simple try-catch in the caller is enough.
What logic do you need in detecting a dead end?
Deadlock refers to resource allocation, so where are they?
source share