@Override public synchronized Log log() { if (log == null) { log = MApi.get().lookupLog(this); } return log; }
@Override public Object create(Class<?> clazz, Class<?>[] classes, Object[] objects) { if (clazz == CfgManager.class) return MApi.get().getCfgManager(); return null; }
public static boolean isTrace(String name) { dirtyLog("Ask for trace", name); // String value = System.getProperty(name+".trace"); // if (value != null) return "true".equals(value); return get().isTrace(name); }
public static IConfig getCfg(Object owner, IConfig def) { return get().getCfgManager().getCfg(owner, def); }
public static void updateLoggers() { Log.getLog(MApi.class); get().updateLog(); // try { // synchronized (loggers) { // for (UUID logId : loggers.keySet().toArray(new UUID[loggers.size()])) // loggers.get(logId).update(); // } // } catch(Throwable t) { // if (MApi.isDirtyTrace()) t.printStackTrace(); // } }
public static boolean isTrailLevelMapper() { IApi api = MApi.get(); LevelMapper mapper = api.getLogFactory().getLevelMapper(); return (mapper != null && mapper instanceof TrailLevelMapper); }
private MProperties loadConfiguration() { MProperties properties = MProperties.load(MApi.get().getSystemProperty(MConstants.PROP_TIMER_CONFIG_FILE, MConstants.DEFAULT_MHUS_TIMER_CONFIG_FILE)); // TODO configurable via mhu-config return properties; }
public void update() { engine = MApi.get().getLogFactory().getInstance(getName()); localTrace = MApi.isTrace(name); levelMapper = MApi.get().getLogFactory().getLevelMapper(); parameterMapper = MApi.get().getLogFactory().getParameterMapper(); maxMsgSize = MApi.get().getLogFactory().getMaxMessageSize(); }
public static void releaseTrailConfig() { IApi api = MApi.get(); LevelMapper mapper = api.getLogFactory().getLevelMapper(); if (mapper != null && mapper instanceof TrailLevelMapper) { TrailLevelMapper m = (TrailLevelMapper)mapper; m.doResetTrail(); } }
public static void setTrailConfig(String parameters) { IApi api = MApi.get(); LevelMapper mapper = api.getLogFactory().getLevelMapper(); if (mapper != null && mapper instanceof TrailLevelMapper) { TrailLevelMapper m = (TrailLevelMapper)mapper; // ThreadMapperConfig config = new ThreadMapperConfig(); // if (parameters != null) { // config.doConfigure(parameters); // } m.doConfigureTrail(parameters); } }
/** * Returns the config or an empty config as default. * * @param owner * @return the config */ public static IConfig getCfg(Object owner) { if (emptyConfig == null) emptyConfig = new HashConfig(); return get().getCfgManager().getCfg(owner, emptyConfig); }
public static String getTrailConfig() { IApi api = MApi.get(); LevelMapper mapper = api.getLogFactory().getLevelMapper(); if (mapper != null && mapper instanceof TrailLevelMapper) { TrailLevelMapper m = (TrailLevelMapper)mapper; return m.doSerializeTrail(); } return null; }
/** * Create a new Bundle from configuration. * * @param config Config element or null. null will use the central MApi configuration. * @param activator Activator or null. null will use the central MApi activator. */ public DbPoolBundle(IConfig config, MActivator activator) { if (config == null) config = MApi.get().getCfgManager().getCfg(DbPoolBundle.class, null); if (activator == null) activator = MApi.lookup(MActivator.class); this.config = config; this.activator = activator; }
public static void doStartTrailLog() { LevelMapper mapper = get().getLogFactory().getLevelMapper(); if (mapper != null && mapper instanceof TrailLevelMapper) ((TrailLevelMapper)mapper).doConfigureTrail("MAP"); }
public static void doStopTrailLog() { LevelMapper mapper = get().getLogFactory().getLevelMapper(); if (mapper != null && mapper instanceof TrailLevelMapper) ((TrailLevelMapper)mapper).doResetTrail(); }
public static void resetAllTrailConfigs() { IApi api = MApi.get(); LevelMapper mapper = api.getLogFactory().getLevelMapper(); if (mapper != null && mapper instanceof TrailLevelMapper) { TrailLevelMapper m = (TrailLevelMapper)mapper; m.doResetAllTrails(); } }
public synchronized static IConfig getConfig() { if (config == null) config = MApi.get().getCfgManager().getCfg("jms", new EmptyConfig()); return config; }
protected void doCreateConfig() { try { config = MApi.get().getCfgManager().getCfg(this,null); } catch (Throwable t) { } if (config == null) config = new HashConfig(); }
public TimerTaskWrap(TimerImpl timer,String name, TimerTask task) { this.task = task; this.timer = timer; if (name == null) name = MSystem.getClassName(task); this.name = name; synchronized (timer) { timer.tasks.add(this); } LevelMapper lm = MApi.get().getLogFactory().getLevelMapper(); if (lm != null && lm instanceof TrailLevelMapper) log = ((TrailLevelMapper)lm).doSerializeTrail(); } @Override