private Boolean getBooleanValue(String propertyName) { Boolean retVal = null; String stringValue = System.getProperty(propertyName); if (stringValue != null) { retVal = Boolean.valueOf(stringValue); LOGGER.fine(TubelineassemblyMessages.MASM_0018_MSG_LOGGING_SYSTEM_PROPERTY_SET_TO_VALUE(propertyName, retVal)); } return retVal; }
writer.close(); } catch (XMLStreamException ignored) { LOGGER.fine("Unexpected exception occured while closing XMLStreamWriter", ignored);
private Boolean getBooleanValue(String propertyName) { Boolean retVal = null; String stringValue = System.getProperty(propertyName); if (stringValue != null) { retVal = Boolean.valueOf(stringValue); LOGGER.fine(TubelineassemblyMessages.MASM_0018_MSG_LOGGING_SYSTEM_PROPERTY_SET_TO_VALUE(propertyName, retVal)); } return retVal; }
writer.close(); } catch (XMLStreamException ignored) { LOGGER.fine("Unexpected exception occured while closing XMLStreamWriter", ignored);
private Boolean getBooleanValue(String propertyName) { Boolean retVal = null; String stringValue = System.getProperty(propertyName); if (stringValue != null) { retVal = Boolean.valueOf(stringValue); LOGGER.fine(TubelineassemblyMessages.MASM_0018_MSG_LOGGING_SYSTEM_PROPERTY_SET_TO_VALUE(propertyName, retVal)); } return retVal; }
writer.close(); } catch (XMLStreamException ignored) { LOGGER.fine("Unexpected exception occured while closing XMLStreamWriter", ignored);
private Level getLevelValue(String propertyName) { Level retVal = null; String stringValue = System.getProperty(propertyName); if (stringValue != null) { // if value is not null => property is set, we will try to override the default logging level LOGGER.fine(TubelineassemblyMessages.MASM_0018_MSG_LOGGING_SYSTEM_PROPERTY_SET_TO_VALUE(propertyName, stringValue)); try { retVal = Level.parse(stringValue); } catch (IllegalArgumentException ex) { LOGGER.warning(TubelineassemblyMessages.MASM_0019_MSG_LOGGING_SYSTEM_PROPERTY_ILLEGAL_VALUE(propertyName, stringValue), ex); } } return retVal; }
private Level getLevelValue(String propertyName) { Level retVal = null; String stringValue = System.getProperty(propertyName); if (stringValue != null) { // if value is not null => property is set, we will try to override the default logging level LOGGER.fine(TubelineassemblyMessages.MASM_0018_MSG_LOGGING_SYSTEM_PROPERTY_SET_TO_VALUE(propertyName, stringValue)); try { retVal = Level.parse(stringValue); } catch (IllegalArgumentException ex) { LOGGER.warning(TubelineassemblyMessages.MASM_0019_MSG_LOGGING_SYSTEM_PROPERTY_ILLEGAL_VALUE(propertyName, stringValue), ex); } } return retVal; }
private Level getLevelValue(String propertyName) { Level retVal = null; String stringValue = System.getProperty(propertyName); if (stringValue != null) { // if value is not null => property is set, we will try to override the default logging level LOGGER.fine(TubelineassemblyMessages.MASM_0018_MSG_LOGGING_SYSTEM_PROPERTY_SET_TO_VALUE(propertyName, stringValue)); try { retVal = Level.parse(stringValue); } catch (IllegalArgumentException ex) { LOGGER.warning(TubelineassemblyMessages.MASM_0019_MSG_LOGGING_SYSTEM_PROPERTY_ILLEGAL_VALUE(propertyName, stringValue), ex); } } return retVal; }
/** * shutdown the ScheduledExecutorService if we created it. * @param force - if true, wait for time given by delayMillis, then force shutdown if needed * @param delayMillis */ protected void close(boolean force, long delayMillis) { if (useContainerSpi) return; if (executorService == null) return; if (isClosed.compareAndSet(false, true)) { executorService.shutdown(); } if (!force) return; if (!executorService.isTerminated()) { try { Thread.sleep(delayMillis); } catch (InterruptedException ex) { getLogger().fine("Interrupted while waiting for a scheduler to shut down.", ex); } if (!executorService.isTerminated()) { executorService.shutdownNow(); } } }
private URL loadFromServletContext(String resource) throws RuntimeException { Object context = null; try { final Class<?> contextClass = Class.forName("javax.servlet.ServletContext"); context = container.getSPI(contextClass); if (context != null) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine(TubelineassemblyMessages.MASM_0012_LOADING_VIA_SERVLET_CONTEXT(resource, context)); } try { final Method method = context.getClass().getMethod("getResource", String.class); final Object result = method.invoke(context, "/WEB-INF/" + resource); return URL.class.cast(result); } catch (Exception e) { throw LOGGER.logSevereException(new RuntimeException(TubelineassemblyMessages.MASM_0013_ERROR_INVOKING_SERVLET_CONTEXT_METHOD("getResource()")), e); } } } catch (ClassNotFoundException e) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine(TubelineassemblyMessages.MASM_0014_UNABLE_TO_LOAD_CLASS("javax.servlet.ServletContext")); } } return null; } }
private URL loadFromServletContext(String resource) throws RuntimeException { Object context = null; try { final Class<?> contextClass = Class.forName("javax.servlet.ServletContext"); context = container.getSPI(contextClass); if (context != null) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine(TubelineassemblyMessages.MASM_0012_LOADING_VIA_SERVLET_CONTEXT(resource, context)); } try { final Method method = context.getClass().getMethod("getResource", String.class); final Object result = method.invoke(context, "/WEB-INF/" + resource); return URL.class.cast(result); } catch (Exception e) { throw LOGGER.logSevereException(new RuntimeException(TubelineassemblyMessages.MASM_0013_ERROR_INVOKING_SERVLET_CONTEXT_METHOD("getResource()")), e); } } } catch (ClassNotFoundException e) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine(TubelineassemblyMessages.MASM_0014_UNABLE_TO_LOAD_CLASS("javax.servlet.ServletContext")); } } return null; } }
private URL loadFromServletContext(String resource) throws RuntimeException { Object context = null; try { final Class<?> contextClass = Class.forName("javax.servlet.ServletContext"); context = container.getSPI(contextClass); if (context != null) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine(TubelineassemblyMessages.MASM_0012_LOADING_VIA_SERVLET_CONTEXT(resource, context)); } try { final Method method = context.getClass().getMethod("getResource", String.class); final Object result = method.invoke(context, "/WEB-INF/" + resource); return URL.class.cast(result); } catch (Exception e) { throw LOGGER.logSevereException(new RuntimeException(TubelineassemblyMessages.MASM_0013_ERROR_INVOKING_SERVLET_CONTEXT_METHOD("getResource()")), e); } } } catch (ClassNotFoundException e) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine(TubelineassemblyMessages.MASM_0014_UNABLE_TO_LOAD_CLASS("javax.servlet.ServletContext")); } } return null; } }
@Override public URL getResource(String resource) throws MalformedURLException { LOGGER.entering(resource); URL resourceUrl = null; try { if (parentLoader != null) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine(TubelineassemblyMessages.MASM_0011_LOADING_RESOURCE(resource, parentLoader)); } resourceUrl = parentLoader.getResource(resource); } if (resourceUrl == null) { resourceUrl = loadViaClassLoaders("META-INF/" + resource); } if (resourceUrl == null && container != null) { // TODO: we should remove this code path, the config file should be loaded using ResourceLoader only resourceUrl = loadFromServletContext(resource); } return resourceUrl; } finally { LOGGER.exiting(resourceUrl); } }
@Override public URL getResource(String resource) throws MalformedURLException { LOGGER.entering(resource); URL resourceUrl = null; try { if (parentLoader != null) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine(TubelineassemblyMessages.MASM_0011_LOADING_RESOURCE(resource, parentLoader)); } resourceUrl = parentLoader.getResource(resource); } if (resourceUrl == null) { resourceUrl = loadViaClassLoaders("META-INF/" + resource); } if (resourceUrl == null && container != null) { // TODO: we should remove this code path, the config file should be loaded using ResourceLoader only resourceUrl = loadFromServletContext(resource); } return resourceUrl; } finally { LOGGER.exiting(resourceUrl); } }
@Override public URL getResource(String resource) throws MalformedURLException { LOGGER.entering(resource); URL resourceUrl = null; try { if (parentLoader != null) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine(TubelineassemblyMessages.MASM_0011_LOADING_RESOURCE(resource, parentLoader)); } resourceUrl = parentLoader.getResource(resource); } if (resourceUrl == null) { resourceUrl = loadViaClassLoaders("META-INF/" + resource); } if (resourceUrl == null && container != null) { // TODO: we should remove this code path, the config file should be loaded using ResourceLoader only resourceUrl = loadFromServletContext(resource); } return resourceUrl; } finally { LOGGER.exiting(resourceUrl); } }