Skip to content

Commit

Permalink
0002796: File Channels are missing when first enabling file sync.
Browse files Browse the repository at this point in the history
  • Loading branch information
mmichalek committed Sep 19, 2016
1 parent 5d59740 commit 0c5cc1c
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
Expand Up @@ -336,4 +336,9 @@ public void setTimeBetweenRunsInMs(long timeBetweenRunsInMs) {
}
}

@Override
public void startJobsAfterConfigChange() {
// No action on Android.
}

}
Expand Up @@ -68,6 +68,7 @@ public JobManager(ISymmetricEngine engine) {
this.jobs.add(new ReportStatusJob(engine, taskScheduler));
}

@Override
public IJob getJob(String name) {
for (IJob job : jobs) {
if (job.getName().equals(name)) {
Expand All @@ -81,6 +82,7 @@ public IJob getJob(String name) {
* Start the jobs if they are configured to be started in
* symmetric.properties
*/
@Override
public synchronized void startJobs() {
for (IJob job : jobs) {
if (job.isAutoStartConfigured()) {
Expand All @@ -90,21 +92,33 @@ public synchronized void startJobs() {
}
}
}

@Override
public synchronized void startJobsAfterConfigChange() {
for (IJob job : jobs) {
if (job.isAutoStartConfigured() && !job.isStarted()) {
job.start();
}
}
}

@Override
public synchronized void stopJobs() {
for (IJob job : jobs) {
job.stop();
}
Thread.interrupted();
}

public synchronized void destroy () {
@Override
public synchronized void destroy() {
stopJobs();
if (taskScheduler != null) {
taskScheduler.shutdown();
}
}

@Override
public List<IJob> getJobs() {
return jobs;
}
Expand Down
Expand Up @@ -889,6 +889,7 @@ public void clearCaches() {
getConfigurationService().initDefaultChannels();
getConfigurationService().clearCache();
getNodeService().flushNodeAuthorizedCache();
getJobManager().startJobsAfterConfigChange();
}

public void reOpenRegistration(String nodeId) {
Expand Down
Expand Up @@ -34,6 +34,8 @@ public interface IJobManager {

public void stopJobs();

public void startJobsAfterConfigChange();

public void destroy();

public List<IJob> getJobs();
Expand Down

0 comments on commit 0c5cc1c

Please sign in to comment.