summaryrefslogtreecommitdiffstats
path: root/gearman/controllerWorker/ControllerWorker/ControllerWorkerMain.java
blob: 044bf7df67878eda29c11b17445089ca54f3ec68 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package ControllerWorker;

import org.gearman.common.GearmanJobServerConnection;
import org.gearman.common.GearmanNIOJobServerConnection;
import org.gearman.worker.GearmanWorker;
import org.gearman.worker.GearmanWorkerImpl;

public class ControllerWorkerMain {
	public static void main(String[] args) {
		final GearmanJobServerConnection connection = new GearmanNIOJobServerConnection(
				"127.0.0.1", 4730);
		GearmanWorker bootWorker = new GearmanWorkerImpl();
		bootWorker.registerFunction(BootWorker.class);
		bootWorker.registerFunction(ShutdownWorker.class);
		bootWorker.registerFunction(StatusWorker.class);
		bootWorker.registerFunction(SomePingWorker.class);
		bootWorker.addServer(connection);
		bootWorker.work();
	}
}