Move AbstractHook into Java

This commit is contained in:
R. Tyler Croy 2015-04-03 07:31:53 -07:00
parent 5751ba80fc
commit 1b44cd2c1e
2 changed files with 38 additions and 37 deletions

View File

@ -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
}
}

View File

@ -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;
}
}