package com.dwave.rmi; /* * Pulse * * Copyright (C) 2000 D-Wave Systems Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * Class to send a pulse to rmi server every ten seconds * to keep open the connection * * @author Michael Coury * @version 1, 10/06/2000 * @see com.dwave.rmi.DWaveRMIClient */ public class Pulse extends Thread { DWaveRMIClient theClient; boolean pulse = true; public Pulse(DWaveRMIClient aClient) { theClient=aClient; start(); } public void run() { try { while(pulse) { theClient.pulse(); this.sleep(10000); } } catch(Exception e) { e.printStackTrace(); } } public void setPulse(boolean toPulse) { pulse = toPulse; } public boolean isPulsing() { return pulse; } }