1 17 package org.quartz.simpl; 18 19 import java.net.InetAddress ; 20 21 import org.quartz.SchedulerException; 22 import org.quartz.spi.InstanceIdGenerator; 23 24 31 public class SimpleInstanceIdGenerator implements InstanceIdGenerator { 32 public String generateInstanceId() throws SchedulerException { 33 try { 34 return InetAddress.getLocalHost().getHostName() + System.currentTimeMillis(); 35 } catch (Exception e) { 36 throw new SchedulerException("Couldn't get host name!", e); 37 } 38 } 39 } | Popular Tags |