VCS: allow Git to report changed on server files comparing the whole tree. !! require...
[fedora-idea.git] / plugins / svn4idea / src / org / jetbrains / idea / svn / DefendedCopiesRefreshProxy.java
blob79ebf0e63bbe595db4cad67b8812d3e25610c58f
1 package org.jetbrains.idea.svn;
3 public class DefendedCopiesRefreshProxy implements CopiesRefresh {
4 private final ReentranceDefence myDefence;
6 private final MyEnsureInit myEnsureInit;
7 private final MyAsynchRequest myAsynchRequest;
8 private final MySynchRequest mySynchRequest;
10 public DefendedCopiesRefreshProxy(final CopiesRefresh refresh) {
11 myDefence = new ReentranceDefence();
13 myEnsureInit = new MyEnsureInit(refresh);
14 myAsynchRequest = new MyAsynchRequest(refresh);
15 mySynchRequest = new MySynchRequest(refresh);
18 public void ensureInit() {
19 ReentranceDefence.executeReentrant(myDefence, myEnsureInit);
22 public void asynchRequest() {
23 ReentranceDefence.executeReentrant(myDefence, myAsynchRequest);
26 public void synchRequest() {
27 ReentranceDefence.executeReentrant(myDefence, mySynchRequest);
30 public Runnable proxyRefresher(final Runnable runnable) {
31 return new Runnable() {
32 public void run() {
33 myDefence.executeOtherDefended(runnable);
38 private static class MyAsynchRequest extends MyBase {
39 private MyAsynchRequest(final CopiesRefresh delegate) {
40 super(delegate);
43 public Boolean executeMe() {
44 myDelegate.asynchRequest();
45 return null;
49 private static class MySynchRequest extends MyBase {
50 private MySynchRequest(final CopiesRefresh delegate) {
51 super(delegate);
54 public Boolean executeMe() {
55 myDelegate.synchRequest();
56 return null;
60 private static class MyEnsureInit extends MyBase {
61 private MyEnsureInit(final CopiesRefresh delegate) {
62 super(delegate);
65 public Boolean executeMe() {
66 myDelegate.ensureInit();
67 return null;
71 private abstract static class MyBase implements ReentranceDefence.MyControlled<Boolean> {
72 protected final CopiesRefresh myDelegate;
74 protected MyBase(final CopiesRefresh delegate) {
75 myDelegate = delegate;
78 public Boolean executeMeSimple() {
79 return null;