public void waitModuleStarted(IServer server, IModule[] module, IProgressMonitor monitor) { if (module.length == 0 || module[0] == null) return; try { String deploymentName = getDeploymentName(server, module[0]); boolean waitedOnce = false; while (!monitor.isCanceled()) { boolean done = isRootModuleStarted(server, module[0], deploymentName, monitor); if (done) { return; } if (!waitedOnce) { String info = "Module {0} on {1} not yet fully deployed. Waiting..."; // $NON-NLS-1$ IStatus s = new Status( IStatus.INFO, JBossServerCorePlugin.PLUGIN_ID, NLS.bind(info, module[0].getName(), server.getName()), null); ServerLogger.getDefault().log(server, s); } waitedOnce = true; try { Thread.sleep(2000); } catch (InterruptedException ie) { // Ignore, intentional } } String warning = "Module {0} on {1} still not ready to be shown in browser. Aborting delay."; //$NON-NLS-1$ IStatus s = new Status( IStatus.WARNING, JBossServerCorePlugin.PLUGIN_ID, NLS.bind(warning, module[0].getName(), server.getName()), null); ServerLogger.getDefault().log(server, s); } catch (Exception e) { String er = "Error occurred while waiting for {0} to start on server {1}"; // $NON-NLS-1$ IStatus s = new Status( IStatus.WARNING, JBossServerCorePlugin.PLUGIN_ID, NLS.bind(er, module[0].getName(), server.getName()), e); ServerLogger.getDefault().log(server, s); } }
public int getModuleState(IServer server, IModule[] module, IProgressMonitor monitor) { try { return getRootModuleState(server, module[0], getDeploymentName(server, module[0]), monitor); } catch (Exception e) { String er = "Error occurred while checking module state for {0} on server {1}"; // $NON-NLS-1$ IStatus s = new Status( IStatus.WARNING, JBossServerCorePlugin.PLUGIN_ID, NLS.bind(er, module[0].getName(), server.getName()), e); ServerLogger.getDefault().log(server, s); return IServer.STATE_UNKNOWN; } }
protected void logStatus(IServer server, IStatus stat) { ServerLogger.getDefault().log(server, stat); }