| | |
| | | |
| | | import java.io.File; |
| | | import java.io.PrintStream; |
| | | import java.util.logging.Level; |
| | | import java.util.logging.Logger; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | |
| | | import javax.swing.SwingUtilities; |
| | | |
| | | import org.opends.guitools.controlpanel.util.ControlPanelLog; |
| | | import org.opends.messages.AdminToolMessages; |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.opends.quicksetup.ui.UIFactory; |
| | | import org.opends.quicksetup.util.Utils; |
| | | import org.opends.server.types.InitializationException; |
| | |
| | | /** Suffix for log files. */ |
| | | static public final String LOG_FILE_SUFFIX = ".log"; |
| | | |
| | | static private final Logger LOG = |
| | | Logger.getLogger(ControlPanelLauncher.class.getName()); |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | /** |
| | | * Main method invoked by the control-panel script. |
| | |
| | | } |
| | | catch (Throwable t) |
| | | { |
| | | LOG.log(Level.WARNING, "Error setting look and feel: "+t, t); |
| | | logger.warn(LocalizableMessage.raw("Error setting look and feel: "+t, t)); |
| | | } |
| | | |
| | | ControlPanelSplashScreen.main(args); |
| | |
| | | { |
| | | if (ControlPanelLog.isInitialized()) |
| | | { |
| | | LOG.log(Level.WARNING, "Error launching GUI: "+t); |
| | | logger.warn(LocalizableMessage.raw("Error launching GUI: "+t)); |
| | | StringBuilder buf = new StringBuilder(); |
| | | while (t != null) |
| | | { |
| | |
| | | buf.append("Root cause:\n"); |
| | | } |
| | | } |
| | | LOG.log(Level.WARNING, buf.toString()); |
| | | logger.warn(LocalizableMessage.raw(buf.toString())); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | private static ControlPanel controlPanel; |
| | | |
| | | private static final Logger LOG = |
| | | Logger.getLogger(ControlPanelLauncher.class.getName()); |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | /** |
| | | * The main method for this class. |
| | |
| | | { |
| | | if (ControlPanelLog.isInitialized()) |
| | | { |
| | | LOG.log(Level.SEVERE, "Error launching GUI: "+t, t); |
| | | logger.error(LocalizableMessage.raw("Error launching GUI: "+t, t)); |
| | | } |
| | | InternalError error = |
| | | new InternalError("Failed to invoke initialize method"); |
| | |
| | | { |
| | | try |
| | | { |
| | | LOG.log(Level.INFO, "going to call createAndDisplayGUI."); |
| | | logger.debug(LocalizableMessage.raw("going to call createAndDisplayGUI.")); |
| | | controlPanel.createAndDisplayGUI(); |
| | | LOG.log(Level.INFO, "called createAndDisplayGUI."); |
| | | logger.debug(LocalizableMessage.raw("called createAndDisplayGUI.")); |
| | | } catch (Throwable t) |
| | | { |
| | | LOG.log(Level.SEVERE, "Error displaying GUI: "+t, t); |
| | | logger.error(LocalizableMessage.raw("Error displaying GUI: "+t, t)); |
| | | InternalError error = |
| | | new InternalError("Failed to invoke display method"); |
| | | error.initCause(t); |
| | |
| | | } |
| | | catch (Throwable t) |
| | | { |
| | | LOG.log(Level.SEVERE, "Error calling SwingUtilities.invokeAndWait: "+t, |
| | | t); |
| | | logger.error(LocalizableMessage.raw("Error calling SwingUtilities.invokeAndWait: "+t, |
| | | t)); |
| | | InternalError error = |
| | | new InternalError( |
| | | "Failed to invoke SwingUtilities.invokeAndWait method"); |