public void serverChanged(ServerEvent event) { IServer s = event.getServer(); JBossExtendedProperties props = (JBossExtendedProperties) s.loadAdapter(JBossExtendedProperties.class, null); if (props != null && props.getMultipleDeployFolderSupport() == ServerExtendedProperties.DEPLOYMENT_SCANNER_AS7_MANAGEMENT_SUPPORT) { if (serverSwitchesToState(event, IServer.STATE_STARTED)) { // Don't do any potentially long-running tasks here. launchJob(s); } } }
@Override public void doSave(IProgressMonitor monitor) { if (standardOptions != null) standardOptions.updateListeners(); if (perModuleOptions != null) perModuleOptions.updateListeners(); IServer s = getServer(); if (s.getServerState() == IServer.STATE_STARTED) { JBossExtendedProperties properties = (JBossExtendedProperties) s.loadAdapter(JBossExtendedProperties.class, null); if (properties != null) { IDeploymentScannerModifier modifier = properties.getDeploymentScannerModifier(); if (modifier != null) { Job scannerJob = modifier.getUpdateDeploymentScannerJob(s); if (scannerJob != null) scannerJob.schedule(); } } } }
protected void validateServerStructure(IServer server) throws CoreException { IControllableServerBehavior jbsBehavior = JBossServerBehaviorUtils.getControllableBehavior(server); Trace.trace(Trace.STRING_FINEST, "Verifying server structure"); // $NON-NLS-1$ JBossExtendedProperties props = ExtendedServerPropertiesAdapterFactory.getJBossExtendedProperties(server); IStatus status = props.verifyServerStructure(); if (!status.isOK()) { ((ControllableServerBehavior) jbsBehavior).setServerStopped(); throw new CoreException(status); } Trace.trace( Trace.STRING_FINEST, "Verifying jdk is available if server requires jdk"); // $NON-NLS-1$ boolean requiresJDK = props.requiresJDK(); if (requiresJDK) { IRuntime rt = server.getRuntime(); IJBossServerRuntime rt2 = RuntimeUtils.getJBossServerRuntime(rt); IVMInstall vm = rt2.getVM(); if (!JavaUtils.isJDK(vm)) { // JBIDE-14568 do not BLOCK launch, but log error Trace.trace( Trace.STRING_FINEST, "The VM to launch server '" + //$NON-NLS-1$ server.getName() + "' does not appear to be a JDK: " + vm.getInstallLocation().getAbsolutePath()); // $NON-NLS-1$ IStatus stat = new Status( IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, NLS.bind( Messages.launch_requiresJDK, server.getName(), vm.getInstallLocation().getAbsolutePath())); logStatus(server, stat); } } }