Package org.eclipse.wst.server.core

Examples of org.eclipse.wst.server.core.IServer.loadAdapter()


  }

  private void openApplicationPage(ModuleServer moduleServer) {
    final IModule[] modules = moduleServer.getModule();
    IServer server = moduleServer.getServer();
    CloudFoundryServer cloudServer = (CloudFoundryServer) server.loadAdapter(CloudFoundryServer.class, null);
    if (cloudServer != null && modules != null && modules.length == 1) {
      IWorkbenchWindow workbenchWindow = ServerUIPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow();
      IWorkbenchPage page = workbenchWindow.getActivePage();

      try {
View Full Code Here


    // Handle the TreeSelection
    if (receiver instanceof StructuredSelection) {
      Object obj = ((StructuredSelection)receiver).getFirstElement();
      if (obj instanceof IServer) {
         server = (IServer) obj;
         cloudFoundryServer = (CloudFoundryServer) server.loadAdapter(CloudFoundryServer.class, null);
      } else if (obj instanceof IServerModule) {
         serverModule = (IServerModule)obj;
         cloudFoundryServer = getCloudFoundryServer(serverModule);
      }
    } // Handle the List
View Full Code Here

      List<?> arr = (List<?>) receiver;
      if (!arr.isEmpty()) {
        Object obj = arr.get(0);
        if (obj instanceof IServer) {
         server = (IServer) obj;
         cloudFoundryServer = (CloudFoundryServer) server.loadAdapter(CloudFoundryServer.class, null);
        }
      }
    } else // This is the default behaviour, as before
        serverModule = getServerModule(receiver);
      if (serverModule != null) {
View Full Code Here

  protected CloudFoundryServer getCloudFoundryServer(IServerModule serverModule) {

    if (serverModule != null) {
      IServer server = serverModule.getServer();

      return (CloudFoundryServer) server.loadAdapter(CloudFoundryServer.class, null);
    }
    return null;
  }

  protected IServerModule getServerModule(Object context) {
View Full Code Here

        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

    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

    IServer server = ServerUtil.getServer(configuration);
    if (server == null) {
      abort("Missing server", null,
          IJavaLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
    }
    OpenEJBServerBehaviour genericServer = (OpenEJBServerBehaviour) server.loadAdapter(ServerBehaviourDelegate.class, null);

    try {
//      genericServer.setupLaunch(launch, mode, monitor);
      if(genericServer.getServer().getServerType().supportsRemoteHosts() && !SocketUtil.isLocalhost(genericServer.getServer().getHost())){
      // no launch for remote servers
View Full Code Here

       
    IServer server = ServerUtil.getServer(configuration);
    if (server == null) {
      throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, IJavaLaunchConfigurationConstants.ERR_INTERNAL_ERROR, Messages.missingServer, null));
    }
    GeronimoServerBehaviourDelegate geronimoServer = (GeronimoServerBehaviourDelegate) server.loadAdapter(GeronimoServerBehaviourDelegate.class, null);
    geronimoServer.setupLaunch(launch, mode, monitor);

    if (geronimoServer.isRemote()) {
      // no support for launching remote servers
      return;
View Full Code Here

  private boolean canUpdateState() {
    IGeronimoServer thisServer = (IGeronimoServer) this.server.loadAdapter(IGeronimoServer.class, null);
    IServer[] allServers = ServerCore.getServers();
    for (int i = 0; i < allServers.length; i++) {
      IServer server = allServers[i];
      IGeronimoServer gs = (IGeronimoServer) server.loadAdapter(IGeronimoServer.class, null);
      if (gs != null && !this.server.getId().equals(server.getId())) {
        if (isSameConnectionURL(gs, thisServer)) {
          if (!isSameRuntimeLocation(server) && server.getServerState() != IServer.STATE_STOPPED) {
            Trace.trace(Trace.WARNING, server.getId() + " Cannot update server state.  URL conflict between multiple servers.");
            return false;
View Full Code Here

  @Override
  public Image getImage(Object element) {
    if( element instanceof KarafServerConnection) {
      IServer s = ((KarafServerConnection)element).getServer();
      KarafServerDelegate del = (KarafServerDelegate)s.loadAdapter(KarafServerDelegate.class, new NullProgressMonitor());
      if( del != null ) {
        return ServerUICore.getLabelProvider().getImage(s);
      }
    }
    return null;
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.