private LogHandler createLogHandler(String pLogHandlerClass, String pDebug) { if (pLogHandlerClass != null) { return ClassUtil.newInstance(pLogHandlerClass); } else { final boolean debug = Boolean.valueOf(pDebug); return new LogHandler.StdoutLogHandler(debug); } }
/** * Get the path as a reverse stack with the first element of the path on top * * @param pPath path to parse * @return stack of arguments in reverse order or an empty stack if path was null or empty */ public static Stack<String> extractElementsFromPath(String pPath) { return reversePath(parsePath(pPath)); }
@Override protected Connector createConnector(Server pServer) { return ClassUtil.newInstance("org.eclipse.jetty.server.nio.SelectChannelConnector"); }
private static <T> void readServiceDefinitions(Map<ServiceEntry, T> pExtractorMap, String pDefPath) { try { for (String url : ClassUtil.getResources(pDefPath)) { readServiceDefinitionFromUrl(pExtractorMap, url); } } catch (IOException e) { throw new IllegalStateException("Cannot load extractor from " + pDefPath + ": " + e,e); } }
/** * Lookup a class. See {@link ClassUtil#classForName(String, boolean,ClassLoader[])} for details. The class * gets initialized during lookup. * * @param pClassName name to lookup. * @return the class found or null if no class could be found. */ public static <T> Class<T> classForName(String pClassName, ClassLoader ... pClassLoaders) { return classForName(pClassName, true, pClassLoaders); }
/** * Whether debug is switched on * * @return true if debug is switched on */ public boolean isDebug() { return debugStore != null && debugStore.isDebug(); }
/** * Switch on/off debug * * @param pSwitch if <code>true</code> switch on debug */ public void setDebug(boolean pSwitch) { if (!pSwitch) { resetDebugInfo(); } isDebug = pSwitch; }
/** * Get the path combined with proper escaping * * @return path as string or null if no path is given. */ public String getPath() { return EscapeUtil.combineToPath(pathParts); }
public void debug(String message) { if (doDebug) { log("D> " + message); } }
/** * Return a dump information of all known MBeanServers * * @return information about the registered MBeanServers */ public String dump() { return ServersInfo.dump(allMBeanServers); }
/** * Check whether the given interface supports multicast and is up * * @param pNif check whether the given interface supports multicast * @return true if multicast is supported and the interface is up */ public static boolean isMulticastSupported(NetworkInterface pNif) { return pNif != null && checkMethod(pNif, isUp) && checkMethod(pNif, supportsMulticast); }
/** * Set the number of maximum debuggin entries and trim the list of * debug entries * * @param pNumber the maximal number of debug entries */ public void setMaxDebugEntries(int pNumber) { maxDebugEntries = pNumber; trim(); }
/** {@inheritDoc} */ public void setDebug(boolean pSwitch) { debugStore.setDebug(pSwitch); }
/** {@inheritDoc} */ public String debugInfo() { return debugStore.debugInfo(); }
/** {@inheritDoc} */ public int getMaxDebugEntries() { return debugStore.getMaxDebugEntries(); }
/** * Check for the existence of a given class * * @param pClassName class name to check * @return true if the class could be loaded by the thread's conext class loader, false otherwise */ public static boolean checkForClass(String pClassName) { return ClassUtil.classForName(pClassName,false) != null; }