mirror of https://github.com/reiseburo/whoas
Move AbstractHook into Java
This commit is contained in:
parent
5751ba80fc
commit
1b44cd2c1e
|
@ -1,37 +0,0 @@
|
|||
package com.github.lookout.whoas
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
abstract class AbstractHookRunner {
|
||||
protected AbstractHookQueue queue
|
||||
protected Publisher publisher
|
||||
protected Boolean keepGoing = true
|
||||
|
||||
AbstractHookRunner(AbstractHookQueue hookQueue) {
|
||||
this(hookQueue, new Publisher())
|
||||
}
|
||||
|
||||
AbstractHookRunner(AbstractHookQueue hookQueue, Publisher hookPublisher) {
|
||||
this.publisher = hookPublisher
|
||||
this.queue = hookQueue
|
||||
}
|
||||
|
||||
Publisher getPublisher() {
|
||||
return this.publisher
|
||||
}
|
||||
|
||||
/** Block forever and run the runner's runloop. */
|
||||
abstract void run()
|
||||
|
||||
/**
|
||||
* Tell the runloop to stop
|
||||
*
|
||||
* This will only come into effect after the runner has completed it's
|
||||
* currently executing work
|
||||
*/
|
||||
void stop() {
|
||||
this.keepGoing = false
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package com.github.lookout.whoas;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public abstract class AbstractHookRunner {
|
||||
protected AbstractHookQueue queue;
|
||||
protected Publisher publisher;
|
||||
protected Boolean keepGoing = true;
|
||||
|
||||
public AbstractHookRunner(AbstractHookQueue hookQueue) {
|
||||
this(hookQueue, new Publisher());
|
||||
}
|
||||
|
||||
public AbstractHookRunner(AbstractHookQueue hookQueue,
|
||||
Publisher hookPublisher) {
|
||||
this.publisher = hookPublisher;
|
||||
this.queue = hookQueue;
|
||||
}
|
||||
|
||||
public Publisher getPublisher() {
|
||||
return this.publisher;
|
||||
}
|
||||
|
||||
/** Block forever and run the runner's runloop. */
|
||||
public abstract void run();
|
||||
|
||||
/**
|
||||
* Tell the runloop to stop
|
||||
*
|
||||
* This will only come into effect after the runner has completed it's
|
||||
* currently executing work
|
||||
*/
|
||||
public void stop() {
|
||||
this.keepGoing = false;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue