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

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


   * @param monitor  the monitor
   * @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);
            if( t != null ) {
              IRuntimeType rtt = t.getRuntimeType();
              try {
View Full Code Here


      IProgressMonitor monitor) {
    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;
View Full Code Here

  public void testServiceMix() throws Exception {
    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

  private void createFuseServerFromDefinitions(List<RuntimeDefinition> runtimeDefinitions) {
    for (RuntimeDefinition runtimeDefinition:runtimeDefinitions) {
      if (runtimeDefinition.isEnabled()) {
        File asLocation = runtimeDefinition.getLocation();
        if (asLocation != null && asLocation.isDirectory()) {
          String wtpServerType = new ServerBeanLoader(asLocation).getServerAdapterId();
          if( isFabric8ServerType(wtpServerType)) {
            String name = runtimeDefinition.getName();
            String runtimeName = name + " Runtime"; //$NON-NLS-1$
            createFuseServer(asLocation, wtpServerType, name, runtimeName);
          }
View Full Code Here

  public void testKaraf() throws Exception {
    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

  public void testServiceMix() throws Exception {
    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

  @Test
  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

  public void testFuseESB() throws Exception {
    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

  }
 
  protected String getHomeVersionWarning() {
    String homeDir = homeDirComposite.getHomeDirectory();
    File loc = new File(homeDir);
    String serverId = new ServerBeanLoader(loc).getServerAdapterId();
    String rtId = serverId == null ? null :
        ServerCore.findServerType(serverId).getRuntimeType().getId();
    IRuntime adapterRt = getRuntimeFromTaskModel();
    String adapterRuntimeId = adapterRt.getRuntimeType().getId();
    if( !adapterRuntimeId.equals(rtId)) {
View Full Code Here

   *
   * @param installFolder  the installation folder
   * @return  the version string or null on errors
   */
  public static String getVersion(File installFolder) {
    ServerBeanLoader loader = new ServerBeanLoader(installFolder);
    if( loader.getServerBeanType() != ServerBeanType.UNKNOWN) {
      return loader.getFullServerVersion();
    }
    return null;
  }
View Full Code Here

TOP

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

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.