1 28 29 package com.caucho.loader; 30 31 import com.caucho.config.types.Period; 32 33 import javax.annotation.PostConstruct; 34 35 38 public class DependencyCheckInterval { 39 private long _interval = 2000L; 40 41 44 public void setValue(Period period) 45 { 46 _interval = period.getPeriod(); 47 } 48 49 52 @PostConstruct 53 public void init() 54 { 55 ClassLoader loader = Thread.currentThread().getContextClassLoader(); 56 57 for (; loader != null; loader = loader.getParent()) { 58 if (loader instanceof DynamicClassLoader) { 59 DynamicClassLoader dynLoader; 60 dynLoader = (DynamicClassLoader) loader; 61 62 dynLoader.setDependencyCheckInterval(_interval); 63 return; 64 } 65 } 66 67 if (loader == null) 68 DynamicClassLoader.setGlobalDependencyCheckInterval(_interval); 69 } 70 71 public String toString() 72 { 73 return "DependencyCheckInterval[]"; 74 } 75 } 76 77 78 | Popular Tags |