I am using the Subclipse API and I would like to implement the ISVNNotifyListener so that I can find out about the subclipse events as they happen during runtime. I believe
Sorry, but unfortunately Subclipse has not been coded in such a way to provide access to the internals. Subclipse constructs a new ISVNClientAdapter object for each API call it needs to make into Subversion and it adds its ISVNNotifyListener to this object on the fly as needed. So there is no way for you to interject your own listener.
Perhaps you could write a class that implements IConsoleListener and have it act as a proxy for the Subclipse class. You could then call SVNProviderPlugin.getConsoleListener to get the current console listener and store a reference to it in your class. Then call SVNProviderPlugin.setConsoleListener to replace the class held in Subclipse with your class. As the events are fired in your class, you could just forward them on to the Subclipse class and do whatever you want with the events in your code. Something like this:
import java.io.File;
import org.tigris.subversion.subclipse.core.client.IConsoleListener;
import org.tigris.subversion.svnclientadapter.SVNNodeKind;
public class ProxyListener implements IConsoleListener {
private IConsoleListener subclipseListener;
public ProxyListener(IConsoleListener subclipseListener) {
super();
this.subclipseListener = subclipseListener;
}
public void setCommand(int command) {
subclipseListener.setCommand(command);
// TODO add your code
}
public void logCommandLine(String commandLine) {
subclipseListener.logCommandLine(commandLine);
// TODO add your code
}
public void logMessage(String message) {
subclipseListener.logMessage(message);
// TODO add your code
}
public void logError(String message) {
subclipseListener.logError(message);
// TODO add your code
}
public void logRevision(long revision, String path) {
subclipseListener.logRevision(revision , path);
// TODO add your code
}
public void logCompleted(String message) {
subclipseListener.logCompleted(message);
// TODO add your code
}
public void onNotify(File path, SVNNodeKind kind) {
subclipseListener.onNotify(path, kind);
// TODO add your code
}
}