From: Roland Haeder Date: Mon, 19 Oct 2015 07:42:13 +0000 (+0200) Subject: Renamed logger to loggerBeanLocal to make it clear that this is a local (interface... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=64465fceb4695b3e3daeeb592984a949f99b7902;p=addressbook-swing.git Renamed logger to loggerBeanLocal to make it clear that this is a local (interface) logger bean Signed-off-by:Roland Häder --- diff --git a/src/org/mxchange/addressbook/BaseAddressbookSystem.java b/src/org/mxchange/addressbook/BaseAddressbookSystem.java index a0e2457..d18c04e 100644 --- a/src/org/mxchange/addressbook/BaseAddressbookSystem.java +++ b/src/org/mxchange/addressbook/BaseAddressbookSystem.java @@ -34,7 +34,7 @@ public abstract class BaseAddressbookSystem extends BaseFrameworkSystem { * Logger instance */ @Log - private LoggerBeanLocal logger; + private LoggerBeanLocal loggerBeanLocal; /** * Protected constructor @@ -44,8 +44,8 @@ public abstract class BaseAddressbookSystem extends BaseFrameworkSystem { // Get initial context Context context = new InitialContext(); - // Lookup logger - this.logger = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N + // Lookup loggerBeanLocal + this.loggerBeanLocal = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N } catch (final NamingException ex) { // Continue to throw throw new RuntimeException(ex); @@ -66,12 +66,12 @@ public abstract class BaseAddressbookSystem extends BaseFrameworkSystem { } /** - * Getter for logger instance + * Getter for loggerBeanLocal instance *

* @return Logger instance */ - protected LoggerBeanLocal getLogger () { - return this.logger; + protected LoggerBeanLocal getLoggerBeanLocal () { + return this.loggerBeanLocal; } /** diff --git a/src/org/mxchange/addressbook/application/AddressbookApplication.java b/src/org/mxchange/addressbook/application/AddressbookApplication.java index 20b26ac..1a51b6a 100644 --- a/src/org/mxchange/addressbook/application/AddressbookApplication.java +++ b/src/org/mxchange/addressbook/application/AddressbookApplication.java @@ -85,7 +85,7 @@ public class AddressbookApplication extends BaseApplication implements Applicati * Logger instance */ @Log - private LoggerBeanLocal logger; + private LoggerBeanLocal loggerBeanLocal; /** * Protected constructor @@ -96,8 +96,8 @@ public class AddressbookApplication extends BaseApplication implements Applicati // Get context Context context = new InitialContext(); - // Get logger - this.logger = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N + // Get loggerBeanLocal + this.loggerBeanLocal = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N } catch (final NamingException ex) { // Output it and exit System.err.println(MessageFormat.format("Cannot initialize: {0}", ex)); //NOI18N @@ -112,7 +112,7 @@ public class AddressbookApplication extends BaseApplication implements Applicati @Override public void doBootstrap () { - this.getLogger().logDebug("Initializing application ..."); //NOI18N + this.getLoggerBeanLocal().logDebug("Initializing application ..."); //NOI18N // Init client variable Client client = null; @@ -120,19 +120,19 @@ public class AddressbookApplication extends BaseApplication implements Applicati // Is console or Swing choosen? if (this.isConsole()) { // Debug message - this.getLogger().logDebug("Initializing console client ..."); //NOI18N + this.getLoggerBeanLocal().logDebug("Initializing console client ..."); //NOI18N // Init console client instance client = new ConsoleClient(this); } else if (this.isGui()) { // Debug message - this.getLogger().logDebug("Initializing GUI (Swing) client ..."); //NOI18N + this.getLoggerBeanLocal().logDebug("Initializing GUI (Swing) client ..."); //NOI18N // Init console instance client = new SwingClient(this); } else { // Not client choosen - this.getLogger().logError("No client choosen. Cannot launch."); //NOI18N + this.getLoggerBeanLocal().logError("No client choosen. Cannot launch."); //NOI18N try { this.doShutdown(); @@ -155,7 +155,7 @@ public class AddressbookApplication extends BaseApplication implements Applicati this.getClient().enableIsRunning(); // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } @Override @@ -164,7 +164,7 @@ public class AddressbookApplication extends BaseApplication implements Applicati AddressbookClient client = (AddressbookClient) this.getClient(); // Debug message - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N // TODO The application should be running now // Output introduction @@ -183,7 +183,7 @@ public class AddressbookApplication extends BaseApplication implements Applicati client.doUserMenuChoice(); } catch (final UnhandledUserChoiceException ex) { // Log exception - this.getLogger().logException(ex); + this.getLoggerBeanLocal().logException(ex); } try { @@ -196,7 +196,7 @@ public class AddressbookApplication extends BaseApplication implements Applicati // --- Main loop ends here --- // Debug message - this.getLogger().logDebug("Main loop exit - shutting down ..."); //NOI18N + this.getLoggerBeanLocal().logDebug("Main loop exit - shutting down ..."); //NOI18N } /** @@ -205,13 +205,13 @@ public class AddressbookApplication extends BaseApplication implements Applicati @Override public void doShutdown () throws SQLException, IOException { // Trace message - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N // Shutdown client this.getClient().doShutdown(); // Regular exit reached - this.getLogger().logInfo("End of program (last line)"); //NOI18N + this.getLoggerBeanLocal().logInfo("End of program (last line)"); //NOI18N System.exit(0); } @@ -219,7 +219,7 @@ public class AddressbookApplication extends BaseApplication implements Applicati * Enables console client by setting propper flag */ private void enableConsoleClient () { - this.getLogger().logDebug("Enabling console client (may become optional client) ..."); //NOI18N + this.getLoggerBeanLocal().logDebug("Enabling console client (may become optional client) ..."); //NOI18N this.consoleClient = true; this.guiClient = false; } @@ -228,7 +228,7 @@ public class AddressbookApplication extends BaseApplication implements Applicati * Enables GUI client by setting propper flag */ private void enableGuiClient () { - this.getLogger().logDebug("Enabling GUI client (may become new default client) ..."); //NOI18N + this.getLoggerBeanLocal().logDebug("Enabling GUI client (may become new default client) ..."); //NOI18N this.consoleClient = false; this.guiClient = true; } @@ -288,9 +288,9 @@ public class AddressbookApplication extends BaseApplication implements Applicati */ private void parseArguments (final String[] args) { // Trace message - this.getLogger().logTrace(MessageFormat.format("args()={0} - CALLED!", args.length)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("args()={0} - CALLED!", args.length)); //NOI18N // Debug message - this.getLogger().logDebug(MessageFormat.format("Parsing {0} arguments ...", args.length)); //NOI18N + this.getLoggerBeanLocal().logDebug(MessageFormat.format("Parsing {0} arguments ...", args.length)); //NOI18N for (final String arg : args) { // Switch on it switch (arg) { @@ -311,13 +311,13 @@ public class AddressbookApplication extends BaseApplication implements Applicati */ private void showIntro () { // Trace message - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N // Let the client show it this.getClient().showWelcome(); // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } /** @@ -326,7 +326,7 @@ public class AddressbookApplication extends BaseApplication implements Applicati * @param args Arguments handled to program */ private void start (final String args[]) { - this.getLogger().logInfo("Program is started."); //NOI18N + this.getLoggerBeanLocal().logInfo("Program is started."); //NOI18N try { // Init properties file @@ -348,7 +348,7 @@ public class AddressbookApplication extends BaseApplication implements Applicati } // Good bye, but this should not be reached ... - this.getLogger().logWarning("Unusual exit reached."); //NOI18N + this.getLoggerBeanLocal().logWarning("Unusual exit reached."); //NOI18N try { this.doShutdown(); @@ -372,12 +372,12 @@ public class AddressbookApplication extends BaseApplication implements Applicati } /** - * Getter for logger instance + * Getter for loggerBeanLocal instance *

* @return Logger instance */ - protected LoggerBeanLocal getLogger () { - return this.logger; + protected LoggerBeanLocal getLoggerBeanLocal () { + return this.loggerBeanLocal; } /** @@ -386,7 +386,7 @@ public class AddressbookApplication extends BaseApplication implements Applicati * @param exception Throwable */ protected void logException (final Throwable exception) { - this.getLogger().logException(exception); + this.getLoggerBeanLocal().logException(exception); } diff --git a/src/org/mxchange/addressbook/client/BaseAddressbookClient.java b/src/org/mxchange/addressbook/client/BaseAddressbookClient.java index 0091974..444095e 100644 --- a/src/org/mxchange/addressbook/client/BaseAddressbookClient.java +++ b/src/org/mxchange/addressbook/client/BaseAddressbookClient.java @@ -48,7 +48,7 @@ public abstract class BaseAddressbookClient extends BaseClient implements Addres * Logger instance */ @Log - private LoggerBeanLocal logger; + private LoggerBeanLocal loggerBeanLocal; /** * Menu system @@ -67,8 +67,8 @@ public abstract class BaseAddressbookClient extends BaseClient implements Addres // Get context Context context = new InitialContext(); - // Lookup logger - this.logger = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N + // Lookup loggerBeanLocal + this.loggerBeanLocal = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N } catch (final NamingException ex) { // Continue to throw throw new RuntimeException(ex); @@ -129,12 +129,12 @@ public abstract class BaseAddressbookClient extends BaseClient implements Addres protected abstract void fillMenuMap (); /** - * Getter for logger instance + * Getter for loggerBeanLocal instance *

* @return Logger instance */ - protected LoggerBeanLocal getLogger () { - return this.logger; + protected LoggerBeanLocal getLoggerBeanLocal () { + return this.loggerBeanLocal; } /** @@ -153,10 +153,10 @@ public abstract class BaseAddressbookClient extends BaseClient implements Addres */ protected void initContactManager () throws SQLException { // Trace message - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N // Debug message - this.getLogger().logDebug("Initializing contact manager ..."); //NOI18N + this.getLoggerBeanLocal().logDebug("Initializing contact manager ..."); //NOI18N // Init contact facade with console client // TODO Static initial amount of contacts @@ -166,10 +166,10 @@ public abstract class BaseAddressbookClient extends BaseClient implements Addres this.setFacade(facade); // Debug message - this.getLogger().logDebug("Contact manager has been initialized."); //NOI18N + this.getLoggerBeanLocal().logDebug("Contact manager has been initialized."); //NOI18N // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } /** @@ -178,8 +178,8 @@ public abstract class BaseAddressbookClient extends BaseClient implements Addres * @param throwable Throwable */ protected void logException (final Throwable throwable) { - // Deligate to logger - this.getLogger().logException(throwable); + // Deligate to loggerBeanLocal + this.getLoggerBeanLocal().logException(throwable); } /** @@ -189,7 +189,7 @@ public abstract class BaseAddressbookClient extends BaseClient implements Addres */ protected void showMenu (final String menuType) { // Trace message - this.getLogger().logTrace(MessageFormat.format("menuType={0} - CALLED!", menuType)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("menuType={0} - CALLED!", menuType)); //NOI18N // Get menu from type Menu menu = this.getMenu(menuType); @@ -205,6 +205,6 @@ public abstract class BaseAddressbookClient extends BaseClient implements Addres menu.show(this); // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } } diff --git a/src/org/mxchange/addressbook/client/console/ConsoleClient.java b/src/org/mxchange/addressbook/client/console/ConsoleClient.java index dd98ba2..65a6026 100644 --- a/src/org/mxchange/addressbook/client/console/ConsoleClient.java +++ b/src/org/mxchange/addressbook/client/console/ConsoleClient.java @@ -62,7 +62,7 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC */ public ConsoleClient (final Application application) { // Trace message - this.getLogger().logTrace(MessageFormat.format("application={0} - CALLED!", application)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("application={0} - CALLED!", application)); //NOI18N // Set application instance this.setApplication(application); @@ -71,13 +71,13 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC this.scanner = new Scanner(System.in, "UTF-8"); //NOI18N // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } @Override public void displayAddressBox (final Contact contact) { // Trace message - this.getLogger().logTrace(MessageFormat.format("contact={0} - CALLED!", contact)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("contact={0} - CALLED!", contact)); //NOI18N // Is it null? if (null == contact) { @@ -89,13 +89,13 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC this.outputMessage(MessageFormat.format("Strasse, PLZ Ort, Land: {0}\n{1} {2}\n{3}", contact.getContactStreet(), contact.getContactZipCode(), contact.getContactCity(), contact.getContactCountry())); // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } @Override public void displayNameBox (final Contact contact) { // Trace message - this.getLogger().logTrace(MessageFormat.format("contact={0} - CALLED!", contact)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("contact={0} - CALLED!", contact)); //NOI18N // Is it null? if (null == contact) { @@ -110,13 +110,13 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC this.outputMessage(MessageFormat.format("Anrede, Vorname, Name: {0} {1} {2}", gender, contact.getContactFirstName(), contact.getContactFamilyName())); // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } @Override public void displayOtherDataBox (final Contact contact) { // Trace message - this.getLogger().logTrace(MessageFormat.format("contact={0} - CALLED!", contact)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("contact={0} - CALLED!", contact)); //NOI18N // Is it null? if (null == contact) { @@ -128,13 +128,13 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC this.outputMessage(MessageFormat.format("Telefonnumer: {0}\nFaxnummer: {1}\nHandy: {2}\nKommentar:\n{3}", contact.getContactPhoneNumber(), contact.getContactFaxNumber(), contact.getContactCellphoneNumber(), contact.getContactComment())); // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } @Override public void doChangeOwnAddressData (final Contact contact) { // Trace message - this.getLogger().logTrace(MessageFormat.format("contact={0} - CALLED!", contact)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("contact={0} - CALLED!", contact)); //NOI18N // Is it null? if (null == contact) { @@ -170,13 +170,13 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC contact.setContactCountry(country); // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } @Override public void doChangeOwnNameData (final Contact contact) { // Trace message - this.getLogger().logTrace(MessageFormat.format("contact={0} - CALLED!", contact)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("contact={0} - CALLED!", contact)); //NOI18N // Is it null? if (null == contact) { @@ -208,13 +208,13 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC contact.setContactFamilyName(familyName); // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } @Override public void doChangeOwnOtherData (final Contact contact) { // Trace message - this.getLogger().logTrace(MessageFormat.format("contact={0} - CALLED!", contact)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("contact={0} - CALLED!", contact)); //NOI18N // Is it null? if (null == contact) { @@ -254,13 +254,13 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC contact.setContactComment(comment); // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } @Override public Contact doEnterOwnData () { // Trace message - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N // Get manager and cast it ContactFacade manager = (ContactFacade) this.getFacade(); @@ -278,7 +278,7 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC Contact contact = new UserContact(gender, firstName, familyName); // Trace message - this.getLogger().logTrace(MessageFormat.format("contact={0} - EXIT!", contact)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("contact={0} - EXIT!", contact)); //NOI18N // And return object return contact; @@ -287,20 +287,20 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC @Override public void doShutdown () throws SQLException, IOException { // Trace message - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N // Parent call super.doShutdown(); // TODO Add other shutdown stuff // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } @Override public void doUserMenuChoice () throws UnhandledUserChoiceException, MenuInitializationException { // Trace message - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N // Get all access keys from menu char[] accessKeys = MenuTools.getAccessKeysFromMenuMap(this.getMenus(), this.getCurrentMenu()); @@ -362,13 +362,13 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC } // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } @Override public char enterChar (final char[] validChars, final String message) { // Trace message - this.getLogger().logTrace(MessageFormat.format("validChars={0},message={1} - CALLED!", Arrays.toString(validChars), message)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("validChars={0},message={1} - CALLED!", Arrays.toString(validChars), message)); //NOI18N // The validChars must not null be null and filled with at least one char if (null == validChars) { @@ -394,7 +394,7 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC } // Trace message - this.getLogger().logTrace(MessageFormat.format("input={0} - EXIT!", input)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("input={0} - EXIT!", input)); //NOI18N // Return read char return input; @@ -403,7 +403,7 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC @Override public Gender enterGender (final String message) { // Trace message - this.getLogger().logTrace(MessageFormat.format("message={0} - CALLED!", message)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("message={0} - CALLED!", message)); //NOI18N // Get valid chars char[] validChars = Gender.validChars(); @@ -420,7 +420,7 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC assert (g instanceof Gender) : "g is not set."; //NOI18N // Trace message - this.getLogger().logTrace(MessageFormat.format("g={0} - EXIT!", g)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("g={0} - EXIT!", g)); //NOI18N // Return it return g; @@ -429,7 +429,7 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC @Override public int enterInt (final int minimum, final int maximum, final String message) { // Trace message - this.getLogger().logTrace(MessageFormat.format("minimum={0},maximum={1},message={2} - CALLED!", minimum, maximum, message)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("minimum={0},maximum={1},message={2} - CALLED!", minimum, maximum, message)); //NOI18N // Minimum should not be below zero assert (minimum >= 0) : MessageFormat.format("minimum={0} is below zero", minimum); //NOI18N @@ -447,7 +447,7 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC } // Trace message - this.getLogger().logTrace(MessageFormat.format("input={0} - EXIT!", input)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("input={0} - EXIT!", input)); //NOI18N // Return it return input; @@ -456,7 +456,7 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC @Override public String enterString (final int minLength, final int maxLength, final String message, final boolean allowEmpty) { // Trace message - this.getLogger().logTrace(MessageFormat.format("minLength={0},maxLength={1},message={2}allowEmpty={3} - CALLED!", minLength, maxLength, message, allowEmpty)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("minLength={0},maxLength={1},message={2}allowEmpty={3} - CALLED!", minLength, maxLength, message, allowEmpty)); //NOI18N // Check on length, e.g. country codes are excactly 2 chars long assert (maxLength >= minLength); @@ -474,7 +474,7 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC } // Trace message - this.getLogger().logTrace(MessageFormat.format("input={0} - EXIT!", input)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("input={0} - EXIT!", input)); //NOI18N // Return it return input; @@ -489,7 +489,7 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC @Override public void init () { // Trace message - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N // Init contact manager here try { @@ -503,7 +503,7 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC this.fillMenuMap(); // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } @Override @@ -534,13 +534,13 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC this.outputMessage("Copyright(c) 2015 by Roland Haeder, this is free software"); //NOI18N // Debug message - this.getLogger().logDebug("Intro shown to user"); //NOI18N + this.getLoggerBeanLocal().logDebug("Intro shown to user"); //NOI18N } @Override public void userChooseChangeContactData (final Contact contact) throws UnhandledUserChoiceException { // Trace message - this.getLogger().logTrace(MessageFormat.format("contact={0} CALLED!", contact)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("contact={0} CALLED!", contact)); //NOI18N // Contact must not be null if (null == contact) { @@ -578,7 +578,7 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC } // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } /** @@ -591,7 +591,7 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC String input = this.readString(); // Debug message - this.getLogger().logDebug(MessageFormat.format("input={0}", input)); //NOI18N + this.getLoggerBeanLocal().logDebug(MessageFormat.format("input={0}", input)); //NOI18N // This must be only one character if (input.length() != 1) { @@ -613,7 +613,7 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC String input = this.readString(); // Debug message - this.getLogger().logDebug(MessageFormat.format("input={0}", input)); //NOI18N + this.getLoggerBeanLocal().logDebug(MessageFormat.format("input={0}", input)); //NOI18N // Init number with invalid value int num = -1; @@ -623,11 +623,11 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC num = Integer.parseInt(input); } catch (final NumberFormatException e) { this.outputMessage("Bitte geben Sie nur Zahlen ein!"); - this.getLogger().logWarning(MessageFormat.format("No numbers-only entered. input={0},message={1}", input, e.getMessage())); //NOI18N + this.getLoggerBeanLocal().logWarning(MessageFormat.format("No numbers-only entered. input={0},message={1}", input, e.getMessage())); //NOI18N } // Trace message - this.getLogger().logTrace(MessageFormat.format("num={0} - EXIT!", num)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("num={0} - EXIT!", num)); //NOI18N // Return read number return num; @@ -645,7 +645,7 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC @Override protected void fillMenuMap () { // Trace message - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N // Initialize first (main) menu Menu menu = new ConsoleMenu("main", this); //NOI18N @@ -654,6 +654,6 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC this.getMenus().put("main", menu); //NOI18N // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } } diff --git a/src/org/mxchange/addressbook/client/gui/AddressbookFrame.java b/src/org/mxchange/addressbook/client/gui/AddressbookFrame.java index 9a46532..1d3cefb 100644 --- a/src/org/mxchange/addressbook/client/gui/AddressbookFrame.java +++ b/src/org/mxchange/addressbook/client/gui/AddressbookFrame.java @@ -136,7 +136,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra */ private AddressbookFrame (final Client client) { // Debug line - this.getLogger().logTrace(MessageFormat.format("client={0}: CALLED!", client)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("client={0}: CALLED!", client)); //NOI18N // Set frame instance this.frame = new JFrame(); @@ -146,13 +146,13 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra this.setClient(client); // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } @Override public Contact doEnterOwnData () { // Trace message - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N // Is the "add contact" window visible? if (this.addContact.isVisible()) { @@ -167,7 +167,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra this.addContact.setVisible(true); // Trace message - this.getLogger().logTrace("Returning null : EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("Returning null : EXIT!"); //NOI18N // Return value is not supported return null; @@ -179,13 +179,13 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra @Override public void doShutdown () { // Trace message - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N // First only show shutdown status this.updateStatus("shutdown"); //NOI18N // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } /** @@ -194,7 +194,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra @Override public void enableMainWindow () { // Trace message - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N // Enable it again this.frame.setEnabled(true); @@ -203,7 +203,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra this.frame.requestFocus(); // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } @Override @@ -234,12 +234,12 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra @Override public void setupFrame (final Client client) throws IOException { // Debug line - this.getLogger().logTrace(MessageFormat.format("client={0}: CALLED!", client)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("client={0}: CALLED!", client)); //NOI18N // Has the user entered own data? if (((ContactFacade) this.getClient().getFacade()).isOwnContactAdded()) { // Debug message - this.getLogger().logDebug("Disabling menus: isOwnContactAdded()=false"); //NOI18N + this.getLoggerBeanLocal().logDebug("Disabling menus: isOwnContactAdded()=false"); //NOI18N // Not entered yet, so disable "add" menu this.addOwnItem.setEnabled(false); @@ -255,7 +255,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra this.updateStatus("done"); //NOI18N // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } /** @@ -269,7 +269,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra @Override public void init () throws FrameAlreadyInitializedException { // Debug line - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N // Has this frame been initialized? if (this.isInitialized()) { @@ -284,7 +284,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra this.initialized = true; // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } /** @@ -310,12 +310,12 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra @Override public void shutdownApplication () { // Trace message - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N // To do this, the frame must be initialized if (!this.isInitialized()) { // Not initalized, so bad call - this.getLogger().logFatal("Bad call of shutdownApplication(). Please report this."); //NOI18N + this.getLoggerBeanLocal().logFatal("Bad call of shutdownApplication(). Please report this."); //NOI18N return; } @@ -328,7 +328,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra } // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } /** @@ -340,7 +340,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra */ private void addMenuItem (final JMenu menu, final String key, final ActionListener listener) { // Trace message - this.getLogger().logTrace(MessageFormat.format("menu={0},key={1},listener={2} - CALLED!", menu, key, listener)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("menu={0},key={1},listener={2} - CALLED!", menu, key, listener)); //NOI18N // New instance JMenuItem item = this.initMenuItemWithTooltip(key); @@ -352,7 +352,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra menu.add(item); // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } /** @@ -364,7 +364,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra */ private void addTextFieldWithLabelToPanel (final JPanel panel, final String key, final int fieldLength) { // Trace message - this.getLogger().logTrace(MessageFormat.format("panel={0},key={1},fieldLength={2} - CALLED!", panel, key, fieldLength)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("panel={0},key={1},fieldLength={2} - CALLED!", panel, key, fieldLength)); //NOI18N // Init label for given key JLabel label = new JLabel(this.getBundle().getString(String.format("AddressbookFrame.%s.text", key))); //NOI18N @@ -378,7 +378,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra panel.add(field); // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } /** @@ -420,7 +420,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra */ private void initAddCancelButtons () { // Trace message - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N // Init panel JPanel panel = new JPanel(); @@ -448,7 +448,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra this.addContact.add(panel); // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } /** @@ -456,7 +456,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra */ private void initAddContactDialog () { // Trace message - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N // Instance dialog and set title this.addContact = new JDialog(); @@ -524,7 +524,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra */ this.addContact.setVisible(true); // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } /** @@ -534,7 +534,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra */ private void initAddressDataPanel (final JDialog dialog) { // Trace message - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N // Panel "address" input boxes JPanel addressPanel = new JPanel(); @@ -575,7 +575,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra dialog.add(addressPanel); // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } /** @@ -583,7 +583,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra */ private void initComponents () { // Debug line - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N // Set default close operation this.frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); @@ -632,7 +632,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra this.initOtherDialogs(); // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } /** @@ -644,13 +644,13 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra */ private JMenuItem initMenuItemWithTooltip (final String key) { // Debug line - this.getLogger().logTrace(MessageFormat.format("key={0} - CALLED!", key)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("key={0} - CALLED!", key)); //NOI18N JMenuItem item = new JMenuItem(this.getBundle().getString(String.format("AddressbookFrame.menuItem.%s.text", key))); //NOI18N item.setToolTipText(this.getBundle().getString(String.format("AddressbookFrame.menuItem.%s.toolTipText", key))); //NOI18N // Trace message - this.getLogger().logTrace(MessageFormat.format("item={0} - EXIT!", item)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("item={0} - EXIT!", item)); //NOI18N // Return it return item; @@ -661,7 +661,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra */ private void initMenuSystem () { // Trace message - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N // Init menu bar, menu and item instances JMenuBar menuBar = new JMenuBar(); @@ -758,7 +758,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra this.frame.add(menuBar, BorderLayout.NORTH); // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } /** @@ -768,7 +768,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra */ private void initNameDataPanel (final JDialog dialog) { // Trace message - this.getLogger().logTrace(MessageFormat.format("dialog={0} - CALLED!", dialog)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("dialog={0} - CALLED!", dialog)); //NOI18N // Panel "name" input boxes JPanel namePanel = new JPanel(); @@ -801,7 +801,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra dialog.add(namePanel); // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } /** @@ -812,7 +812,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra */ private void initOtherDataPanel (final JDialog dialog) { // Trace message - this.getLogger().logTrace(MessageFormat.format("dialog={0} - CALLED!", dialog)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("dialog={0} - CALLED!", dialog)); //NOI18N // Panel "other" input boxes JPanel otherPanel = new JPanel(); @@ -846,7 +846,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra dialog.add(otherPanel); // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } /** @@ -854,14 +854,14 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra */ private void initOtherDialogs () { // Trace message - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N // Init other windows: // 1) Add contact this.initAddContactDialog(); // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } /** @@ -869,7 +869,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra */ private void initStatusPanel () { // Trace message - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N // Init status label (which needs to be updated this.statusLabel = new JLabel(); @@ -885,7 +885,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra this.frame.add(panel, BorderLayout.SOUTH); // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } /** @@ -893,7 +893,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra */ private void initTable () { // Trace message - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N // Instance table model this.dataModel = new ContactTableModel(this.getClient().getFacade()); @@ -926,7 +926,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra this.frame.add(scroller, BorderLayout.CENTER); // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } /** @@ -936,13 +936,13 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra */ private void updateStatus (final String type) { // Trace message - this.getLogger().logTrace(MessageFormat.format("type={0} - CALLED!", type)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("type={0} - CALLED!", type)); //NOI18N // Set status message this.statusLabel.setText(this.getBundle().getString(String.format("AddressbookFrame.statusLabel.%s.text", type))); //NOI18N // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } /** diff --git a/src/org/mxchange/addressbook/client/gui/SwingClient.java b/src/org/mxchange/addressbook/client/gui/SwingClient.java index a4b6e41..a5ae991 100644 --- a/src/org/mxchange/addressbook/client/gui/SwingClient.java +++ b/src/org/mxchange/addressbook/client/gui/SwingClient.java @@ -47,7 +47,7 @@ public class SwingClient extends BaseAddressbookClient implements AddressbookCli */ public SwingClient (final Application application) { // Debug message - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N // Set application instance this.setApplication(application); @@ -56,7 +56,7 @@ public class SwingClient extends BaseAddressbookClient implements AddressbookCli this.frame = AddressbookFrame.getSelfInstance(this); // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } @Override @@ -97,7 +97,7 @@ public class SwingClient extends BaseAddressbookClient implements AddressbookCli @Override public Contact doEnterOwnData () { // Trace message - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N // Deligate this call to the frame return this.frame.doEnterOwnData(); @@ -109,7 +109,7 @@ public class SwingClient extends BaseAddressbookClient implements AddressbookCli @Override public void doShutdown () throws SQLException, IOException { // Debug message - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N // Parent call super.doShutdown(); @@ -119,7 +119,7 @@ public class SwingClient extends BaseAddressbookClient implements AddressbookCli // TODO Add other shutdown stuff // Debug message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } @Override @@ -161,7 +161,7 @@ public class SwingClient extends BaseAddressbookClient implements AddressbookCli @Override public SelectableMenuItem getMenuItem (final char accessKey, final String text) { // Debug message - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N // Returns null as the menu is now no longer controlled here. return null; @@ -173,7 +173,7 @@ public class SwingClient extends BaseAddressbookClient implements AddressbookCli @Override public void init () { // Debug message - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N try { // Init contact manager here @@ -190,7 +190,7 @@ public class SwingClient extends BaseAddressbookClient implements AddressbookCli } // Debug message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } @Override @@ -219,7 +219,7 @@ public class SwingClient extends BaseAddressbookClient implements AddressbookCli @Override public void showWelcome () { // Debug message - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N // Not implemented here } diff --git a/src/org/mxchange/addressbook/facade/contact/AddressbookContactFacade.java b/src/org/mxchange/addressbook/facade/contact/AddressbookContactFacade.java index b6635e6..4ca45de 100644 --- a/src/org/mxchange/addressbook/facade/contact/AddressbookContactFacade.java +++ b/src/org/mxchange/addressbook/facade/contact/AddressbookContactFacade.java @@ -62,7 +62,7 @@ public class AddressbookContactFacade extends BaseFacade implements ContactFacad * Logger instance */ @Log - private LoggerBeanLocal logger; + private LoggerBeanLocal loggerBeanLocal; /** * Translated column name list @@ -79,7 +79,7 @@ public class AddressbookContactFacade extends BaseFacade implements ContactFacad */ public AddressbookContactFacade (final Client client) throws SQLException { // Trace message - this.getLogger().logTrace(MessageFormat.format("client={1} - CALLED!", client)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("client={1} - CALLED!", client)); //NOI18N // Make sure all parameters are set correctly if (null == client) { @@ -104,7 +104,7 @@ public class AddressbookContactFacade extends BaseFacade implements ContactFacad @Override public void addContact (final Contact contact) throws ContactAlreadyAddedException { // Trace message - this.getLogger().logTrace(MessageFormat.format("contact={0} - CALLED!", contact)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("contact={0} - CALLED!", contact)); //NOI18N // Contact instance must not be null if (null == contact) { @@ -116,7 +116,7 @@ public class AddressbookContactFacade extends BaseFacade implements ContactFacad this.entityManager.persist(contact); // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } @Override @@ -127,7 +127,7 @@ public class AddressbookContactFacade extends BaseFacade implements ContactFacad @Override public void doChangeAddressData (final Contact contact) { // Trace message - this.getLogger().logTrace(MessageFormat.format("contact={0} CALLED!", contact)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("contact={0} CALLED!", contact)); //NOI18N // Contact must not be null if (null == contact) { @@ -155,13 +155,13 @@ public class AddressbookContactFacade extends BaseFacade implements ContactFacad } // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } @Override public void doChangeNameData (final Contact contact) { // Trace message - this.getLogger().logTrace(MessageFormat.format("contact={0} CALLED!", contact)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("contact={0} CALLED!", contact)); //NOI18N // Contact must not be null if (null == contact) { @@ -185,7 +185,7 @@ public class AddressbookContactFacade extends BaseFacade implements ContactFacad } // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } @Override @@ -196,7 +196,7 @@ public class AddressbookContactFacade extends BaseFacade implements ContactFacad @Override public void doChangeOtherData (final Contact contact) { // Trace message - this.getLogger().logTrace(MessageFormat.format("contact={0} CALLED!", contact)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("contact={0} CALLED!", contact)); //NOI18N // Contact must not be null if (null == contact) { @@ -220,13 +220,13 @@ public class AddressbookContactFacade extends BaseFacade implements ContactFacad } // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } @Override public void doChangeOwnData () { // Trace message - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N /* * First check if the user has registered own contact, before that @@ -256,11 +256,11 @@ public class AddressbookContactFacade extends BaseFacade implements ContactFacad // Ask user what to change client.userChooseChangeContactData(contact); } catch (final UnhandledUserChoiceException ex) { - this.getLogger().logException(ex); + this.getLoggerBeanLocal().logException(ex); } // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } @Override @@ -271,7 +271,7 @@ public class AddressbookContactFacade extends BaseFacade implements ContactFacad @Override public void doEnterOwnData () throws ContactAlreadyAddedException { // Trace message - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N // Is own contact already added? if (this.isOwnContactAdded()) { @@ -292,7 +292,7 @@ public class AddressbookContactFacade extends BaseFacade implements ContactFacad } // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } @Override @@ -308,19 +308,19 @@ public class AddressbookContactFacade extends BaseFacade implements ContactFacad @Override public void doShutdown () throws SQLException, IOException { // Trace message - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N // Shut down the database layer this.entityManager.close(); // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } @Override public DialableCellphoneNumber enterOwnCellNumber () { // Trace message - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N // Get and cast client instance AddressbookClient client = (AddressbookClient) this.getClient(); @@ -331,7 +331,7 @@ public class AddressbookContactFacade extends BaseFacade implements ContactFacad @Override public String enterOwnCity () { // Trace message - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N // Get and cast client instance AddressbookClient client = (AddressbookClient) this.getClient(); @@ -342,7 +342,7 @@ public class AddressbookContactFacade extends BaseFacade implements ContactFacad @Override public String enterOwnComment () { // Trace message - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N // Get and cast client instance AddressbookClient client = (AddressbookClient) this.getClient(); @@ -353,7 +353,7 @@ public class AddressbookContactFacade extends BaseFacade implements ContactFacad @Override public String enterOwnCompanyName () { // Trace message - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N // Get and cast client instance AddressbookClient client = (AddressbookClient) this.getClient(); @@ -364,7 +364,7 @@ public class AddressbookContactFacade extends BaseFacade implements ContactFacad @Override public Country enterOwnCountryCode () { // Trace message - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N // Get and cast client instance AddressbookClient client = (AddressbookClient) this.getClient(); @@ -375,7 +375,7 @@ public class AddressbookContactFacade extends BaseFacade implements ContactFacad @Override public String enterOwnEmailAddress () { // Trace message - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N // Get and cast client instance AddressbookClient client = (AddressbookClient) this.getClient(); @@ -386,7 +386,7 @@ public class AddressbookContactFacade extends BaseFacade implements ContactFacad @Override public String enterOwnFamilyName () { // Trace message - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N // Get and cast client instance AddressbookClient client = (AddressbookClient) this.getClient(); @@ -397,7 +397,7 @@ public class AddressbookContactFacade extends BaseFacade implements ContactFacad @Override public DialableFaxNumber enterOwnFaxNumber () { // Trace message - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N // Get and cast client instance AddressbookClient client = (AddressbookClient) this.getClient(); @@ -408,7 +408,7 @@ public class AddressbookContactFacade extends BaseFacade implements ContactFacad @Override public String enterOwnFirstName () { // Trace message - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N // Get and cast client instance AddressbookClient client = (AddressbookClient) this.getClient(); @@ -419,7 +419,7 @@ public class AddressbookContactFacade extends BaseFacade implements ContactFacad @Override public Gender enterOwnGender () { // Trace message - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N // Get and cast client instance AddressbookClient client = (AddressbookClient) this.getClient(); @@ -430,7 +430,7 @@ public class AddressbookContactFacade extends BaseFacade implements ContactFacad @Override public DialableLandLineNumber enterOwnPhoneNumber () { // Trace message - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N // Get and cast client instance AddressbookClient client = (AddressbookClient) this.getClient(); @@ -441,7 +441,7 @@ public class AddressbookContactFacade extends BaseFacade implements ContactFacad @Override public String enterOwnStreet () { // Trace message - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N // Get and cast client instance AddressbookClient client = (AddressbookClient) this.getClient(); @@ -452,7 +452,7 @@ public class AddressbookContactFacade extends BaseFacade implements ContactFacad @Override public int enterOwnZipCode () { // Trace message - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N // Get and cast client instance AddressbookClient client = (AddressbookClient) this.getClient(); @@ -486,19 +486,19 @@ public class AddressbookContactFacade extends BaseFacade implements ContactFacad @Override public Object getValueFromRowColumn (final int rowIndex, final int columnIndex) { // Trace message - this.getLogger().logTrace(MessageFormat.format("rowIndex={0},columnIndex={1} CALLED!", rowIndex, columnIndex)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("rowIndex={0},columnIndex={1} CALLED!", rowIndex, columnIndex)); //NOI18N // Convert column index -> name String columnName = this.getColumnName(columnIndex); // Debug message - this.getLogger().logDebug(MessageFormat.format("columnName={0}", columnName)); //NOI18N + this.getLoggerBeanLocal().logDebug(MessageFormat.format("columnName={0}", columnName)); //NOI18N // Init value Object value = null; // Trace message - this.getLogger().logTrace(MessageFormat.format("value={0} - EXIT!", value)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("value={0} - EXIT!", value)); //NOI18N // Return it return value; @@ -507,13 +507,13 @@ public class AddressbookContactFacade extends BaseFacade implements ContactFacad @Override public boolean isOwnContactAdded () { // Trace message - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N // Init variable boolean isAdded = false; // Trace message - this.getLogger().logTrace(MessageFormat.format("isAdded={0} : EXIT!", isAdded)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("isAdded={0} : EXIT!", isAdded)); //NOI18N // Return result return isAdded; @@ -522,7 +522,7 @@ public class AddressbookContactFacade extends BaseFacade implements ContactFacad @Override public void registerContact (final Contact contact) { // Trace message - this.getLogger().logTrace(MessageFormat.format("contact={0} CALLED!", contact)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("contact={0} CALLED!", contact)); //NOI18N // Sanity check if (null == contact) { @@ -547,7 +547,7 @@ public class AddressbookContactFacade extends BaseFacade implements ContactFacad } // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } /** @@ -571,7 +571,7 @@ public class AddressbookContactFacade extends BaseFacade implements ContactFacad assert (this.translatedColumnNames instanceof List) : "this.translatedColumnNames is not initialized"; //NOI18N // Debug message - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N // First get an iterator from key set to iterate over Iterator iterator = this.getBundle().keySet().iterator(); @@ -584,7 +584,7 @@ public class AddressbookContactFacade extends BaseFacade implements ContactFacad // Does the key start with AddressbookContactFacade.columnName ? if (key.startsWith("ContactManager.columnName")) { //NOI18N // This is the wanted entry. - this.getLogger().logDebug(MessageFormat.format("key={0}", key)); //NOI18N + this.getLoggerBeanLocal().logDebug(MessageFormat.format("key={0}", key)); //NOI18N // Convert string to array based on delimiter '.' String[] tokens = this.getArrayFromString(key, "."); //NOI18N @@ -596,7 +596,7 @@ public class AddressbookContactFacade extends BaseFacade implements ContactFacad String columnName = tokens[tokens.length - 2]; // Debug message - this.getLogger().logDebug(MessageFormat.format("columnName={0} - adding ...", columnName)); //NOI18N + this.getLoggerBeanLocal().logDebug(MessageFormat.format("columnName={0} - adding ...", columnName)); //NOI18N // So add it this.columnNames.add(columnName); @@ -605,16 +605,16 @@ public class AddressbookContactFacade extends BaseFacade implements ContactFacad } // Debug message - this.getLogger().logTrace(MessageFormat.format("getColumnCount()={0}: EXIT!", this.getColumnCount())); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("getColumnCount()={0}: EXIT!", this.getColumnCount())); //NOI18N } /** - * Getter for logger instance + * Getter for loggerBeanLocal instance *

* @return Logger instance */ - private LoggerBeanLocal getLogger () { - return this.logger; + private LoggerBeanLocal getLoggerBeanLocal () { + return this.loggerBeanLocal; } /** @@ -624,14 +624,14 @@ public class AddressbookContactFacade extends BaseFacade implements ContactFacad */ private Contact getOwnContact () { // Trace message - this.getLogger().logTrace("CALLED!"); //NOI18N + this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N // Deligate this call to database frontend Contact contact = null; //Contact contact = ((AddressbookContactFrontend) this.getFrontend()).getOwnContact(); // Trace message - this.getLogger().logTrace(MessageFormat.format("contact={0} - EXIT!", contact)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("contact={0} - EXIT!", contact)); //NOI18N // Return instance or null return contact; @@ -643,6 +643,6 @@ public class AddressbookContactFacade extends BaseFacade implements ContactFacad * @param exception Throwable */ protected void logException (final Throwable exception) { - this.getLogger().logException(exception); + this.getLoggerBeanLocal().logException(exception); } } diff --git a/src/org/mxchange/addressbook/menu/BaseMenu.java b/src/org/mxchange/addressbook/menu/BaseMenu.java index 1d9dfcc..198652a 100644 --- a/src/org/mxchange/addressbook/menu/BaseMenu.java +++ b/src/org/mxchange/addressbook/menu/BaseMenu.java @@ -56,7 +56,7 @@ public abstract class BaseMenu extends BaseAddressbookSystem implements Menu { @Override public void show (final Client client) { // Trace message - this.getLogger().logTrace(MessageFormat.format("client={0} CALLED!", client)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("client={0} CALLED!", client)); //NOI18N // Client must not be null if (null == client) { @@ -68,7 +68,7 @@ public abstract class BaseMenu extends BaseAddressbookSystem implements Menu { Iterator iterator = this.menuList.iterator(); // Debug message - this.getLogger().logDebug("Showing menu with '" + this.menuList.size() + "' entries."); + this.getLoggerBeanLocal().logDebug("Showing menu with '" + this.menuList.size() + "' entries."); // Output all menus while (iterator.hasNext()) { @@ -80,7 +80,7 @@ public abstract class BaseMenu extends BaseAddressbookSystem implements Menu { } // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } /** @@ -100,12 +100,12 @@ public abstract class BaseMenu extends BaseAddressbookSystem implements Menu { */ protected void initMenu (final String menuType, final Client client) { // Trace message - this.getLogger().logTrace(MessageFormat.format("menuType={0},client={1} - CALLED!", menuType, client)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("menuType={0},client={1} - CALLED!", menuType, client)); //NOI18N // Init menu list this.menuList = new ArrayList<>(5); // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } } diff --git a/src/org/mxchange/addressbook/menu/console/ConsoleMenu.java b/src/org/mxchange/addressbook/menu/console/ConsoleMenu.java index 6c7d8bf..60bf079 100644 --- a/src/org/mxchange/addressbook/menu/console/ConsoleMenu.java +++ b/src/org/mxchange/addressbook/menu/console/ConsoleMenu.java @@ -37,7 +37,7 @@ public class ConsoleMenu extends BaseMenu implements Menu { */ public ConsoleMenu (final String menuType, final Client client) { // Trace message - this.getLogger().logTrace(MessageFormat.format("menuType={0},client={1} - CALLED!", menuType, client)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("menuType={0},client={1} - CALLED!", menuType, client)); //NOI18N // Client must not be null if (null == client) { diff --git a/src/org/mxchange/addressbook/menu/item/console/ConsoleMenuItem.java b/src/org/mxchange/addressbook/menu/item/console/ConsoleMenuItem.java index 339623d..fc91c7f 100644 --- a/src/org/mxchange/addressbook/menu/item/console/ConsoleMenuItem.java +++ b/src/org/mxchange/addressbook/menu/item/console/ConsoleMenuItem.java @@ -81,7 +81,7 @@ public class ConsoleMenuItem extends BaseMenuItem implements SelectableMenuItem @Override public void show (final Client client) { // Trace message - this.getLogger().logTrace(MessageFormat.format("client={0} - CALLED!", client)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("client={0} - CALLED!", client)); //NOI18N // Client must not be null if (null == client) { @@ -99,7 +99,7 @@ public class ConsoleMenuItem extends BaseMenuItem implements SelectableMenuItem c.showEntry(this); // Trace message - this.getLogger().logTrace("EXIT!"); //NOI18N + this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N } }