本文整理匯總了Java中org.jfree.util.Log.warn方法的典型用法代碼示例。如果您正苦於以下問題:Java Log.warn方法的具體用法?Java Log.warn怎麽用?Java Log.warn使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jfree.util.Log
的用法示例。
在下文中一共展示了Log.warn方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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;
}
示例2: 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);
}
}
示例3: 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);
}
}
示例4: 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());
}
示例5: 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;
}
}
示例6: 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;
}
}
示例7: 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;
}
示例8: doMessageProcessing
import org.jfree.util.Log; //導入方法依賴的package包/類
private void doMessageProcessing() {
log().debug("doMessageProcessing: Processing messages.");
boolean cont = true;
while (cont ) {
try {
log().debug("doMessageProcessing: taking message from queue..");
Tl1AutonomousMessage message = m_tl1Queue.take();
log().debug("doMessageProcessing: message taken: "+message);
processMessage(message);
} catch (InterruptedException e) {
Log.warn("doMessageProcessing: received interrupt: "+e, e);
}
}
log().debug("doMessageProcessing: Exiting processing messages.");
}
示例9: loadClass
import org.jfree.util.Log; //導入方法依賴的package包/類
/**
* Loads a class by its fully qualified name.
*
* @param name the class name.
*
* @return The class (or <code>null</code> if there was a problem loading the class).
*/
protected Class loadClass(final String name) {
try {
return ObjectUtilities.getClassLoader(JavaSourceCollector.class).loadClass(name);
}
catch (Exception e) {
Log.warn (new Log.SimpleMessage("Do not process: Failed to load class:", name));
return null;
}
}
示例10: parseXmlDocument
import org.jfree.util.Log; //導入方法依賴的package包/類
/**
* Parses the given specification and loads all includes specified in the files.
* This implementation does not check for loops in the include files.
*
* @param resource the url of the xml specification.
* @param isInclude an include?
*
* @throws org.jfree.xml.util.ObjectDescriptionException if an error occured which prevented the
* loading of the specifications.
*/
protected void parseXmlDocument(final URL resource, final boolean isInclude)
throws ObjectDescriptionException {
try {
final InputStream in = new BufferedInputStream(resource.openStream());
final SAXParserFactory factory = SAXParserFactory.newInstance();
final SAXParser saxParser = factory.newSAXParser();
final XMLReader reader = saxParser.getXMLReader();
final SAXModelHandler handler = new SAXModelHandler(resource, isInclude);
try {
reader.setProperty
("http://xml.org/sax/properties/lexical-handler",
getCommentHandler());
}
catch (SAXException se) {
Log.debug("Comments are not supported by this SAX implementation.");
}
reader.setContentHandler(handler);
reader.setDTDHandler(handler);
reader.setErrorHandler(handler);
reader.parse(new InputSource(in));
in.close();
}
catch (Exception e) {
// unable to init
Log.warn("Unable to load factory specifications", e);
throw new ObjectDescriptionException("Unable to load object factory specs.", e);
}
}
示例11: doSwitchRenderer
import org.jfree.util.Log; //導入方法依賴的package包/類
public void doSwitchRenderer() {
long endActivateTime = new Date().getTime();
this.activateSwitchTime = endActivateTime - this.startActivateTime;
this.nbSwitch++;
if (this.nbSwitch != this.nbActivate) {
Log.warn("Renderer " + this.renderer.toString()
+ " has incoherent activate/switch count : "
+ this.nbActivate + "/" + this.nbSwitch);
}
}
示例12: doFinalizeRenderer
import org.jfree.util.Log; //導入方法依賴的package包/類
public void doFinalizeRenderer() {
long finalizeTime = new Date().getTime();
this.initializeFinalizeTime = finalizeTime - this.startInitializeTime;
this.nbFinalize++;
if (this.nbFinalize != this.nbInitialize) {
Log.warn("Renderer " + this.renderer.toString()
+ " has incoherent initialize/finalize count : "
+ this.nbInitialize + "/" + this.nbFinalize);
}
}
示例13: setMonth
import org.jfree.util.Log; //導入方法依賴的package包/類
public void setMonth(Integer month) {
if(month != null && (month < 1 || month > 12)) {
Log.warn("Invalid month " + month);
return;
}
this.month = month;
}
示例14: setDay
import org.jfree.util.Log; //導入方法依賴的package包/類
public void setDay(Integer day) {
if(day != null && (day < 1 || day > 31)) {
Log.warn("Invalid day " + day);
return;
// throw new IllegalArgumentException("Invalid day " + day);
}
this.day = day;
}
示例15: testLogMessage
import org.jfree.util.Log; //導入方法依賴的package包/類
/**
* Tests the log message methods.
*/
public void testLogMessage () {
Log.debug("Test");
Log.info("Test");
Log.warn("Test");
Log.error("Test");
}