Package org.jboss.ide.eclipse.as.core.server.bean

Examples of org.jboss.ide.eclipse.as.core.server.bean.ServerBean


   * @return      the runtime working copy or null if invalid
   */
  public IRuntimeWorkingCopy getRuntimeFromDir(File dir, IProgressMonitor monitor) {
    String absolutePath = dir.getAbsolutePath();
    ServerBeanLoader l = new ServerBeanLoader(dir);
    ServerBean sb = l.getServerBean();
    if( sb != null ) {
      ServerBeanType type = sb.getBeanType();
      if( type != null ) {
        if( type.equals(Fabric8BeanProvider.FABRIC8_1x)) {
          String serverType = l.getServerAdapterId();
          if( serverType != null ) {
            IServerType t = ServerCore.findServerType(serverType);
View Full Code Here


    if (monitor.isCanceled() || root == null) {
      return null;
    }
   
    ServerBeanLoader loader = new ServerBeanLoader(root);
    ServerBean serverBean = loader.getServerBean();
    ServerBeanType type = serverBean.getBeanType();
    if( Fabric8BeanProvider.FABRIC8_1x.equals(type)) {
      RuntimeDefinition runtimeDefinition = new RuntimeDefinition(serverBean.getName(),
          serverBean.getVersion(), type.getId(), new File(serverBean.getLocation()));
      return runtimeDefinition;
    }
    return null;
  }
View Full Code Here

    IPath dest = FuseServerTestActivator.getDefault()
        .getStateLocation().append(this.fRuntimeType);
    ServiceMixMockRuntimeCreationUtil.create4xRuntimeMock(
        this.fRuntimeType, dest);
    ServerBeanLoader l = new ServerBeanLoader(dest.toFile());
    ServerBean b = l.getServerBean();
    assertTrue(b.getBeanType() == ServiceMixBeanProvider.SMX_4x);
    assertEquals(b.getFullVersion(), TYPE_TO_VERSION.get(this.fRuntimeType));
    assertEquals(b.getVersion(), ServerBeanLoader.getMajorMinorVersion(TYPE_TO_VERSION.get(this.fRuntimeType)));
  }
View Full Code Here

    IPath dest = FuseServerTestActivator.getDefault()
        .getStateLocation().append(this.fRuntimeType);
    KarafMockRuntimeCreationUtil.create2xRuntimeMock(
        this.fRuntimeType, dest);
    ServerBeanLoader l = new ServerBeanLoader(dest.toFile());
    ServerBean b = l.getServerBean();
    assertTrue(b.getBeanType() == KarafBeanProvider.KARAF_2x);
    assertEquals(b.getFullVersion(), TYPE_TO_VERSION.get(this.fRuntimeType));
    assertEquals(b.getVersion(), ServerBeanLoader.getMajorMinorVersion(TYPE_TO_VERSION.get(this.fRuntimeType)));
  }
View Full Code Here

    IPath dest = FuseServerTestActivator.getDefault()
        .getStateLocation().append(this.fRuntimeType);
    ServiceMixMockRuntimeCreationUtil.create5xRuntimeMock(
        this.fRuntimeType, dest);
    ServerBeanLoader l = new ServerBeanLoader(dest.toFile());
    ServerBean b = l.getServerBean();
    assertTrue(b.getBeanType() == ServiceMixBeanProvider.SMX_5x);
    assertEquals(b.getFullVersion(), TYPE_TO_VERSION.get(this.fRuntimeType));
    assertEquals(b.getVersion(), ServerBeanLoader.getMajorMinorVersion(TYPE_TO_VERSION.get(this.fRuntimeType)));
  }
View Full Code Here

  public void testKaraf() throws Exception {
    IPath dest = FuseServerTestActivator.getDefault().getStateLocation()
        .append(this.fRuntimeType);
    KarafMockRuntimeCreationUtil.create3xRuntimeMock(this.fRuntimeType, dest);
    ServerBeanLoader l = new ServerBeanLoader(dest.toFile());
    ServerBean b = l.getServerBean();
    assertTrue(b.getBeanType() == KarafBeanProvider.KARAF_3x);
    assertEquals(b.getFullVersion(), TYPE_TO_VERSION.get(this.fRuntimeType));
    assertEquals(b.getVersion(),
        ServerBeanLoader.getMajorMinorVersion(TYPE_TO_VERSION
            .get(this.fRuntimeType)));
  }
View Full Code Here

    IPath dest = FuseServerTestActivator.getDefault()
        .getStateLocation().append(this.fRuntimeType);
    FuseESBMockRuntimeCreationUtil.create6xRuntimeMock(
        this.fRuntimeType, dest);
    ServerBeanLoader l = new ServerBeanLoader(dest.toFile());
    ServerBean b = l.getServerBean();
    assertTrue(b.getBeanType() == FuseBeanProvider.FUSE_6x);
    assertEquals(b.getFullVersion(), TYPE_TO_VERSION.get(this.fRuntimeType));
    assertEquals(b.getVersion(), ServerBeanLoader.getMajorMinorVersion(TYPE_TO_VERSION.get(this.fRuntimeType)));
  }
View Full Code Here

    if (monitor.isCanceled() || root == null) {
      return null;
    }
   
    ServerBeanLoader loader = new ServerBeanLoader(root);
    ServerBean serverBean = loader.getServerBean();
    ServerBeanType type = serverBean.getBeanType();
    if( FuseBeanProvider.FUSE_6x.equals(type)) {
      RuntimeDefinition runtimeDefinition = new RuntimeDefinition(serverBean.getName(),
          serverBean.getVersion(), type.getId(), new File(serverBean.getLocation()));
      return runtimeDefinition;
    }
    return null;
  }
View Full Code Here

    if (monitor.isCanceled() || root == null) {
      return null;
    }
   
    ServerBeanLoader loader = new ServerBeanLoader(root);
    ServerBean serverBean = loader.getServerBean();
    ServerBeanType type = serverBean.getBeanType();
    if( KarafBeanProvider.KARAF_2x.equals(type) ||
      KarafBeanProvider.KARAF_3x.equals(type) ) {
      RuntimeDefinition runtimeDefinition = new RuntimeDefinition(serverBean.getName(),
          serverBean.getVersion(), type.getId(), new File(serverBean.getLocation()));
      return runtimeDefinition;
    }
    return null;
  }
View Full Code Here

  }

  @Override
  public String getVersion() {
    IPath loc = getRuntime().getLocation();
    ServerBean sb = new ServerBeanLoader(loc.toFile()).getServerBean();
    if( sb != null )
      return sb.getFullVersion();
    return null;
  }
View Full Code Here

TOP

Related Classes of org.jboss.ide.eclipse.as.core.server.bean.ServerBean

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.