Package org.eclipse.wst.server.core

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


    }
  }

  public IServer getHTTPServer() throws Exception {

    IServer httpServer = findServer(HTTP_SERVER_NAME);

    if (httpServer == null) {
      httpServer = createHTTPServer(HTTP_SERVER_NAME);
    }
View Full Code Here


    TestCase.assertNotNull(jsBkp);
    return jsBkp;
  }

  private IServer findServer(String httpServerName) {
    IServer servers[] = ServerCore.getServers();
    for (int i = 0; i < servers.length; i++) {
      if (servers[i].getId().equals(httpServerName)) {
        return servers[i];
      }
    }
View Full Code Here

public class ModelCleanAction extends PluginDeployBase implements IWorkbenchWindowActionDelegate {

  @Override
  public void run(IAction arg0) {
    // TODO Auto-generated method stub
    IServer tamcatServer=TomcatServerOsgiModel.getTomcatServer();
    TomcatServerOsgiModel serverModel = new TomcatServerOsgiModel(tamcatServer);
    if(tamcatServer.getLaunch()==null){
      Console.println("Begin Eliminate Work Directory:"+serverModel.getCatalinaPath());
      File bundelFile=new File(serverModel.getCatalinaPath());
      deleteFile(bundelFile);
      //bundel clean
      IProject hostWeb = serverModel.getHostModule().getProject();
View Full Code Here

    if(BuiderParameter.getProjectAutoDeploy(resource.getProject())){
      String syncType=BuilderProperty.getSyncPath();
      if(syncType.endsWith(Constants.JAR_FILE_EXTENSION_NAME)){
        Console.println(DynamicPluginBuilder.class.getName()+" Begin Sync File "+resource.getName());
        //parse match Server
        IServer tamcatServer=TomcatServerOsgiModel.getTomcatServer();
        //buidler processing
        if(tamcatServer==null||tamcatServer.getLaunch()==null){
          return;
        }else if(BuiderParameter.contains(resource.getName())){
          TomcatServerOsgiModel serverModel = new TomcatServerOsgiModel(tamcatServer);
          PluginDeployEngine deployEngine=new PluginDeployEngine();
          deployEngine.setServerModel(serverModel);
View Full Code Here

   * @param resource
   * @param changeMode
   */
  public void resourceChanged(IResource resource, int changeMode) {
    if(ProjectUtil.isPluginProject(resource)){
      IServer tomcatServer=TomcatServerOsgiModel.getTomcatServer();
      if(tomcatServer==null||tomcatServer.getLaunch()==null){
        return;
      }else if(BuiderParameter.contains(resource.getProject().getName())){
        TomcatServerOsgiModel tomcatServerModel = new TomcatServerOsgiModel(tomcatServer);
        ResourceChangeEngine resourceChangeEngine=new ResourceChangeEngine(resource,changeMode);
        resourceChangeEngine.resourceChangedJob(tomcatServerModel);
View Full Code Here

  }
  /***
   * ����ͬ��
   */
  private void launchSync(){
    IServer tamcatServer = TomcatServerOsgiModel.getTomcatServer();
    ServerCore.addServerLifecycleListener(new IServerLifecycleListener() {
      @Override
      public void serverAdded(IServer server) {
        IRuntimeType type = server.getServerType().getRuntimeType();
        if (type.getName().startsWith(Constants.ApacheTomcat)) {
          server.addServerListener(new TomcatServerListener());
          Console.println(type.getName() + " Add Server Listener "
              + IServerListener.class.getName());
        }
      }
      @Override
      public void serverChanged(IServer server) {
        // TODO Auto-generated method stub
      }
      @Override
      public void serverRemoved(IServer server) {
        IRuntimeType type = server.getServerType().getRuntimeType();
        if (type.getName().startsWith(Constants.ApacheTomcat)) {
          server.removeServerListener(new TomcatServerListener());
          Console.println(type.getName() + " Remove Server Listener "
              + IServerListener.class.getName());
        }
      }
    });
    if (tamcatServer == null) {
      return;
    } else {
      tamcatServer.addServerListener(new TomcatServerListener());
      Console.println(tamcatServer.getName() + " Add Server Listener "
          + IServerListener.class.getName());
    }
  }
View Full Code Here

    IProject selectProject = getCurrentProject();
    if (selectProject == null) {
      MessageDialog.openInformation(shell, "��ʾ��Ϣ", "��ѡ��Ҫ������ģ����Ŀ��");
    } else if (ProjectUtil.isPluginProject(selectProject)) {
      // parse match Server
      IServer tamcatServer = TomcatServerOsgiModel.getTomcatServer();
      // buidler processing
      if (tamcatServer == null || tamcatServer.getLaunch() == null) {
        MessageDialog.openInformation(shell, "��ʾ��Ϣ", "ϵͳ���ķ�����δ������");
      } else if (BuiderParameter.contains(selectProject.getName())) {
        TomcatServerOsgiModel serverModel = new TomcatServerOsgiModel(
            tamcatServer);
        PluginDeployEngine deployEngine = new PluginDeployEngine();
View Full Code Here

public class ModelOpenAction extends PluginDeployBase implements IWorkbenchWindowActionDelegate{
  @Override
  public void run(IAction arg0) {
    // TODO Auto-generated method stub
    IServer tamcatServer=TomcatServerOsgiModel.getTomcatServer();
    TomcatServerOsgiModel serverModel = new TomcatServerOsgiModel(tamcatServer);
    String directory= serverModel.getDeployPath();
    if (directory == null) {
      return;
    }
View Full Code Here

import org.eclipse.wst.server.core.util.SocketUtil;

public class OpenEJBLaunchConfigurationDelegate extends AbstractJavaLaunchConfigurationDelegate {

  public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
    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

            //get error flag from configuration if it's set in setLaunchConfiguration
            String errorMessage = configuration.getAttribute(GeronimoServerBehaviourDelegate.ERROR_SETUP_LAUNCH_CONFIGURATION,"");
            throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, IJavaLaunchConfigurationConstants.ERR_INTERNAL_ERROR, errorMessage, null));
        }
       
    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

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.