Examples of IServerWorkingCopy


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

            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)) {
                modules.add(module);
            }
        }
        for (IProject project : projects.getContentProjects()) {
            IModule module = ServerUtil.getModule(project);
            if (module != null && shouldDeploy(module)) {
                modules.add(module);
            }
        }
        wc.modifyModules(modules.toArray(new IModule[modules.size()]), new IModule[0], monitor);
        wc.save(true, monitor);

        advance(monitor, 2);

        monitor.done();
    }
View Full Code Here

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

    @Override
    public void setBundleVersion(String bundleSymbolicName, Version version, IProgressMonitor monitor) {

        String stringVersion = version != null ? version.toString() : null;

        IServerWorkingCopy wc = getServer().createWorkingCopy();
        wc.setAttribute(String.format(PROP_BUNDLE_VERSION_FORMAT, bundleSymbolicName), stringVersion);
        try {
            wc.save(false, monitor);
        } catch (CoreException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

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

    public int getDebugPort() {
        return workingCopy().getAttribute(ISlingLaunchpadServer.PROP_DEBUG_PORT, 30303);
    }
   
    private IServerWorkingCopy workingCopy() {
        IServerWorkingCopy workingCopy = server.getServerWorkingCopy();
        server.getServer().createWorkingCopy();
        if (workingCopy == null)
            workingCopy = server.getServer().createWorkingCopy();
        return workingCopy;
    }
View Full Code Here

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

    @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

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

        if (serverType == null) {
            throw new IllegalArgumentException("No server type of type 'org.apache.sling.ide.launchpadServer' found");
        }

        IServerWorkingCopy wc = serverType.createServer("temp.sling.launchpad.server.id", null,
                new NullProgressMonitor());
        wc.setHost(config.getHostname());
        wc.setAttribute(ISlingLaunchpadServer.PROP_PORT, config.getPort());
        wc.setAttribute(ISlingLaunchpadServer.PROP_CONTEXT_PATH, config.getContextPath());
        wc.setAttribute(ISlingLaunchpadServer.PROP_USERNAME, config.getUsername());
        wc.setAttribute(ISlingLaunchpadServer.PROP_PASSWORD, config.getPassword());
        wc.setAttribute("auto-publish-time", 0);

        server = wc.save(true, new NullProgressMonitor());
    }
View Full Code Here

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

    IRuntime runtime = runtimeCopy.save(true, mon);

    IServerType serverType = ServerCore
        .findServerType("org.eclipse.wst.server.preview.server"); //$NON-NLS-1$

    IServerWorkingCopy workingCopy = serverType.createServer(
        httpServerName, null, runtime, mon);
    workingCopy.setName(httpServerName);
    workingCopy.setHost("localhost"); //$NON-NLS-1$

    return workingCopy.save(true, mon);
  }
View Full Code Here

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

  public void performFinish(IProgressMonitor monitor) throws CoreException {
    super.performFinish(monitor);
  }

  private OpenEJBServer getServer() {
    IServerWorkingCopy wc = (IServerWorkingCopy) getTaskModel().getObject(TaskModel.TASK_SERVER);
    if (wc == null) {
    }
   
    OpenEJBServer server = (OpenEJBServer) wc.loadAdapter(OpenEJBServer.class, new NullProgressMonitor());
    return server;
  }
View Full Code Here

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

      public void runtimeFound(IRuntimeWorkingCopy runtime) {
        String runtimeTypeId = runtime.getRuntimeType().getId();
        String serverTypeId = runtimeTypeId.substring(0, runtimeTypeId.length() - 8);
        IServerType serverType = ServerCore.findServerType(serverTypeId);
        try {
          IServerWorkingCopy server = serverType.createServer(serverTypeId, null, runtime, monitor);
          listener.serverFound(server);
        } catch (Exception e) {
          Activator.getLogger().error(e);
        }
      }
View Full Code Here

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

 
  /**
   * updates the model from runtime.
   */
  private void populateModel() {
    IServerWorkingCopy workingCopy = getServerWorkingCopy();
    if (model != null && workingCopy != null) {
      // workCopy will be instance of ServerDelegate classs.
      // We need to get the params, so IFuseESBRuntime will be enough.
      IKarafServerDelegate karafServerWorkingCopy = (IKarafServerDelegate) workingCopy.loadAdapter(IKarafServerDelegate.class, new NullProgressMonitor());
      if (karafServerWorkingCopy != null) {
        model.setUserName(karafServerWorkingCopy.getUserName());
        model.setPassword(karafServerWorkingCopy.getPassword());
      }
      boolean readFromConfFile = false;
View Full Code Here

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

  /**
   * This updates the runtime.
   */
  private void updateServer() {
    IServerWorkingCopy workingCopy = getServerWorkingCopy();
    if (workingCopy != null) {
      // workCopy will be instance of ServerDelegate classs.
      // We need to get the params, so IFuseESBRuntime will be enough.
      IKarafServerDelegateWorkingCopy karafServerWorkingCopy = (IKarafServerDelegateWorkingCopy) workingCopy
          .loadAdapter(IKarafServerDelegateWorkingCopy.class,
              new NullProgressMonitor());
      if (karafServerWorkingCopy != null) {
        karafServerWorkingCopy.setPortNumber(model.getPortNumber());
        karafServerWorkingCopy.setUserName(model.getUserName());
        karafServerWorkingCopy.setPassword(model.getPassword());
        workingCopy.setRuntime(getRuntimeWorkingCopy());
        try {
          workingCopy.save(true, new NullProgressMonitor());
        } catch (CoreException ex) {
          Activator.getLogger().error(ex);
        }
      }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.