當前位置: 首頁>>代碼示例>>Java>>正文


Java Log類代碼示例

本文整理匯總了Java中org.jfree.util.Log的典型用法代碼示例。如果您正苦於以下問題:Java Log類的具體用法?Java Log怎麽用?Java Log使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Log類屬於org.jfree.util包,在下文中一共展示了Log類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: publishMetaDataFile

import org.jfree.util.Log; //導入依賴的package包/類
/**
 * Jersey call to use the put service to load a metadataFile file into the Jcr repsoitory
 * @param metadataFile
 * @param domainId is fileName
 * @throws Exception
 * return code to detrmine next step
 */
public int publishMetaDataFile(InputStream metadataFile, String domainId) throws Exception {
  String storeDomainUrl = biServerConnection.getUrl() + "plugin/data-access/api/metadata/import";
  WebResource resource = client.resource(storeDomainUrl);

  int response = ModelServerPublish.PUBLISH_FAILED;
  FormDataMultiPart part = new FormDataMultiPart();
  part.field("domainId", domainId, MediaType.MULTIPART_FORM_DATA_TYPE)
    .field("metadataFile", metadataFile, MediaType.MULTIPART_FORM_DATA_TYPE);
  part.getField("metadataFile").setContentDisposition(
      FormDataContentDisposition.name("metadataFile")
      .fileName(domainId).build());
  try {
    ClientResponse resp = resource
        .type(MediaType.MULTIPART_FORM_DATA_TYPE)
        .put(ClientResponse.class, part);
    if(resp != null && resp.getStatus() == 200){
      response = ModelServerPublish.PUBLISH_SUCCESS;
    }
  } catch (Exception ex) {
    Log.error(ex.getMessage());      
  }
  return response;
}
 
開發者ID:pentaho,項目名稱:pdi-agile-bi-plugin,代碼行數:31,代碼來源:ModelServerPublish.java

示例2: configure

import org.jfree.util.Log; //導入依賴的package包/類
/**
 * Configures the module and raises the state to STATE_CONFIGURED if the
 * module is not yet configured.
 *
 * @param subSystem  the sub-system.
 * 
 * @return true, if the module was configured, false otherwise.
 */
public boolean configure(final SubSystem subSystem)
{
  if (this.state == STATE_NEW)
  {
    try
    {
      this.module.configure(subSystem);
      this.state = STATE_CONFIGURED;
      return true;
    }
    catch (NoClassDefFoundError noClassDef)
    {
      Log.warn (new Log.SimpleMessage("Unable to load module classes for ",
              this.module.getName(), ":", noClassDef.getMessage()));
      this.state = STATE_ERROR;
    }
    catch (Exception e)
    {
      if (Log.isDebugEnabled())
      {
        // its still worth a warning, but now we are more verbose ...
        Log.warn("Unable to configure the module " + this.module.getName(), e);
      }
      else if (Log.isWarningEnabled())
      {
        Log.warn("Unable to configure the module " + this.module.getName());
      }
      this.state = STATE_ERROR;
    }
  }
  return false;
}
 
開發者ID:mdzio,項目名稱:ccu-historian,代碼行數:41,代碼來源:PackageState.java

示例3: load

import org.jfree.util.Log; //導入依賴的package包/類
/**
 * Loads all modules mentioned in the report configuration starting with
 * the given prefix. This method is used during the boot process of
 * JFreeReport. You should never need to call this method directly.
 *
 * @param modulePrefix the module prefix.
 */
public void load(final String modulePrefix) {
    if (this.initSections.contains(modulePrefix)) {
        return;
    }
    this.initSections.add(modulePrefix);

    final Configuration config = this.booter.getGlobalConfig();
    final Iterator it = config.findPropertyKeys(modulePrefix);
    int count = 0;
    while (it.hasNext()) {
        final String key = (String) it.next();
        if (key.endsWith(".Module")) {
            final String moduleClass = config.getConfigProperty(key);
            if (moduleClass != null && moduleClass.length() > 0) {
                addModule(moduleClass);
                count++;
            }
        }
    }
    Log.debug("Loaded a total of " + count + " modules under prefix: " + modulePrefix);
}
 
開發者ID:mdzio,項目名稱:ccu-historian,代碼行數:29,代碼來源:PackageManager.java

示例4: initialize

import org.jfree.util.Log; //導入依賴的package包/類
/**
 * Initalizes the module. This method initializes the logging system, if the
 * System.out logtarget is selected.
 *
 * @param subSystem the sub-system.
 * @throws ModuleInitializeException if an error occured.
 */
public void initialize(final SubSystem subSystem)
        throws ModuleInitializeException
{
  if (LogConfiguration.isDisableLogging())
  {
    return;
  }

  if (LogConfiguration.getLogTarget().equals
          (PrintStreamLogTarget.class.getName()))
  {
    DefaultLog.installDefaultLog();
    Log.getInstance().addTarget(new PrintStreamLogTarget());

    if ("true".equals(subSystem.getGlobalConfig().getConfigProperty
            ("org.jfree.base.LogAutoInit")))
    {
      Log.getInstance().init();
    }
    Log.info("Default log target started ... previous log messages " +
            "could have been ignored.");
  }
}
 
開發者ID:mdzio,項目名稱:ccu-historian,代碼行數:31,代碼來源:DefaultLogModule.java

示例5: loadBooter

import org.jfree.util.Log; //導入依賴的package包/類
/**
 * Loads the specified booter implementation.
 *
 * @param classname  the class name.
 *
 * @return The boot class.
 */
protected AbstractBoot loadBooter(final String classname) {
    if (classname == null) {
        return null;
    }
    try {
        final Class c = ObjectUtilities.getClassLoader(
                getClass()).loadClass(classname);
        final Method m = c.getMethod("getInstance", (Class[]) null);
        return (AbstractBoot) m.invoke(null, (Object[]) null);
    }
    catch (Exception e) {
        Log.info ("Unable to boot dependent class: " + classname);
        return null;
    }
}
 
開發者ID:mdzio,項目名稱:ccu-historian,代碼行數:23,代碼來源:AbstractBoot.java

示例6: load

import org.jfree.util.Log; //導入依賴的package包/類
/**
 * Loads the properties stored in the given file. This method does nothing if
 * the file does not exist or is unreadable. Appends the contents of the loaded
 * properties to the already stored contents.
 *
 * @param in the input stream used to read the properties.
 */
public void load(final InputStream in)
{
  if (in == null)
  {
    throw new NullPointerException();
  }

  try
  {
    final BufferedInputStream bin = new BufferedInputStream(in);
    final Properties p = new Properties();
    p.load(bin);
    this.getConfiguration().putAll(p);
    bin.close();
  }
  catch (IOException ioe)
  {
    Log.warn("Unable to read configuration", ioe);
  }

}
 
開發者ID:mdzio,項目名稱:ccu-historian,代碼行數:29,代碼來源:PropertyFileConfiguration.java

示例7: addManualMapping

import org.jfree.util.Log; //導入依賴的package包/類
/**
 * Adds a manual mapping.
 * 
 * @param mappingInfo  the mapping.
 */
public void addManualMapping(final ManualMappingInfo mappingInfo) {
    if (!this.mappingInfos.containsKey(mappingInfo.getBaseClass())) {
        this.manualMappings.add(mappingInfo);
        this.mappingInfos.put(mappingInfo.getBaseClass(), mappingInfo);
    }
    else {
        final Object o = this.mappingInfos.get(mappingInfo.getBaseClass());
        if (o instanceof ManualMappingInfo) {
            Log.info ("Duplicate manual mapping: " + mappingInfo.getBaseClass());
        }
        else {
            throw new IllegalArgumentException
                ("This mapping is already a multiplex mapping.");
        }
    }
}
 
開發者ID:mdzio,項目名稱:ccu-historian,代碼行數:22,代碼來源:MappingModel.java

示例8: startElement

import org.jfree.util.Log; //導入依賴的package包/類
/**
 * This method is called at the start of an element.
 *
 * @param tagName  the tag name.
 * @param attrs  the attributes.
 *
 * @throws SAXException if there is a parsing error.
 * @throws XmlReaderException if there is a reader error.
 */
public final void startElement(final String tagName, final Attributes attrs)
    throws XmlReaderException, SAXException {
    if (this.firstCall) {
        if (!this.tagName.equals(tagName)) {
            throw new SAXException("Expected <" + this.tagName + ">, found <" + tagName + ">");
        }
        this.firstCall = false;
        startParsing(attrs);
    }
    else {
        final XmlReadHandler childHandler = getHandlerForChild(tagName, attrs);
        if (childHandler == null) {
            Log.warn ("Unknown tag <" + tagName + ">");
            return;
        }
        childHandler.init(getRootHandler(), tagName);
        this.rootHandler.recurse(childHandler, tagName, attrs);
    }
}
 
開發者ID:mdzio,項目名稱:ccu-historian,代碼行數:29,代碼來源:AbstractXmlReadHandler.java

示例9: stringToHintField

import org.jfree.util.Log; //導入依賴的package包/類
private Object stringToHintField (final String name) {
    final Field[] fields = RenderingHints.class.getFields();
    for (int i = 0; i < fields.length; i++) {
        final Field f = fields[i];
        if (Modifier.isFinal(f.getModifiers()) 
            && Modifier.isPublic(f.getModifiers()) 
            && Modifier.isStatic(f.getModifiers())) {
            try {
                final String fieldName = f.getName();
                if (fieldName.equals(name)) {
                    return f.get(null);
                }
            }
            catch (Exception e) {
                Log.info ("Unable to write RenderingHint", e);
            }
        }
    }
    throw new IllegalArgumentException("Invalid value given");
}
 
開發者ID:mdzio,項目名稱:ccu-historian,代碼行數:21,代碼來源:RenderingHintValueReadHandler.java

示例10: hintFieldToString

import org.jfree.util.Log; //導入依賴的package包/類
private String hintFieldToString(final Object o) {
    final Field[] fields = RenderingHints.class.getFields();
    for (int i = 0; i < fields.length; i++) {
        final Field f = fields[i];
        if (Modifier.isFinal(f.getModifiers()) 
            && Modifier.isPublic(f.getModifiers()) 
            && Modifier.isStatic(f.getModifiers())) {
            try {
                final Object value = f.get(null);
                if (o.equals(value)) {
                    return f.getName();
                }
            }
            catch (Exception e) {
                Log.info ("Unable to write RenderingHint", e);
            }
        }
    }
    throw new IllegalArgumentException("Invalid value given");
}
 
開發者ID:mdzio,項目名稱:ccu-historian,代碼行數:21,代碼來源:RenderingHintsWriteHandler.java

示例11: getParser

import org.jfree.util.Log; //導入依賴的package包/類
/**
 * Returns a SAX parser.
 *
 * @return a SAXParser.
 *
 * @throws ParserConfigurationException if there is a problem configuring the parser.
 * @throws SAXException if there is a problem with the parser initialisation
 */
protected SAXParser getParser() throws ParserConfigurationException, SAXException {
    if (this.factory == null) {
        this.factory = SAXParserFactory.newInstance();
        if (isValidateDTD()) {
            try {
                // dont touch the validating feature, if not needed ..
                this.factory.setValidating(true);
            }
            catch (Exception ex) {
                // the parser does not like the idea of validating ...
                Log.debug("The parser will not validate the xml document.", ex);
            }
        }
    }
    return this.factory.newSAXParser();
}
 
開發者ID:mdzio,項目名稱:ccu-historian,代碼行數:25,代碼來源:ParserFrontend.java

示例12: setParameterFromObject

import org.jfree.util.Log; //導入依賴的package包/類
/**
 * Sets the parameters of this description object to match the supplied object.
 *
 * @param o  the object (should be an instance of <code>URL</code>).
 *
 * @throws ObjectFactoryException if the object is not an instance of <code>URL</code>.
 */
public void setParameterFromObject(final Object o) throws ObjectFactoryException {
    if (!(o instanceof URL)) {
        throw new ObjectFactoryException("Is no instance of java.net.URL");
    }

    final URL comp = (URL) o;
    final String baseURL = getConfig().getConfigProperty(Parser.CONTENTBASE_KEY);
    try {
        final URL bURL = new URL(baseURL);
        setParameter("value", IOUtils.getInstance().createRelativeURL(comp, bURL));
    }
    catch (Exception e) {
        Log.warn("BaseURL is invalid: ", e);
    }
    setParameter("value", comp.toExternalForm());
}
 
開發者ID:mdzio,項目名稱:ccu-historian,代碼行數:24,代碼來源:URLObjectDescription.java

示例13: createObject

import org.jfree.util.Log; //導入依賴的package包/類
/**
 * Creates an object based on the description.
 *
 * @return The object.
 */
public Object createObject() {
    try {
        final Collection l = (Collection) getObjectClass().newInstance();
        int counter = 0;
        while (getParameterDefinition(String.valueOf(counter)) != null) {
            final Object value = getParameter(String.valueOf(counter));
            if (value == null) {
                break;
            }

            l.add(value);
            counter += 1;
        }
        return l;
    }
    catch (Exception ie) {
        Log.warn("Unable to instantiate Object", ie);
        return null;
    }
}
 
開發者ID:mdzio,項目名稱:ccu-historian,代碼行數:26,代碼來源:CollectionObjectDescription.java

示例14: loadClass

import org.jfree.util.Log; //導入依賴的package包/類
/**
 * Loads the given class, and ignores all exceptions which may occur
 * during the loading. If the class was invalid, null is returned instead.
 *
 * @param className the name of the class to be loaded.
 * @return the class or null.
 */
protected Class loadClass(final String className) {
    if (className == null) {
        return null;
    }
    if (className.startsWith("::")) {
        return BasicTypeSupport.getClassRepresentation(className);
    }
    try {
        return ObjectUtilities.getClassLoader(getClass()).loadClass(className);
    }
    catch (Exception e) {
        // ignore buggy classes for now ..
        Log.warn("Unable to load class", e);
        return null;
    }
}
 
開發者ID:mdzio,項目名稱:ccu-historian,代碼行數:24,代碼來源:AbstractModelReader.java

示例15: startObjectDefinition

import org.jfree.util.Log; //導入依賴的package包/類
/**
 * Starts a object definition. The object definition collects all properties of
 * an bean-class and defines, which constructor should be used when creating the
 * class.
 *
 * @param className the class name of the defined object
 * @param register the (optional) register name, to lookup and reference the object later.
 * @param ignore  ignore?
 * 
 * @return true, if the definition was accepted, false otherwise.
 * @throws ObjectDescriptionException if an unexpected error occured.
 */
protected boolean startObjectDefinition(final String className, final String register, final boolean ignore)
    throws ObjectDescriptionException {

    if (ignore) {
        return false;
    }
    this.target = loadClass(className);
    if (this.target == null) {
        Log.warn(new Log.SimpleMessage("Failed to load class ", className));
        return false;
    }
    this.registerName = register;
    this.propertyDefinition = new ArrayList();
    this.attributeDefinition = new ArrayList();
    this.constructorDefinition = new ArrayList();
    this.lookupDefinitions = new ArrayList();
    this.orderedNames = new ArrayList();
    return true;
}
 
開發者ID:mdzio,項目名稱:ccu-historian,代碼行數:32,代碼來源:ObjectFactoryLoader.java


注:本文中的org.jfree.util.Log類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。