/** init schedule task to do index. */ public static void startIndexTask() { if (indexTask == null) { synchronized (IndexAutoTrigger.class) { if (indexTask == null) { indexTask = new IndexAutoTask(); indexTask.start(); } } } }
/** call the schedule 'TimerTask' action run. */ public static synchronized void indexImmediately() { if (indexTask == null) { startIndexTask(); } else { try { indexTask.indexImmediately(); } catch (Exception ex) { ex.printStackTrace(); } } }