Examples of loadAdapter()


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

       
    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

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

  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

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

  @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

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

  }

  protected int findSSHPort(int defaultValue) {
    IServer s = getServer();
    if (s != null) {
      IKarafServerDelegate ksd = (IKarafServerDelegate)s.loadAdapter(IKarafServerDelegate.class, new NullProgressMonitor());
      if (ksd != null) {
        return ksd.getPortNumber();
      }
    }
    return defaultValue;
View Full Code Here

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

public class UpdatePasswordCommand extends BaseCommandHandler {

  public Object execute(ExecutionEvent event) throws ExecutionException {
    initializeSelection(event);
    IServerWorkingCopy wc = selectedServer.createWorkingCopy();
    final CloudFoundryServer cfServer = (CloudFoundryServer) wc.loadAdapter(CloudFoundryServer.class, null);
    final UpdatePasswordDialog dialog = new UpdatePasswordDialog(Display.getDefault().getActiveShell(), cfServer.getUsername());
   
    if (dialog.open() == IDialogConstants.OK_ID) {
      String errorMsg = CloudUiUtil.updatePassword(dialog.getPassword(), cfServer, wc);
      if (errorMsg != null) {
View Full Code Here

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

    public IServer createServer() throws CoreException {
      Assert.isTrue(server == null, "createServer() already invoked");

      server = handler.createServer(new NullProgressMonitor(), ServerHandler.ALWAYS_OVERWRITE);
      IServerWorkingCopy serverWC = server.createWorkingCopy();
      CloudFoundryServer cloudFoundryServer = (CloudFoundryServer) serverWC.loadAdapter(CloudFoundryServer.class,
          null);
      CredentialProperties credentials = getCredentials();
      cloudFoundryServer.setPassword(credentials.password);
      cloudFoundryServer.setUsername(credentials.userEmail);
View Full Code Here

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

  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;
  }

  private void validate() {
    if (configFile.getText() != null && configFile.getText().length() > 0) {
View Full Code Here

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

  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.loadAdapter()

  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());
View Full Code Here

Examples of org.eclipse.wst.server.core.internal.Server.loadAdapter()

   * This method is API used by CloudFoundry Code.
   */
  public CloudFoundryServer getCloudFoundryServer() throws CoreException {
    Server server = (Server) getServer();

    CloudFoundryServer cloudFoundryServer = (CloudFoundryServer) server.loadAdapter(CloudFoundryServer.class, null);
    if (cloudFoundryServer == null) {
      throw new CoreException(new Status(IStatus.ERROR, CloudFoundryPlugin.PLUGIN_ID, "Fail to load server")); //$NON-NLS-1$
    }
    return cloudFoundryServer;
  }
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.