@Override public void putProperty(String key, String val) { super.putProperty(key, val); updateLoggerContextVO(); }
/** * This method clears all internal properties, except internal status messages, * closes all appenders, removes any turboFilters, fires an OnReset event, * removes all status listeners, removes all context listeners * (except those which are reset resistant). * <p/> * As mentioned above, internal status messages survive resets. */ @Override public void reset() { resetCount++; super.reset(); initEvaluatorMap(); initCollisionMaps(); root.recursiveReset(); resetTurboFilterList(); cancelScheduledTasks(); fireOnReset(); resetListenersExceptResetResistant(); resetStatusListeners(); }
/** * Given a key, return the corresponding property value. If invoked with * the special key "CONTEXT_NAME", the name of the context is returned. * * @param key * @return */ public String getProperty(String key) { if (CONTEXT_NAME_KEY.equals(key)) return getName(); return (String) this.propertyMap.get(key); }
public static void main(String[] args) throws Exception { Context context = new ContextBase(); Map<ElementSelector, Action> ruleMap = new HashMap<ElementSelector, Action>(); // we start with the rule for the top-most (root) element ruleMap.put(new ElementSelector("*/foo"), new NOPAction()); // Add an implicit action. List<ImplicitAction> iaList = new ArrayList<ImplicitAction>(); iaList.add(new PrintMeImplicitAction()); SimpleConfigurator simpleConfigurator = new SimpleConfigurator(ruleMap, iaList); // link the configurator with its context simpleConfigurator.setContext(context); simpleConfigurator.doConfigure(args[0]); StatusPrinter.printInCaseOfErrorsOrWarnings(context); } }
/** * Clear the internal objectMap and all properties. */ public void reset() { removeShutdownHook(); getLifeCycleManager().reset(); propertyMap.clear(); objectMap.clear(); }
public void stop() { reset(); fireOnStop(); resetAllListeners(); super.stop(); }
@Override public void setName(String name) { super.setName(name); updateLoggerContextVO(); }
private void removeShutdownHook() { Thread hook = (Thread)getObject(CoreConstants.SHUTDOWN_HOOK_THREAD); if(hook != null) { removeObject(CoreConstants.SHUTDOWN_HOOK_THREAD); try { Runtime.getRuntime().removeShutdownHook(hook); } catch(IllegalStateException e) { //if JVM is already shutting down, ISE is thrown //no need to do anything else } } }
/** * Given a key, return the corresponding property value. If invoked with * the special key "CONTEXT_NAME", the name of the context is returned. * * @param key * @return */ public String getProperty(String key) { if (CONTEXT_NAME_KEY.equals(key)) return getName(); if (HOSTNAME_KEY.equalsIgnoreCase(key)) { return lazyGetHostname(); } return (String) this.propertyMap.get(key); }
/** * Clear the internal objectMap and all properties. */ public void reset() { getLifeCycleManager().reset(); propertyMap.clear(); objectMap.clear(); }
public void stop() { // We don't check "started" here, because the executor service uses // lazy initialization, rather than being created in the start method stopExecutorService(); started = false; }
public void start() { super.start(); fireOnStart(); }
public static void main(String[] args) throws Exception { Map<ElementSelector, Action> ruleMap = new HashMap<ElementSelector, Action>(); // Associate "hello-world" pattern with HelloWorldAction ruleMap.put(new ElementSelector("hello-world"), new HelloWorldAction()); // Joran needs to work within a context. Context context = new ContextBase(); SimpleConfigurator simpleConfigurator = new SimpleConfigurator(ruleMap); // link the configurator with its context simpleConfigurator.setContext(context); simpleConfigurator.doConfigure(args[0]); StatusPrinter.print(context); } }
/** * Clear the internal objectMap and all properties. Removes registered * shutdown hook */ public void reset() { removeShutdownHook(); getLifeCycleManager().reset(); propertyMap.clear(); objectMap.clear(); }
public void stop() { reset(); fireOnStop(); resetAllListeners(); super.stop(); }
@Override public void setName(String name) { super.setName(name); updateLoggerContextVO(); }
private void removeShutdownHook() { Thread hook = (Thread)getObject(CoreConstants.SHUTDOWN_HOOK_THREAD); if(hook != null) { removeObject(CoreConstants.SHUTDOWN_HOOK_THREAD); try { Runtime.getRuntime().removeShutdownHook(hook); } catch(IllegalStateException e) { //if JVM is already shutting down, ISE is thrown //no need to do anything else } } }
/** * Given a key, return the corresponding property value. If invoked with * the special key "CONTEXT_NAME", the name of the context is returned. * * @param key * @return */ public String getProperty(String key) { if (CONTEXT_NAME_KEY.equals(key)) return getName(); if (HOSTNAME_KEY.equalsIgnoreCase(key)) { return lazyGetHostname(); } return (String) this.propertyMap.get(key); }
public void register(LifeCycle component) { getLifeCycleManager().register(component); }
public void stop() { // We don't check "started" here, because the executor service uses // lazy initialization, rather than being created in the start method stopExecutorService(); started = false; }