public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { if ("afterDone".equals(method.getName()) && args.length == 1) { ((ThrowableConsumer<LocalFileOperationsHandler, IOException>)args[0]).consume(myParentProxy); return null; } if (LocalFileOperationsHandler.class.equals(method.getDeclaringClass())) { myParent.register(method, args); } if ("equals".equals(method.getName())) { return args[0].equals(this); } else if ("hashCode".equals(method.getName())) { return 1; } return method.invoke(myDelegate, args); }
public SvnFileSystemListenerWrapper(final SvnFileSystemListener delegate) { final MyCommandListener listener = new MyCommandListener(delegate); myListener = listener; final MyStorage storage = new MyStorage(listener); myProxy = (LocalFileOperationsHandler) Proxy.newProxyInstance(LocalFileOperationsHandler.class.getClassLoader(), new Class<?>[]{LocalFileOperationsHandler.class}, new MyInvoker(storage, delegate)); }
@Override public void registerAuxiliaryFileOperationsHandler(@NotNull final LocalFileOperationsHandler handler) { }
@Override public void unregisterAuxiliaryFileOperationsHandler(@NotNull final LocalFileOperationsHandler handler) { }
public void afterDone(final ThrowableConsumer<LocalFileOperationsHandler, IOException> invoker) { if (!myIsInCommand && myGuessedProject != null) { commandFinished(myGuessedProject); myGuessedProject = null; } }
@Override public void afterDone(final ThrowableConsumer<LocalFileOperationsHandler, IOException> throwableConsumer) { // nothing to do }
@Override public void afterDone(ThrowableConsumer<LocalFileOperationsHandler, IOException> invoker) { }
public void afterDone(final ThrowableConsumer<LocalFileOperationsHandler, IOException> invoker) { }
private MyInvoker(final MyStorage parent, Object delegate) { myParent = parent; myDelegate = delegate; myParentProxy = (LocalFileOperationsHandler) Proxy.newProxyInstance(LocalFileOperationsHandler.class.getClassLoader(), new Class<?>[]{LocalFileOperationsHandler.class}, myParent); }
@Override public void registerAuxiliaryFileOperationsHandler(@Nonnull LocalFileOperationsHandler handler) { }
@Override public void unregisterAuxiliaryFileOperationsHandler(@Nonnull LocalFileOperationsHandler handler) { }
@Override public void registerAuxiliaryFileOperationsHandler(@Nonnull final LocalFileOperationsHandler handler) { }
@Override public void unregisterAuxiliaryFileOperationsHandler(@Nonnull final LocalFileOperationsHandler handler) { }
public void afterDone(final ThrowableConsumer<LocalFileOperationsHandler, IOException> invoker) {}