@Test public void testConnectedTo() throws Throwable { selectTestRelease(); RestInvocations.getAuthenticationInfo(handler); releaseSprintTeamRequests_TestRelease(handler); getComponent(RestService.class).setServerType(ServerType.AGM); handler.consume(); }
@Override public void connectedTo(ServerType serverType) { if(ServerType.AGM.equals(restService.getServerTypeIfAvailable())) { synchronized (this) { resetValues(); final Entity release = this.releaseSelector.selected; if(release != null) { teamSelector.requestRunning = true; sprintSelector.requestRunning = true; releaseSelector.requestRunning = true; ApplicationManager.getApplication().executeOnPooledThread(new Runnable() { @Override public void run() { loadTeams(release); loadSprints(release); loadReleases(); } }); } else { this.releaseSelector.requestRunning = true; ApplicationManager.getApplication().executeOnPooledThread(new Runnable() { @Override public void run() { loadReleases(); } }); } } } }
SprintService implements PersistentStateComponent<Element>, ServerTypeListener, CachingEntityListener { @Override public void connectedTo(ServerType serverType) { if(ServerType.AGM.equals(restService.getServerTypeIfAvailable())) { synchronized (this) { resetValues(); final Entity release = this.releaseSelector.selected; if(release != null) { teamSelector.requestRunning = true; sprintSelector.requestRunning = true; releaseSelector.requestRunning = true; ApplicationManager.getApplication().executeOnPooledThread(new Runnable() { @Override public void run() { loadTeams(release); loadSprints(release); loadReleases(); } }); } else { this.releaseSelector.requestRunning = true; ApplicationManager.getApplication().executeOnPooledThread(new Runnable() { @Override public void run() { loadReleases(); } }); } } } } }
SprintService implements PersistentStateComponent<Element>, ServerTypeListener, CachingEntityListener { @Override public void connectedTo(ServerType serverType) { if(ServerType.AGM.equals(restService.getServerTypeIfAvailable())) { synchronized (this) { resetValues(); final Entity release = this.releaseSelector.selected; if(release != null) { teamSelector.requestRunning = true; sprintSelector.requestRunning = true; releaseSelector.requestRunning = true; ApplicationManager.getApplication().executeOnPooledThread(new Runnable() { @Override public void run() { loadTeams(release); loadSprints(release); loadReleases(); } }); } else { this.releaseSelector.requestRunning = true; ApplicationManager.getApplication().executeOnPooledThread(new Runnable() { @Override public void run() { loadReleases(); } }); } } } } SprintService(Project project); }
SprintService implements PersistentStateComponent<Element>, ServerTypeListener, CachingEntityListener { @Override public void connectedTo(ServerType serverType) { if(ServerType.AGM.equals(restService.getServerTypeIfAvailable())) { synchronized (this) { resetValues(); final Entity release = this.releaseSelector.selected; if(release != null) { teamSelector.requestRunning = true; sprintSelector.requestRunning = true; releaseSelector.requestRunning = true; ApplicationManager.getApplication().executeOnPooledThread(new Runnable() { @Override public void run() { loadTeams(release); loadSprints(release); loadReleases(); } }); } else { this.releaseSelector.requestRunning = true; ApplicationManager.getApplication().executeOnPooledThread(new Runnable() { @Override public void run() { loadReleases(); } }); } } } } SprintService(Project project); Element getState(); void loadState(Element state); @Override void connectedTo(ServerType serverType); synchronized Entity getRelease(); synchronized Entity getSprint(); synchronized Entity getTeam(); void addListener(Listener listener); void removeListener(Listener listener); synchronized void selectRelease(final Entity release); synchronized void selectSprint(Entity sprint); synchronized void selectTeam(Entity team); synchronized Entity getCurrentSprint(); synchronized EntityList getTeams(); EntityList getSprints(); EntityList getReleases(); static boolean isSameTense(Entity sprint1, Entity sprint2); static boolean isCurrentSprint(Entity sprint); static long distance(long now, Entity entity); @Override Entity lookup(final EntityRef ref); @Override void entityLoaded(Entity entity, Event event); @Override void entityNotFound(EntityRef ref, boolean removed); }
SprintService implements PersistentStateComponent<Element>, ServerTypeListener, CachingEntityListener { @Override public void connectedTo(ServerType serverType) { if(ServerType.AGM.equals(restService.getServerTypeIfAvailable())) { synchronized (this) { resetValues(); final Entity release = this.releaseSelector.selected; if(release != null) { teamSelector.requestRunning = true; sprintSelector.requestRunning = true; releaseSelector.requestRunning = true; ApplicationManager.getApplication().executeOnPooledThread(new Runnable() { @Override public void run() { loadTeams(release); loadSprints(release); loadReleases(); } }); } else { this.releaseSelector.requestRunning = true; ApplicationManager.getApplication().executeOnPooledThread(new Runnable() { @Override public void run() { loadReleases(); } }); } } } } SprintService(Project project); Element getState(); void loadState(Element state); @Override void connectedTo(ServerType serverType); synchronized Entity getRelease(); synchronized Entity getSprint(); synchronized Entity getTeam(); void addListener(Listener listener); void removeListener(Listener listener); synchronized void selectRelease(final Entity release); synchronized void selectSprint(Entity sprint); synchronized void selectTeam(Entity team); synchronized Entity getCurrentSprint(); synchronized EntityList getTeams(); EntityList getSprints(); EntityList getReleases(); static boolean isSameTense(Entity sprint1, Entity sprint2); static boolean isCurrentSprint(Entity sprint); static long distance(long now, Entity entity); @Override Entity lookup(final EntityRef ref); @Override void entityLoaded(Entity entity, Event event); @Override void entityNotFound(EntityRef ref, boolean removed);  }