I’m adding my own Java code to the Notes replicator (like the Activities sync):
<plugin>
<extension
point="com.ibm.notes.client.notesSync">
<unit
class="com.ibm.notes.smartfile.RunOnReplication"
id="com.ibm.notes.smartfile.RunOnReplication"
image="icons/SmartFile.gif"
label="IBM SmartFile action">
</unit>
</extension>
</plugin>
This adds an entry to the replicator page that executes every time a job runs. My class looks like this:
public class RunOnReplication extends Job {
public RunOnReplication(String name) {
super(name);
}
@Override
public IStatus run(IProgressMonitor arg0) {
NotesSessionJob nsj = new NotesSessionJob("SmartFile Replication") {
@Override
protected IStatus runInNotesThread(Session s,
IProgressMonitor monitor) throws NotesException {
Engine engine = Activator.getDefault().getEngine();
return engine.scheduledProcessing(s, monitor);
}
};
nsj.schedule();
return Status.OK_STATUS;
}
}
Now I wonder: how can I get the monitor in the nsj Job to report the status to the outer class, so the progress is reported to the replicator progress bar — or is there a different way to get to the NotesSession without creating a new job?
You don’t have to use the NotesSessionJob. Instead of that you can also use the “old” way of instantiating the N/D java classes.
Btw: cool idea…