}
public void startDerbyServer( IProject proj) throws CoreException {
String args = CommonNames.START_DERBY_SERVER;
String vmargs="";
DerbyProperties dprop=new DerbyProperties(proj);
//Starts the server as a Java app
args+=" -h "+dprop.getHost()+ " -p "+dprop.getPort();
//Set Derby System Home from the Derby Properties
if((dprop.getSystemHome()!=null)&& !(dprop.getSystemHome().equals(""))){
vmargs=CommonNames.D_SYSTEM_HOME+dprop.getSystemHome();
}
String procName="["+proj.getName()+"] - "+CommonNames.DERBY_SERVER+" "+CommonNames.START_DERBY_SERVER+" ("+dprop.getHost()+ ", "+dprop.getPort()+")";
ILaunch launch = DerbyUtils.launch(proj, procName ,
CommonNames.DERBY_SERVER_CLASS, args, vmargs, CommonNames.START_DERBY_SERVER);
IProcess ip=launch.getProcesses()[0];
//set a name to be seen in the Console list
ip.setAttribute(IProcess.ATTR_PROCESS_LABEL,procName);
// saves the mapping between (server) process and project
//servers.put(launch.getProcesses()[0], proj);
servers.put(ip, proj);
// register a listener to listen, when this process is finished
DebugPlugin.getDefault().addDebugEventListener(listener);
//Add resource listener
IWorkspace workspace = ResourcesPlugin.getWorkspace();
workspace.addResourceChangeListener(rlistener);
setRunning(proj, Boolean.TRUE);
Shell shell = new Shell();
MessageDialog.openInformation(
shell,
CommonNames.PLUGIN_NAME,
Messages.D_NS_ATTEMPT_STARTED+dprop.getPort()+".");
}