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 40 public class HostnameInstanceIdGenerator implements InstanceIdGenerator { 41 public String generateInstanceId() throws SchedulerException { 42 try { 43 return InetAddress.getLocalHost().getHostName(); 44 } catch (Exception e) { 45 throw new SchedulerException("Couldn't get host name!", e); 46 } 47 } 48 } | Popular Tags |