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

The following examples show how to use org.eclipse.wst.server.core.IServer. 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: LocalAppEngineConsole.java    From google-cloud-eclipse with Apache License 2.0 8 votes vote down vote up
/**
 * Update the shown name with the server stop/stopping state.
 */
private void updateName(int serverState) {
  final String computedName;
  if (serverState == IServer.STATE_STARTING) {
    computedName = Messages.getString("SERVER_STARTING_TEMPLATE", unprefixedName);
  } else if (serverState == IServer.STATE_STOPPING) {
    computedName = Messages.getString("SERVER_STOPPING_TEMPLATE", unprefixedName);
  } else if (serverState == IServer.STATE_STOPPED) {
    computedName = Messages.getString("SERVER_STOPPED_TEMPLATE", unprefixedName);
  } else {
    computedName = unprefixedName;
  }
  UIJob nameUpdateJob = new UIJob("Update server name") {
    @Override
    public IStatus runInUIThread(IProgressMonitor monitor) {
      LocalAppEngineConsole.this.setName(computedName);
      return Status.OK_STATUS;
    }
  };
  nameUpdateJob.setSystem(true);
  nameUpdateJob.schedule();
}
 
Example #2
Source File: LocalAppEnginePublishTaskDelegate.java    From google-cloud-eclipse with Apache License 2.0 6 votes vote down vote up
@Override
@SuppressWarnings("rawtypes")
public PublishOperation[] getTasks(IServer server, int kind, List/* <IModule[]> */ modules,
    List/* <Integer> */ kindList) {
  if (modules == null || modules.isEmpty()) {
    return null;
  }

  LocalAppEngineServerBehaviour gaeServer =
      (LocalAppEngineServerBehaviour) server.loadAdapter(LocalAppEngineServerBehaviour.class, null);

  List<PublishOperation> tasks = Lists.newArrayList();
  for (int i = 0; i < modules.size(); i++) {
    IModule[] module = (IModule[]) modules.get(i);
    tasks.add(new LocalAppEnginePublishOperation(gaeServer, kind, module, (Integer) kindList.get(i)));
  }

  return tasks.toArray(new PublishOperation[tasks.size()]);
}
 
Example #3
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 #4
Source File: GwtFacetUtils.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Get the modules added in the server.
 * 
 * @return
 */
public static IModule[] getModules(IServer server) {
  // Multi-module project
  IModule[] modules = server.getChildModules(server.getModules(), new NullProgressMonitor());
  if (modules == null || modules.length == 0) { // does it have multi-modules?
    // So it doesn't have multi-modules, lets use the root as the module.
    modules = server.getModules();
  }

  // Just in case
  if (modules == null || modules.length == 0) {
    GwtWtpPlugin.logMessage(
        "Could not find GWT Faceted project from the Server runtime. Add a GWT Facet to the server modules.");
    return null;
  }

  return modules;
}
 
Example #5
Source File: BOSWebServerManager.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
protected void createLaunchConfiguration(final IServer server, final IProgressMonitor monitor)
        throws CoreException {
    ILaunchConfiguration conf = server.getLaunchConfiguration(false, Repository.NULL_PROGRESS_MONITOR);
    if (conf == null) {
        conf = server.getLaunchConfiguration(true,
                Repository.NULL_PROGRESS_MONITOR);
    }
    ILaunchConfigurationWorkingCopy workingCopy = conf.getWorkingCopy();
    final String args = workingCopy.getAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, "");
    if (!args.contains(tomcatInstanceLocation)) {
        conf = server.getLaunchConfiguration(true,
                Repository.NULL_PROGRESS_MONITOR);
        workingCopy = conf.getWorkingCopy();
    }
    configureLaunchConfiguration(workingCopy);
}
 
Example #6
Source File: BOSWebServerManager.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
protected IServer createServer(final IProgressMonitor monitor, final IProject confProject, final IRuntime runtime)
        throws CoreException {
    final IServerType sType = ServerCore.findServerType(TOMCAT_SERVER_TYPE);
    final IFile file = confProject.getFile("bonitaTomcatServerSerialization");

    final IFolder configurationFolder = confProject
            .getFolder("tomcat_conf");
    final File sourceFolder = new File(tomcatInstanceLocation, "conf");
    PlatformUtil.copyResource(configurationFolder.getLocation().toFile(),
            sourceFolder, Repository.NULL_PROGRESS_MONITOR);
    configurationFolder.refreshLocal(IResource.DEPTH_INFINITE,
            Repository.NULL_PROGRESS_MONITOR);
    final IServer server = configureServer(runtime, sType, file,
            configurationFolder, monitor);
    portConfigurator = newPortConfigurator(server);
    portConfigurator.configureServerPort(Repository.NULL_PROGRESS_MONITOR);
    return server;
}
 
Example #7
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);
}
 
Example #8
Source File: LaunchHelperTest.java    From google-cloud-eclipse with Apache License 2.0 6 votes vote down vote up
@Before
public void setUp() {
  handler = new LaunchHelper() {
    @Override
    protected void launch(IServer server, String launchMode, SubMonitor progress)
        throws CoreException {
      // do nothing
    }

    @Override
    Collection<IServer> findExistingServers(IModule[] modules, boolean exact,
        SubMonitor progress) {
      if (serverToReturn != null) {
        return Collections.singleton(serverToReturn);
      }
      return super.findExistingServers(modules, exact, progress);
    }
  };
}
 
Example #9
Source File: LocalAppEngineServerBehaviour.java    From google-cloud-eclipse with Apache License 2.0 6 votes vote down vote up
@Override
public void stop(boolean force) {
  int serverState = getServer().getServerState();
  if (serverState == IServer.STATE_STOPPED) {
    return;
  }
  // If the server seems to be running, and we haven't already tried to stop it,
  // then try to shut it down nicely
  if (devServer != null && (!force || serverState != IServer.STATE_STOPPING)) {
    setServerState(IServer.STATE_STOPPING);
    StopConfiguration.Builder builder = StopConfiguration.builder();
    builder.port(serverPort);
    try {
      devServer.stop(builder.build());
    } catch (AppEngineException ex) {
      logger.log(Level.WARNING, "Error terminating server: " + ex.getMessage(), ex); //$NON-NLS-1$
      terminate();
    }
  } else {
    // we've already given it a chance
    terminate();
  }
}
 
Example #10
Source File: GwtWtpPlugin.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 6 votes vote down vote up
private String getServerUrl(IServer server, IModule rootMod) {
  if (server == null || rootMod == null) {
    return null;
  }
  
  IURLProvider urlProvider = (IURLProvider) server.loadAdapter(IURLProvider.class, null);
  if (urlProvider == null) {
    return null;
  }
  
  URL url = urlProvider.getModuleRootURL(rootMod);
  if (url == null) {
    return null;
  }
  return url.toString();
}
 
Example #11
Source File: GwtWtpPlugin.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 6 votes vote down vote up
private void addServerUrlsToDevModeView(ILaunch launch) {
  IServer server = getServerFromLaunchConfig(launch);
  if (server == null) {
    logMessage("posiblyLaunchGwtSuperDevModeCodeServer: No WTP server found.");
    return;
  }

  IModule[] modules = server.getModules();
  if (modules == null || modules.length == 0) {
    return;
  }

  IModule rootMod = modules[0];
  if (rootMod == null) {
    return;
  }

  // First clear the previous urls, before adding new ones
  launchUrls.clear();

  String url = getServerUrl(server, rootMod);
  if (url != null) {
    launchUrls.add(url);
  }
}
 
Example #12
Source File: LocalAppEngineServerBehaviour.java    From google-cloud-eclipse with Apache License 2.0 6 votes vote down vote up
/**
 * Starts the development server.
 *
 * @param mode the launch mode (see ILaunchManager.*_MODE constants)
 */
void startDevServer(String mode, RunConfiguration devServerRunConfiguration,
    Path javaHomePath, MessageConsoleStream outputStream, MessageConsoleStream errorStream)
    throws CoreException, CloudSdkNotFoundException {

  BiPredicate<InetAddress, Integer> portInUse = (addr, port) -> {
    Preconditions.checkArgument(port >= 0, "invalid port");
    return SocketUtil.isPortInUse(addr, port);
  };

  checkPorts(devServerRunConfiguration, portInUse);

  setServerState(IServer.STATE_STARTING);
  setMode(mode);

  // Create dev app server instance
  initializeDevServer(outputStream, errorStream, javaHomePath);

  // Run server
  try {
    devServer.run(devServerRunConfiguration);
  } catch (AppEngineException ex) {
    Activator.logError("Error starting server: " + ex.getMessage()); //$NON-NLS-1$
    stop(true);
  }
}
 
Example #13
Source File: LocalAppEngineConsolePageParticipant.java    From google-cloud-eclipse with Apache License 2.0 6 votes vote down vote up
private void configureToolBar(IToolBarManager toolbarManager) {
  terminateAction = new Action(Messages.actionStop) {
    @Override
    public void run() {
      //code to execute when button is pressed
      LocalAppEngineServerBehaviour serverBehaviour = console.getServerBehaviourDelegate();
      if (serverBehaviour != null) {
        // try to initiate a nice shutdown
        boolean force = serverBehaviour.getServer().getServerState() == IServer.STATE_STOPPING;
        serverBehaviour.stop(force);
      }
      update();
    }
  };
  terminateAction.setToolTipText(Messages.actionStopToolTip);
  terminateAction.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_ELCL_STOP));
  terminateAction.setHoverImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CLCL_STOP));
  terminateAction.setDisabledImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_DLCL_STOP));

  toolbarManager.appendToGroup(IConsoleConstants.LAUNCH_GROUP, terminateAction);
}
 
Example #14
Source File: LocalAppEngineServerLaunchConfigurationDelegate.java    From google-cloud-eclipse with Apache License 2.0 6 votes vote down vote up
@VisibleForTesting
void checkConflictingLaunches(ILaunchConfigurationType launchConfigType, String mode,
    RunConfiguration runConfig, ILaunch[] launches) throws CoreException {

  for (ILaunch launch : launches) {
    if (launch.isTerminated()
        || launch.getLaunchConfiguration() == null
        || launch.getLaunchConfiguration().getType() != launchConfigType) {
      continue;
    }
    IServer otherServer = ServerUtil.getServer(launch.getLaunchConfiguration());
    List<Path> paths = new ArrayList<>();
    RunConfiguration otherRunConfig =
        generateServerRunConfiguration(launch.getLaunchConfiguration(), otherServer, mode, paths);
    IStatus conflicts = checkConflicts(runConfig, otherRunConfig,
        new MultiStatus(Activator.PLUGIN_ID, 0,
            Messages.getString("conflicts.with.running.server", otherServer.getName()), //$NON-NLS-1$
            null));
    if (!conflicts.isOK()) {
      throw new CoreException(StatusUtil.filter(conflicts));
    }
  }
}
 
Example #15
Source File: LocalAppEngineStandardLaunchShortcut.java    From google-cloud-eclipse with Apache License 2.0 6 votes vote down vote up
/**
 * Find any applicable launch configurations.
 */
private ILaunchConfiguration[] getLaunchConfigurations(IModule[] modules) {
  // First check if there's a server with exactly these modules
  Collection<IServer> servers = launcher.findExistingServers(modules, /* exact */ true, null);
  if (servers.isEmpty()) {
    // otherwise check if there's a server with at least these modules
    servers = launcher.findExistingServers(modules, /* exact */ false, null);
  }
  Collection<ILaunchConfiguration> launchConfigs = new ArrayList<>();
  for (IServer server : servers) {
    // Could filter out running servers, but then more servers are created
    try {
      ILaunchConfiguration launchConfig = server.getLaunchConfiguration(false, null);
      if (launchConfig != null) {
        launchConfigs.add(launchConfig);
      }
    } catch (CoreException ex) {
      /* ignore */
    }
  }
  return launchConfigs.toArray(new ILaunchConfiguration[launchConfigs.size()]);
}
 
Example #16
Source File: LocalAppEngineServerLaunchConfigurationDelegate.java    From google-cloud-eclipse with Apache License 2.0 6 votes vote down vote up
@Override
public void serverChanged(ServerEvent event) {
  Preconditions.checkState(server == event.getServer());
  switch (event.getState()) {
    case IServer.STATE_STARTED:
      openBrowserPage(server);
      fireChangeEvent(DebugEvent.STATE);
      return;

    case IServer.STATE_STOPPED:
      server.removeServerListener(serverEventsListener);
      fireTerminateEvent();
      try {
        logger.fine("Server stopped; terminating launch"); //$NON-NLS-1$
        launch.terminate();
      } catch (DebugException ex) {
        logger.log(Level.WARNING, "Unable to terminate launch", ex); //$NON-NLS-1$
      }
      checkUpdatedDatastoreIndex(launch.getLaunchConfiguration());
      return;

    default:
      fireChangeEvent(DebugEvent.STATE);
      return;
  }
}
 
Example #17
Source File: JVoiceXMLServerBehaviour.java    From JVoiceXML with GNU Lesser General Public License v2.1 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
protected void setupLaunch(final ILaunch launch, final String launchMode,
        final IProgressMonitor monitor) throws CoreException {
    setServerState(IServer.STATE_STARTING);
    setMode(launchMode);
}
 
Example #18
Source File: JVoiceXMLServerBehaviour.java    From JVoiceXML with GNU Lesser General Public License v2.1 5 votes vote down vote up
/**
 * Marks the server as started.
 * @param started <code>true</code> if the server is started.
 */
public void setStarted(final boolean started) {
    if (started) {
        setServerState(IServer.STATE_STARTED);
    } else {
        setServerState(IServer.STATE_STOPPED);
    }
}
 
Example #19
Source File: DatastoreIndexUpdateData.java    From google-cloud-eclipse with Apache License 2.0 5 votes vote down vote up
@VisibleForTesting
static DatastoreIndexUpdateData detect(ILaunchConfiguration configuration, IServer server,
    IModule defaultService) {
  LocalAppEngineServerBehaviour serverBehaviour = (LocalAppEngineServerBehaviour) server
      .loadAdapter(LocalAppEngineServerBehaviour.class, null);
  IPath deployPath = serverBehaviour.getModuleDeployDirectory(defaultService);
  IPath datastoreIndexesAutoXml =
      deployPath.append("WEB-INF/appengine-generated/datastore-indexes-auto.xml");
  if (!indexGenerated(datastoreIndexesAutoXml)) {
    return null;
  }
  // datastore-indexes-auto.xml may be generated even if datastore-indexes.xml does not exist
  IFile datastoreIndexesXml =
      AppEngineConfigurationUtil.findConfigurationFile(
          defaultService.getProject(),
          new org.eclipse.core.runtime.Path("datastore-indexes.xml"));

  if (datastoreIndexesXml != null && datastoreIndexesXml.exists()) {
    long sourceTimestamp = datastoreIndexesXml.getLocalTimeStamp();
    long generatedTimestamp = datastoreIndexesAutoXml.toFile().lastModified();
    if (sourceTimestamp > generatedTimestamp) {
      logger.log(Level.FINE, "no change based on datastore-indexes timestamps");
      return null;
    }
  }

  return new DatastoreIndexUpdateData(server, configuration, defaultService, datastoreIndexesXml,
      datastoreIndexesAutoXml);
}
 
Example #20
Source File: BasePublishOperation.java    From google-cloud-eclipse with Apache License 2.0 5 votes vote down vote up
public void execute(IProgressMonitor monitor, IAdaptable info) throws CoreException {
  initialize();

  List<IStatus> statuses = new ArrayList<IStatus>();
  // If parent web module
  if (module.length == 1) {
    publishDir(module[0], statuses, monitor);
  } else {
    // Else a child module
    Properties properties = loadModulePublishLocations();

    // Try to determine the URI for the child module
    IWebModule webModule = (IWebModule) module[0].loadAdapter(IWebModule.class, monitor);
    String childURI = null;
    if (webModule != null) {
      childURI = webModule.getURI(module[1]);
    }
    // Try to determine if child is binary
    IJ2EEModule childModule = (IJ2EEModule) module[1].loadAdapter(IJ2EEModule.class, monitor);
    boolean isBinary = false;
    if (childModule != null) {
      isBinary = childModule.isBinary();
    }

    if (isBinary) {
      publishArchiveModule(childURI, properties, statuses, monitor);
    } else {
      publishJar(childURI, properties, statuses, monitor);
    }
    saveModulePublishLocations(properties);
  }
  throwExceptionOnError(statuses);
  setModulePublishState(module, IServer.PUBLISH_STATE_NONE);
}
 
Example #21
Source File: LaunchHelper.java    From google-cloud-eclipse with Apache License 2.0 5 votes vote down vote up
/**
 * Look for servers that may match.
 * 
 * @param modules the web modules to search for
 * @param exact if true, look for exact module match
 * @return an existing server
 */
@VisibleForTesting
Collection<IServer> findExistingServers(IModule[] modules, boolean exact,
    SubMonitor progress) {
  if (modules.length == 1) {
    IServer defaultServer = ServerCore.getDefaultServer(modules[0]);
    if (defaultServer != null && defaultServer.getServerType() != null
        && LocalAppEngineServerDelegate.SERVER_TYPE_ID
            .equals(defaultServer.getServerType().getId())) {
      return Collections.singletonList(defaultServer);
    }
  }
  Set<IModule> myModules = ImmutableSet.copyOf(modules);
  List<IServer> matches = new ArrayList<>();
  // Look for servers that contain these modules
  // Could prioritize servers that have *exactly* these modules,
  // or that have the smallest overlap
  for (IServer server : ServerCore.getServers()) {
    // obsolete or unavailable server definitions have serverType == null
    if (server.getServerType() == null
        || !LocalAppEngineServerDelegate.SERVER_TYPE_ID.equals(server.getServerType().getId())) {
      continue;
    }
    Set<IModule> serverModules = ImmutableSet.copyOf(server.getModules());
    SetView<IModule> overlap = Sets.intersection(myModules, serverModules);
    if (overlap.size() == myModules.size()
        && (!exact || overlap.size() == serverModules.size())) {
      matches.add(server);
    }
  }
  return matches;
}
 
Example #22
Source File: GwtWtpPlugin.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Return all the modules on the server, including child modules.
 */
private List<IModule[]> getAllModules(IServer server) {
  List<IModule[]> modules = new ArrayList<>();
  // todo: add grandchildren
  for (IModule root : server.getModules()) {
    modules.add(new IModule[] {root});
    for (IModule child : server.getChildModules(new IModule[] {root}, null)) {
      modules.add(new IModule[] {root, child});
    }
  }
  return modules;
}
 
Example #23
Source File: BOSWebServerManager.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
private void waitServerStopped(final IProgressMonitor monitor) throws CoreException {
    while (tomcat != null
            && tomcat.getServerState() != IServer.STATE_STOPPED) {
        try {
            Thread.sleep(1000);
        } catch (final InterruptedException e) {
            BonitaStudioLog.error(e, EnginePlugin.PLUGIN_ID);
        }
    }
}
 
Example #24
Source File: LocalAppEngineServerDelegate.java    From google-cloud-eclipse with Apache License 2.0 5 votes vote down vote up
/**
 * Returns a {@link LocalAppEngineServerDelegate} instance associated with the
 * {@code server} or a new {@link LocalAppEngineServerDelegate} instance if a
 * {@link LocalAppEngineServerDelegate} instance cannot be found for {@code server}.
 *
 * @param server the App Engine server
 * @return a new {@link LocalAppEngineServerDelegate} instance or the one associated with
 *         {@code server}
 */
public static LocalAppEngineServerDelegate getAppEngineServer(IServer server) {
  LocalAppEngineServerDelegate serverDelegate =
      server.getAdapter(LocalAppEngineServerDelegate.class);
  if (serverDelegate == null) {
    serverDelegate = (LocalAppEngineServerDelegate) server
        .loadAdapter(LocalAppEngineServerDelegate.class, null);
  }
  return serverDelegate;
}
 
Example #25
Source File: GwtWtpPlugin.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Return the launcher directory path.
 * 
 * The -launcherDir war/output/path is the war deployment directory
 * 
 * @param server
 * @param launchConfig
 * @param gwtFacetedProject
 * @return the launcher directory or war output path
 */
private String getLauncherDirectory(IServer server, ILaunchConfiguration launchConfig,
    IFacetedProject gwtFacetedProject) {
  String launcherDir = null;

  // The root module will be the server module
  // The root module may have children such as, client, shared
  // The root module may not have any children
  for (IModule[] module : getAllModules(server)) {
    if (module[module.length - 1].getProject() == gwtFacetedProject.getProject()) {
      // Child modules are overlaid or included in the root module
      IPath path = null;
      if (server instanceof IModulePublishHelper) {
        path = ((IModulePublishHelper) server).getPublishDirectory(new IModule[] { module[0] });
      } else {
        IModulePublishHelper helper = server.getAdapter(IModulePublishHelper.class);
        if (helper != null) {
          path = helper.getPublishDirectory(new IModule[] { module[0] });
        }
      }
      // example:
      // /Users/branflake2267/Documents/runtime-EclipseApplication/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/broyer-sandbox-server
      launcherDir = path == null ? null : path.toOSString();
      if (launcherDir != null) {
        return launcherDir;
      }
    }
  }

  // Get the the war output path from classic launch configuration working directory
  // Also used GaeServerBehaviour.setupLaunchConfig(...)
  try {
    launcherDir = launchConfig.getAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, (String) null);
  } catch (CoreException e) {
    logMessage(
        "posiblyLaunchGwtSuperDevModeCodeServer: Couldn't get working directory from launchConfig IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY.");
  }

  return launcherDir;
}
 
Example #26
Source File: DatastoreIndexUpdateData.java    From google-cloud-eclipse with Apache License 2.0 5 votes vote down vote up
private DatastoreIndexUpdateData(IServer server, ILaunchConfiguration configuration,
    IModule module, IFile datastoreIndexesXml, IPath datastoreIndexesAutoXml) {
  this.server = server;
  this.configuration = configuration;
  this.module = module;
  this.datastoreIndexesXml = datastoreIndexesXml;
  this.datastoreIndexesAutoXml = datastoreIndexesAutoXml;
}
 
Example #27
Source File: LocalAppEngineServerDelegateTest.java    From google-cloud-eclipse with Apache License 2.0 5 votes vote down vote up
private LocalAppEngineServerDelegate getDelegateWithServer() throws CoreException {
  IServerWorkingCopy serverWorkingCopy =
      ServerCore.findServerType("com.google.cloud.tools.eclipse.appengine.standard.server")
        .createServer("testServer", null, null);
  IRuntimeWorkingCopy runtimeWorkingCopy =
      ServerCore.findRuntimeType("com.google.cloud.tools.eclipse.appengine.standard.runtime")
        .createRuntime("testRuntime", null);
  IRuntime runtime = runtimeWorkingCopy.save(true, null);
  serverWorkingCopy.setRuntime(runtime);
  IServer original = serverWorkingCopy.save(true, null);
  return LocalAppEngineServerDelegate.getAppEngineServer(original);
}
 
Example #28
Source File: DatastoreIndexUpdateData.java    From google-cloud-eclipse with Apache License 2.0 5 votes vote down vote up
/**
 * Check the server configuration and detect if a {@code datastore-indexes-auto.xml} was found.
 * Return {@code null} if not found.
 */
public static DatastoreIndexUpdateData detect(ILaunchConfiguration configuration, IServer server) {
  // The datastore-indexes.xml file should be in the default module's WEB-INF/ directory.
  IModule defaultService = ModuleUtils.findService(server, "default");
  if (defaultService == null) {
    return null;
  }
  return detect(configuration, server, defaultService);
}
 
Example #29
Source File: PortConfigurator.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
public PortConfigurator(final IServer server,
        final ClientBonitaHomeBuildler clientBonitaHomeBuildler,
        final IPreferenceStore preferenceStore) {
    this.server = server;
    this.clientBonitaHomeBuildler = clientBonitaHomeBuildler;
    this.preferenceStore = preferenceStore;
}
 
Example #30
Source File: LaunchHelper.java    From google-cloud-eclipse with Apache License 2.0 5 votes vote down vote up
private IServer createServer(IModule[] modules, SubMonitor progress) throws CoreException {
  IServerType serverType = ServerCore.findServerType(LocalAppEngineServerDelegate.SERVER_TYPE_ID);
  IServerWorkingCopy serverWorkingCopy =
      serverType.createServer(null, null, progress.newChild(4));
  serverWorkingCopy.modifyModules(modules, null, progress.newChild(4));
  return serverWorkingCopy.save(false, progress.newChild(2));
}