play.jobs.Job Java Examples

The following examples show how to use play.jobs.Job. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Node.java    From openseedbox with GNU General Public License v3.0 6 votes vote down vote up
public INodeStatus getNodeStatus(boolean fromDb) {
	if (fromDb) {
		return status;
	}
	HttpResponse res = getWebService("/status").get();
	if (res.success()) {
		JsonObject fullResponse = handleWebServiceResponse(res).getAsJsonObject();
		status = Util.getGson().fromJson(fullResponse, EmbeddableNodeStatus.class);
		new Job() {
			@Override
			public void doJob() throws Exception {
				update();
			}
		}.now();
		return status;
	} else {
		throw new MessageException("Node returned status: " + res.getStatus() + ". Probably java isnt running.");
	}
}
 
Example #2
Source File: Main2.java    From EclipseCodeFormatter with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) {
	Arrays.asList("");
	new Deployment();
	new Job();
	new Before();
	new Restrict();
	new Javax();
	new Restricts();
}