List of usage examples for java.util.logging Level FINE
Level FINE
To view the source code for java.util.logging Level FINE.
Click Source Link
From source file:es.itecban.deployment.environment.database.manager.DatabaseManagerImpl.java
/** * Initializes the connection to the database *///from w ww .j a va 2s .com public void initDB() { logger.log(Level.FINE, "Initializing the database... "); dataStoreName = "deployment"; dataStore = (HbDataStore) HbHelper.INSTANCE.createRegisterDataStore(dataStoreName); try { logger.log(Level.FINE, "Loading properties..."); if (this.externalConfig) // Hay configuracin externa para hibernate { File file = new File(this.externalPropertiesURI); this.hibernateProperties.load(new FileInputStream(file)); } else // no hay configuracin externa para hibernate this.hibernateProperties.load(propertiesResource.getInputStream()); logger.log(Level.FINE, "Properties loaded: " + hibernateProperties.toString()); } catch (Exception e) { System.err.println("Impossible to load the hibernate.properties file"); e.printStackTrace(); } this.hibernateProperties.put(PersistenceOptions.MAPPING_FILE_PATH, "/environmentmanager.hbm.xml"); dataStore.setProperties(this.hibernateProperties); dataStore.getExtensionManager().registerExtension(ClassLoaderStrategy.class.getName(), ClassClassLoaderStrategy.class.getName()); dataStore.setEPackages( new EPackage[] { UnitPackage.eINSTANCE, TargetPackage.eINSTANCE, ConfigurationPackage.eINSTANCE }); try { dataStore.initialize(); } catch (Exception e) { System.err.println("Problem while initializing the database "); e.printStackTrace(); } sessionFactory = dataStore.getSessionFactory(); }
From source file:de.crowdcode.kissmda.core.uml.PackageHelper.java
/** * Get full package name./*from ww w . j a v a 2s. co m*/ * * @param clazz * UML2 classifier * @param sourceDirectoryPackageName * from the stereotype * @return full package name */ public String getFullPackageName(Classifier clazz, String sourceDirectoryPackageName) { // Get package until the beginning of SourceDirectory logger.log(Level.FINE, "Qualified name: " + clazz.getQualifiedName()); // Remove the sourceDirectoryPackageName String toBeDeleted = sourceDirectoryPackageName + "::"; String fullPackageName = clazz.getQualifiedName().replaceFirst(toBeDeleted, ""); // Remove class name toBeDeleted = "::" + clazz.getName(); fullPackageName = fullPackageName.replaceFirst(toBeDeleted, ""); // Change :: to . fullPackageName = fullPackageName.replaceAll("::", "."); logger.log(Level.FINE, "Real package name: " + fullPackageName); return fullPackageName; }
From source file:org.cloudfoundry.reconfiguration.tomee.DelegatingPropertiesProvider.java
/** * Provide configuration for a TomEE resource. * * @return The configuration for the TomEE resource associated with the provided <code>serviceId</code> * @throws ConfigurationException In case of configuration failure * @see PropertiesResourceProvider//ww w .j a va2 s.c om */ @Override public Properties provides() { if (logger.isLoggable(Level.FINE)) { logger.fine("Configuring resource: " + serviceId); } if (null == serviceId) { throw new ConfigurationException("The serviceId is null."); } final ServiceInfo serviceInfo = getBoundService(); final PropertiesProvider propertiesProvider = getPropertiesProvider(serviceInfo); return propertiesProvider.provide(serviceInfo, properties); }
From source file:com.googlecode.jgenhtml.JGenHtmlUtils.java
/** * * @param line The line with any leading whitespace removed. * @return/*from w w w . j a v a 2 s.co m*/ */ public static int[] getLineValues(String line) { String[] values = extractLineValues(line); int result[] = null; if (values != null) { result = new int[values.length]; try { for (int i = 0; i < values.length; i++) { result[i] = Integer.parseInt(values[i]); } } catch (NumberFormatException nfe) { LOGGER.log(Level.FINE, "Could not parse value from line: {0}", line); } } return result; }
From source file:it.geosolutions.geoserver.jms.JMSApplicationListener.java
@Override public void onApplicationEvent(ApplicationEvent event) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine("Incoming event of type " + event.getClass().getSimpleName()); }/* w ww . j a v a2 s .co m*/ if (event instanceof ToggleEvent) { // enable/disable the producer final ToggleEvent tEv = (ToggleEvent) event; if (tEv.getType().equals(this.type)) { setStatus(tEv.toggleTo()); } } else { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine("Incoming application event of type " + event.getClass().getSimpleName()); } } }
From source file:edu.umass.cs.msocket.proxy.watchdog.WatchdogListScanner.java
/** * Creates a new <code>WatchdogListScanner</code> object * /* ww w . j ava2 s. c om*/ * @param gnsClient GNS connection * @param watchdogGuid GUID entry for this watchdog service * @param targetGuid GUID of the listname we have to read * @param listName name of the field where the list is stored * @param refreshFrequencyInMs how often we should read the list */ public WatchdogListScanner(UniversalGnsClient gnsClient, GuidEntry watchdogGuid, String targetGuid, String listName, long refreshFrequencyInMs) { this.gnsClient = gnsClient; this.watchdogGuid = watchdogGuid; this.targetGuid = targetGuid; this.listName = listName; this.refreshFrequencyInMs = refreshFrequencyInMs; logger.setLevel(Level.FINE); }
From source file:cz.cas.lib.proarc.common.process.AsyncProcess.java
public void kill() { Level level = isDone() ? Level.FINE : Level.WARNING; LOG.log(level, "Kill isDone: " + isDone() + ", " + cmdLine); Process process = refProcess.getAndSet(null); if (process != null) { process.destroy();/*from ww w . jav a 2 s . co m*/ IOUtils.closeQuietly(process.getInputStream()); IOUtils.closeQuietly(process.getErrorStream()); IOUtils.closeQuietly(process.getOutputStream()); done.set(true); try { outputConsumer.join(); } catch (InterruptedException ex) { LOG.log(Level.SEVERE, null, ex); } } }
From source file:io.selendroid.standalone.server.BaseSelendroidStandaloneHandler.java
private void logHandlerCalled(JSONObject payload) { String message = "Selendroid standalone handler: " + this.getClass().getSimpleName(); if (payload != null) { try {//from w w w.j a v a 2 s.c o m message += ", payload:\n" + payload.toString(2); } catch (JSONException e) { log.log(Level.WARNING, "Cannot debug-print request payload", e); } } log.log(Level.FINE, message); }
From source file:com.prowidesoftware.swift.io.writer.MultilineUtil.java
/** * Helper method to remove empty lines on a multiline field. * /*from ww w.j a v a2s . co m*/ * @param lines an non null array of lines to process * @param keepAll if <code>true</code> this method will have the effect of sorting empty lines to the end, if <code>false</code>, empty lines will be removed * @return a String array with all nonempty lines contained in the lines array, the string may be empty if lines is empty, or no non-empty lines are present */ public String[] removeInnerEmptyLines(final String[] lines, final boolean keepAll) { Validate.notNull(lines, "lines cannot be null"); if (lines.length == 0) return lines; final ArrayList<String> text = new ArrayList<String>(); ArrayList<String> empty = null; if (keepAll) { empty = new ArrayList<String>(); } for (int i = 0; i < lines.length; i++) { if (isEmpty(lines[i])) { if (keepAll) { empty.add(lines[i]); } } else { text.add(lines[i]); } } if (keepAll) { text.addAll(empty); } if (log.isLoggable(Level.FINE)) log.fine("text: " + text); return text.toArray(new String[text.size()]); }
From source file:com.qualogy.qafe.bind.orm.jibx.ORMBinder.java
/** * closing the bytearrayinputstream has now effect * @param doc/*from ww w. j a va2s. c o m*/ * @param root * @return */ public static Object bind(Document doc, String root, Class expectedResultType, boolean readInDebugMode) { ByteArrayOutputStream bout = new ByteArrayOutputStream(); // Refactor the commented code below, to make Google App Engine (GAE) compatible // The com.sun.org.apache.xml.internal.serialize.OutputFormat class is restricted /*OutputFormat format = new OutputFormat(doc); format.setIndenting(true); try { new XMLSerializer(bout, format).serialize(doc); } catch (IOException e) { throw new BindException(e); }*/ /*try { Source source = new DOMSource(doc); Result result = new StreamResult(bout); TransformerFactory factory = TransformerFactory.newInstance(); Transformer transformer = factory.newTransformer(); transformer.transform(source, result); } catch (Exception e) { throw new BindException(e); }*/ String docAsString = docToString(doc); byte[] docAsBytes = null; try { docAsBytes = docAsString.getBytes("UTF-8"); } catch (UnsupportedEncodingException e2) { // TODO Auto-generated catch block e2.printStackTrace(); } ByteArrayInputStream in = new ByteArrayInputStream(docAsBytes); //ByteArrayInputStream in = new ByteArrayInputStream(bout.toByteArray()); if (readInDebugMode && logger.isLoggable(Level.FINE)) { try { logger.fine(docToString(in)); } catch (IOException e1) { logger.log(Level.WARNING, "unable to print the merged document contents due to error", e1); } } Object obj = null; try { IBindingFactory bfact = BindingDirectory.getFactory(expectedResultType); IUnmarshallingContext uctx = bfact.createUnmarshallingContext(); obj = uctx.unmarshalDocument(in, root, ENCODING_TYPE); } catch (JiBXException e) { String line = JIBXExceptionTranslator.getLine(e, in); BindException be = (line != null) ? new BindException(e.getMessage() + "\nLine: " + line, e) : new BindException(e); throw be; } catch (ClassCastException e) { throw new BindException(e); } return obj; }