All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ff.prac.jobs.TimeJob Maven / Gradle / Ivy

There is a newer version: 0.0.4
Show newest version
/*
 * Copyright (C) 2015-2018 XinZhenfeng 
 * 
 * This file is part of prac
 * 
 * prac is free software: you can use, redistribute, and/or modify
 * it under the terms of the GNU Affero General Public License, version 3
 * or later ("AGPL"), as published by the Free Software Foundation.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Affero General Public License for more details.
 * 
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see .
 */

package ff.prac.jobs;

import java.io.PrintWriter;

/**
 * time synchronization service 
 */
public class TimeJob implements Job {

	@Override
	public void execute(JobRuntime jr) throws Exception {
		PrintWriter pw = jr.getResponse().getWriter();
		pw.print("{IP:"+jr.getRequest().getLocalAddr()+",TIME:"+System.currentTimeMillis()+"}");
		pw.flush();
		pw.close();
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy