本文整理汇总了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;
}
示例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;
}
示例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);
}
示例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.");
}
}
示例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;
}
}
示例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);
}
}
示例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.");
}
}
}
示例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);
}
}
示例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");
}
示例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");
}
示例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();
}
示例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());
}
示例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;
}
}
示例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;
}
}
示例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;
}