|
xmlBlaster 1.6.2 client API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.xmlBlaster.util.SignalCatcher
SignalCatcher catches Ctrl-C and does the desired action.
Works only with JDK 1.3 and above, we check with reflection the availability to still be JDK 1.2 compatible.
| Constructor Summary | |
SignalCatcher()
|
|
| Method Summary | |
boolean |
catchSignals()
Add shutdown hook. |
boolean |
hasListener()
|
static SignalCatcher |
instance()
|
void |
register(I_SignalListener listener)
You need to call init() after construction. |
boolean |
removeSignalCatcher()
|
void |
run()
This is invoked on exit |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SignalCatcher()
| Method Detail |
public static SignalCatcher instance()
public boolean hasListener()
public void register(I_SignalListener listener)
class Shutdown extends Thread {
public void run() {
System.exit(0);
}
}
SignalCatcher c = SignalCatcher.instance();
c.register(new Shutdown());
c.catchSignals();
...
c.removeSignalCatcher();
java.lang.IllegalArgumentException - if other listener existspublic boolean catchSignals()
public boolean removeSignalCatcher()
public void run()
run in interface java.lang.Runnable
|
xmlBlaster 1.6.2 client API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||