From: Roland Haeder Date: Tue, 8 Sep 2015 20:44:10 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=5ab364fa440268c81b2424686adcb856bfa86830;p=jcore-logger-ejb.git Continued: - moved classes to maybe their final resting place? ;-) - updated jcore.jar + jshop-ee-lib.jar Signed-off-by:Roland Häder --- diff --git a/lib/jcore.jar b/lib/jcore.jar index 893e82c..217c364 100644 Binary files a/lib/jcore.jar and b/lib/jcore.jar differ diff --git a/lib/jshop-ee-lib.jar b/lib/jshop-ee-lib.jar index 54ab89b..7b53640 100644 Binary files a/lib/jshop-ee-lib.jar and b/lib/jshop-ee-lib.jar differ diff --git a/nbproject/project.properties b/nbproject/project.properties index dd8aaf1..c06c85a 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -30,9 +30,9 @@ dist.jar=${dist.dir}/jcore-ee-logger.jar dist.javadoc.dir=${dist.dir}/javadoc endorsed.classpath= excludes= -file.reference.log4j-api-2.3.jar=lib\\log4j-api-2.3.jar -file.reference.log4j-core-2.3.jar=lib\\log4j-core-2.3.jar -file.reference.log4j-web-2.3.jar=lib\\log4j-web-2.3.jar +file.reference.log4j-api-2.3.jar=lib/log4j-api-2.3.jar +file.reference.log4j-core-2.3.jar=lib/log4j-core-2.3.jar +file.reference.log4j-web-2.3.jar=lib/log4j-web-2.3.jar includes=** jar.archive.disabled=${jnlp.enabled} jar.compress=false @@ -79,7 +79,7 @@ manifest.custom.codebase= # Optional override of default Permissions manifest attribute (supported values: sandbox, all-permissions) manifest.custom.permissions= meta.inf.dir=${src.dir}/META-INF -mkdist.disabled=true +mkdist.disabled=false platform.active=default_platform project.license=gpl30 run.classpath=\ diff --git a/src/org/mxchange/jcoreeelogger/beans/local/logger/LoggerBean.java b/src/org/mxchange/jcoreeelogger/beans/local/logger/LoggerBean.java new file mode 100644 index 0000000..ad64314 --- /dev/null +++ b/src/org/mxchange/jcoreeelogger/beans/local/logger/LoggerBean.java @@ -0,0 +1,112 @@ +/* + * Copyright (C) 2015 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.jcoreeelogger.beans.local.logger; + +import javax.ejb.Singleton; +import javax.ejb.Startup; +import javax.inject.Inject; +import org.apache.logging.log4j.Logger; + +/** + * A "centralized" logger bean + * + * @author Roland Haeder + */ +@Startup +@Singleton(name = "logger", mappedName = "logger") +public class LoggerBean implements LoggerBeanLocal { + + /** + * Logger instance + */ + @Inject + private Logger logger; + + @Override + public void logDebug (String message) { + // Deligate to logger + this.getLogger().debug(message); + } + + @Override + public void logDebug (String message, Throwable cause) { + // Deligate to logger + this.getLogger().debug(message, cause); + } + + @Override + public void logException (final Throwable throwable) { + // Deligate to logger + this.getLogger().catching(throwable); + } + + @Override + public void logFatal (final String message, final Throwable cause) { + // Deligate to logger + this.getLogger().fatal(message, cause); + } + + @Override + public void logInfo (final String message) { + // Deligate to logger + this.getLogger().info(message); + } + + @Override + public void logFatal (final String message) { + // Deligate to logger + this.getLogger().fatal(message); + } + + @Override + public void logInfo (final String message, final Throwable cause) { + // Deligate to logger + this.getLogger().info(message, cause); + } + + @Override + public void logTrace (final String message) { + // Deligate to logger + this.getLogger().trace(message); + } + + @Override + public void logTrace (final String message, final Throwable cause) { + // Deligate to logger + this.getLogger().trace(message, cause); + } + + @Override + public void logWarning (final String message) { + // Deligate to logger + this.getLogger().warn(message); + } + + @Override + public void logWarning (final String message, final Throwable cause) { + // Deligate to logger + this.getLogger().warn(message, cause); + } + + /** + * Getter for logger + * @return Logger + */ + private Logger getLogger () { + return this.logger; + } +} diff --git a/src/org/mxchange/jcoreeelogger/beans/local/logger/LoggerBeanLocal.java b/src/org/mxchange/jcoreeelogger/beans/local/logger/LoggerBeanLocal.java new file mode 100644 index 0000000..344d988 --- /dev/null +++ b/src/org/mxchange/jcoreeelogger/beans/local/logger/LoggerBeanLocal.java @@ -0,0 +1,109 @@ +/* + * Copyright (C) 2015 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.jcoreeelogger.beans.local.logger; + +import javax.ejb.Local; + +/** + *An interface for "centralized" logger + * + * @author Roland Haeder + */ +@Local +public interface LoggerBeanLocal { + /** + * Log an exception + * + * @param throwable Thrown exception + */ + public void logException (final Throwable throwable); + + /** + * Log a debug message + * + * @param message Message to log + */ + public void logDebug (final String message); + + /** + * Log a trace message + * + * @param message Message to log + */ + public void logTrace (final String message); + + /** + * Log a info message + * + * @param message Message to log + */ + public void logInfo (final String message); + + /** + * Log a warning message + * + * @param message Message to log + */ + public void logWarning (final String message); + + /** + * Log a fatal message + * + * @param message Message to log + */ + public void logFatal (final String message); + + /** + * Log a trace message and cause + * + * @param message Message to log + * @param cause Causing exception + */ + public void logTrace (final String message, final Throwable cause); + + /** + * Log a info message and cause + * + * @param message Message to log + * @param cause Causing exception + */ + public void logInfo (final String message, final Throwable cause); + + /** + * Log a debug message and cause + * + * @param message Message to log + * @param cause Causing exception + */ + public void logDebug (final String message, final Throwable cause); + + /** + * Log a warning message and cause + * + * @param message Message to log + * @param cause Causing exception + */ + public void logWarning (final String message, final Throwable cause); + + /** + * Log a fatal message and cause + * + * @param message Message to log + * @param cause Causing exception + */ + public void logFatal (final String message, final Throwable cause); +} diff --git a/src/org/mxchange/jshopejb/beans/local/logger/LoggerBean.java b/src/org/mxchange/jshopejb/beans/local/logger/LoggerBean.java deleted file mode 100644 index e4a0e8d..0000000 --- a/src/org/mxchange/jshopejb/beans/local/logger/LoggerBean.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (C) 2015 Roland Haeder - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.mxchange.jshopejb.beans.local.logger; - -import javax.ejb.Singleton; -import javax.ejb.Startup; -import javax.inject.Inject; -import org.apache.logging.log4j.Logger; - -/** - * A "centralized" logger bean - * - * @author Roland Haeder - */ -@Startup -@Singleton(name = "logger", mappedName = "logger") -public class LoggerBean implements LoggerBeanLocal { - - /** - * Logger instance - */ - @Inject - private Logger logger; - - @Override - public void logDebug (String message) { - // Deligate to logger - this.getLogger().debug(message); - } - - @Override - public void logDebug (String message, Throwable cause) { - // Deligate to logger - this.getLogger().debug(message, cause); - } - - @Override - public void logException (final Throwable throwable) { - // Deligate to logger - this.getLogger().catching(throwable); - } - - @Override - public void logFatal (final String message, final Throwable cause) { - // Deligate to logger - this.getLogger().fatal(message, cause); - } - - @Override - public void logInfo (final String message) { - // Deligate to logger - this.getLogger().info(message); - } - - @Override - public void logFatal (final String message) { - // Deligate to logger - this.getLogger().fatal(message); - } - - @Override - public void logInfo (final String message, final Throwable cause) { - // Deligate to logger - this.getLogger().info(message, cause); - } - - @Override - public void logTrace (final String message) { - // Deligate to logger - this.getLogger().trace(message); - } - - @Override - public void logTrace (final String message, final Throwable cause) { - // Deligate to logger - this.getLogger().trace(message, cause); - } - - @Override - public void logWarning (final String message) { - // Deligate to logger - this.getLogger().warn(message); - } - - @Override - public void logWarning (final String message, final Throwable cause) { - // Deligate to logger - this.getLogger().warn(message, cause); - } - - /** - * Getter for logger - * @return Logger - */ - private Logger getLogger () { - return this.logger; - } -} diff --git a/src/org/mxchange/jshopejb/beans/local/logger/LoggerBeanLocal.java b/src/org/mxchange/jshopejb/beans/local/logger/LoggerBeanLocal.java deleted file mode 100644 index 4eab423..0000000 --- a/src/org/mxchange/jshopejb/beans/local/logger/LoggerBeanLocal.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (C) 2015 Roland Haeder - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.mxchange.jshopejb.beans.local.logger; - -import javax.ejb.Local; - -/** - *An interface for "centralized" logger - * - * @author Roland Haeder - */ -@Local -public interface LoggerBeanLocal { - /** - * Log an exception - * - * @param throwable Thrown exception - */ - public void logException (final Throwable throwable); - - /** - * Log a debug message - * - * @param message Message to log - */ - public void logDebug (final String message); - - /** - * Log a trace message - * - * @param message Message to log - */ - public void logTrace (final String message); - - /** - * Log a info message - * - * @param message Message to log - */ - public void logInfo (final String message); - - /** - * Log a warning message - * - * @param message Message to log - */ - public void logWarning (final String message); - - /** - * Log a fatal message - * - * @param message Message to log - */ - public void logFatal (final String message); - - /** - * Log a trace message and cause - * - * @param message Message to log - * @param cause Causing exception - */ - public void logTrace (final String message, final Throwable cause); - - /** - * Log a info message and cause - * - * @param message Message to log - * @param cause Causing exception - */ - public void logInfo (final String message, final Throwable cause); - - /** - * Log a debug message and cause - * - * @param message Message to log - * @param cause Causing exception - */ - public void logDebug (final String message, final Throwable cause); - - /** - * Log a warning message and cause - * - * @param message Message to log - * @param cause Causing exception - */ - public void logWarning (final String message, final Throwable cause); - - /** - * Log a fatal message and cause - * - * @param message Message to log - * @param cause Causing exception - */ - public void logFatal (final String message, final Throwable cause); -}