![JAR search and dependency download from the Maven repository](/logo.png)
ff.prac.jobs.TimeJob Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of prac Show documentation
Show all versions of prac Show documentation
practical java utilities
/*
* 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