Package org.eclipse.wst.server.core

Examples of org.eclipse.wst.server.core.IServer


            // if there's no module for a project then there's no IServer for sure - which
            // is what we need to create a RepositoryInfo
            return null;
        }
        Set<IServer> result = new HashSet<IServer>();
        IServer defaultServer = ServerCore.getDefaultServer(module);
        if (defaultServer!=null) {
            result.add(defaultServer);
        }
       
        IServer[] allServers = ServerCore.getServers();
        for (int i = 0; i < allServers.length; i++) {
            IServer aServer = allServers[i];
            IModule[] allModules = aServer.getModules();
            for (int j = 0; j < allModules.length; j++) {
                IModule aMoudle = allModules[j];
                if (aMoudle.equals(module)) {
                    result.add(aServer);
                    break;
View Full Code Here


        if (servers!=null) {
            if (monitorOrNull==null) {
                monitorOrNull = new NullProgressMonitor();
            }
            for (Iterator it = servers.iterator(); it.hasNext();) {
                IServer aServer = (IServer) it.next();
                if (aServer!=null) {
                    int autoPublishSetting = aServer.getAttribute(PROP_AUTO_PUBLISH_SETTING, AUTO_PUBLISH_RESOURCE);
                    int autoPublishTime = aServer.getAttribute(PROP_AUTO_PUBLISH_TIME, 15);
                    if (autoPublishSetting==AUTO_PUBLISH_RESOURCE) {
                        //TODO: ignoring the autoPublishTime - SLING-3587
                        aServer.publish(IServer.PUBLISH_INCREMENTAL, monitorOrNull);
                    }
                }
            }
        }
    }
View Full Code Here

    protected abstract Projects configureCreatedProjects(List<IProject> createdProjects, IProgressMonitor monitor)
            throws CoreException;

    protected void deployProjectsOnServer(Projects projects, IProgressMonitor monitor) throws CoreException {

        IServer server = setupServerWizardPage.getOrCreateServer(monitor);
        if (server == null) {
            monitor.done();
            return;
        }
        advance(monitor, 1);

        IServerWorkingCopy wc = server.createWorkingCopy();
        // add the bundle and content projects, ie modules, to the server
        List<IModule> modules = new LinkedList<IModule>();
        for (IProject project : projects.getBundleProjects()) {
            IModule module = ServerUtil.getModule(project);
            if (module != null && shouldDeploy(module)) {
View Full Code Here

        // by default, deploy all applicable modules - subclasses may decide otherwise
        return true;
    }

    protected void publishModules(final List<IProject> createdProjects, IProgressMonitor monitor) throws CoreException {
        IServer server = setupServerWizardPage.getOrCreateServer(monitor);
        if (server == null) {
            return;
        }
        if (setupServerWizardPage.getStartServer()) {
            server.start(ILaunchManager.RUN_MODE, monitor);
        }
        List<IModule[]> modules = new ArrayList<IModule[]>();
        for (IProject project : createdProjects) {
            IModule module = ServerUtil.getModule(project);
            if (module != null) {
                modules.add(new IModule[] { module });
            }
        }

        if (modules.size() > 0) {
            server.publish(IServer.PUBLISH_CLEAN, modules, null, null);
        }
    }
View Full Code Here

        if (!mainPage.isPageComplete()) {
            return false;
        }

        final IServer server = mainPage.getServer();

        IResource resource = mainPage.getResource();
        final IProject project = resource.getProject();
        final IPath projectRelativePath = resource.getProjectRelativePath();
View Full Code Here

    @Override
    public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor)
            throws CoreException {

        IServer server = ServerUtil.getServer(configuration);
        if (server == null) {
            throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "No server found for configuration "
                    + configuration));
        }

        SlingLaunchpadBehaviour launchpad = (SlingLaunchpadBehaviour) server.loadAdapter(SlingLaunchpadBehaviour.class,
                monitor);

        launchpad.setupLaunch(launch, mode, monitor);
        launchpad.start(monitor);
    }
View Full Code Here

    }

    @Override
    public void performFinish(IProgressMonitor monitor) throws CoreException {

        IServer server = (IServer) getTaskModel().getObject(TaskModel.TASK_SERVER);
        if (server instanceof IServerWorkingCopy) {
            IServerWorkingCopy wc = (IServerWorkingCopy) server;
            wc.setAttribute("auto-publish-time", 0);
            wc.save(true, monitor);
        }
View Full Code Here

  }

  private void addServerListeners() {
    IServer[] servers = ServerCore.getServers();
    for (int i = 0; i < servers.length; i++) {
      IServer candidate = servers[i];
      if (CloudFoundryRsePlugin.doesServerBelongToHost(candidate, getHost())) {
        candidate.addServerListener(this);
      }
    }
  }
View Full Code Here

  public IHostFile[] getRoots(IProgressMonitor monitor) throws SystemMessageException {
    List<AccountResource> list = new ArrayList<AccountResource>();
    IServer[] allServers = ServerCore.getServers();
    for (int i = 0; i < allServers.length; i++) {
      IServer candidate = allServers[i];
      if (CloudFoundryRsePlugin.doesServerBelongToHost(candidate, host)) {
        CloudFoundryServer server = (CloudFoundryServer) candidate.loadAdapter(CloudFoundryServer.class,
            monitor);
        AccountResource resource = new AccountResource(server);
        list.add(resource);
      }
    }
View Full Code Here

    IModuleArtifact[] artifacts = ServerPlugin.getModuleArtifacts(project);
    Assert.assertNotNull(artifacts);
    Assert.assertEquals(1, artifacts.length);
    IModule module = artifacts[0].getModule();

    IServer httpServer = getHelper().getHTTPServer();
    Assert.assertNotNull(httpServer);

    httpServer.stop(true);

    ServerCore.setDefaultServer(module, httpServer,
        new NullProgressMonitor());
  }
View Full Code Here

TOP

Related Classes of org.eclipse.wst.server.core.IServer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.