blob: c7b81fb2cea567233080736884f671f01614dc8e [file] [log] [blame]
/**********************************************************************
* Copyright (c) 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - Initial API and implementation
**********************************************************************/
package org.eclipse.wst.server.ui.internal;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.ServerCore;
/**
* Job to initialize server UI.
*/
public class InitializeJob extends Job {
/**
* Create the job.
*/
public InitializeJob() {
super(Messages.jobInitializing);
setPriority(Job.SHORT);
}
/**
* @see org.eclipse.core.runtime.jobs.Job#run(IProgressMonitor)
*/
protected IStatus run(IProgressMonitor monitor) {
IServer[] servers = ServerCore.getServers();
if (servers != null) {
int size = servers.length;
for (int i = 0; i < size; i++) {
servers[i].addServerListener(ServerUIPlugin.serverListener);
servers[i].addPublishListener(ServerUIPlugin.publishListener);
}
}
return Status.OK_STATUS;
}
}