Java Code Examples for org.eclipse.wst.server.core.ServerCore#findServer()

The following examples show how to use org.eclipse.wst.server.core.ServerCore#findServer() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WebContainerUtils.java    From developer-studio with Apache License 2.0 6 votes vote down vote up
public static String getDeployedWSDLURL(IProject serverProject, 
										String ServerFactoryId, 
										String ServerInstanceId,
										String serviceName){ 
	// Note that ServerCore.findServer() might return null if the server cannot be found and
	// ServerUtils.getEncodedWebComponentURL() can handle null server properly (by using ServerFactoryId)
	String deployedWSDLURLpath = null;
	IServer server = null;
	if (ServerInstanceId != null) {
		server = ServerCore.findServer(ServerInstanceId);
	}
	deployedWSDLURLpath = ServerUtils.getEncodedWebComponentURL(serverProject, 
			ServerFactoryId, server);
	if (deployedWSDLURLpath == null) {
		deployedWSDLURLpath = Constants.LOCAL_SERVER_PORT;
	}
	String[] deployedWSDLURLParts = {Constants.SERVICES,serviceName};
	return FileUtils.addNodesToURL(deployedWSDLURLpath, deployedWSDLURLParts)+"?wsdl";
}
 
Example 2
Source File: BOSWebServerManager.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
protected IServer configureServer(final IRuntime runtime, final IServerType sType, final IFile file,
        final IFolder configurationFolder,
        final IProgressMonitor monitor)
        throws CoreException {
    final IServer server = ServerCore.findServer(BONITA_TOMCAT_SERVER_ID);
    IServerWorkingCopy serverWC = null;
    if (server != null) {
        serverWC = server.createWorkingCopy();
    }
    if (serverWC == null) {
        serverWC = sType.createServer(BONITA_TOMCAT_SERVER_ID, file, runtime, monitor);
    }
    serverWC.setServerConfiguration(configurationFolder);
    serverWC.setAttribute(ITomcatServer.PROPERTY_INSTANCE_DIR,
            tomcatInstanceLocation);
    serverWC.setAttribute(ITomcatServer.PROPERTY_DEPLOY_DIR,
            tomcatInstanceLocation + File.separatorChar + "webapps");
    serverWC.setAttribute(START_TIMEOUT, 300);
    return serverWC.save(true, monitor);
}