com.sun.enterprise.deployment.Application.getStandaloneBundleDescriptor()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(5.3k)|赞(0)|评价(0)|浏览(79)

本文整理了Java中com.sun.enterprise.deployment.Application.getStandaloneBundleDescriptor()方法的一些代码示例,展示了Application.getStandaloneBundleDescriptor()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Application.getStandaloneBundleDescriptor()方法的具体详情如下:
包路径:com.sun.enterprise.deployment.Application
类名称:Application
方法名:getStandaloneBundleDescriptor

Application.getStandaloneBundleDescriptor介绍

[英]if this application object is virtual, return the standalone bundle descriptor it is wrapping otherwise return null
[中]如果此应用程序对象是虚拟的,则返回它正在包装的独立包描述符,否则返回null

代码示例

代码示例来源:origin: org.glassfish.deployment/dol

@Override
public boolean getKeepState() {
  // for standalone module, get the keep-state value specified in 
  // module glassfish-*.xml
  if (isVirtual()) {
    BundleDescriptor bundleDesc = getStandaloneBundleDescriptor();
    if (bundleDesc != null) {
      return bundleDesc.getKeepState();
    }
  }
  return super.getKeepState();
}

代码示例来源:origin: org.glassfish.main.deployment/deployment-javaee-core

private Map<String, String> getAppLevelComponents(com.sun.enterprise.deployment.Application application, String type, Map<String, String> subComponentsMap) {
  Map<String, String> subComponentList = new LinkedHashMap<String, String>();
  if (application.isVirtual()) {
    // for standalone module, get servlets or ejbs
    BundleDescriptor bundleDescriptor = 
      application.getStandaloneBundleDescriptor();
    subComponentList = getModuleLevelComponents(bundleDescriptor, type, subComponentsMap);
  } else {
    // for ear case, get modules
    Collection<ModuleDescriptor<BundleDescriptor>> modules = 
      getSubModuleListForEar(application, type);
    for (ModuleDescriptor module : modules) {
      StringBuffer sb = new StringBuffer();
      String moduleName = module.getArchiveUri();
      sb.append("<");
      String moduleType = getModuleType(module);
      sb.append(moduleType);
      sb.append(">"); 
      subComponentList.put(moduleName, sb.toString());    
      subComponentsMap.put(module.getArchiveUri(), moduleType);
    }
  }
  return subComponentList;
}

代码示例来源:origin: org.glassfish.main.deployment/dol

@Override
public boolean getKeepState() {
  // for standalone module, get the keep-state value specified in
  // module glassfish-*.xml
  if (isVirtual()) {
    BundleDescriptor bundleDesc = getStandaloneBundleDescriptor();
    if (bundleDesc != null) {
      return bundleDesc.getKeepState();
    }
  }
  return super.getKeepState();
}

代码示例来源:origin: org.glassfish.main.deployment/deployment-javaee-core

public Application load(DeploymentContext dc) throws IOException {
  DeployCommandParameters params = dc.getCommandParameters(DeployCommandParameters.class);
  Application application = processDOL(dc);
  // write out xml files if needed
  if (Boolean.valueOf(WRITEOUT_XML)) {
    saveAppDescriptor(application, dc);
  }
  if (application.isVirtual()) {
    dc.addModuleMetaData(application.getStandaloneBundleDescriptor());
    for (RootDeploymentDescriptor extension : application.getStandaloneBundleDescriptor().getExtensionsDescriptors()) {
      dc.addModuleMetaData(extension);
    }
  }
  addModuleConfig(dc, application);
  validateKeepStateOption(dc, params, application);
  return application;
}

代码示例来源:origin: org.glassfish.deployment/dol

public static BundleDescriptor getCurrentBundleForContext(
    DeploymentContext context) {
    ExtendedDeploymentContext ctx = (ExtendedDeploymentContext)context;
    Application application = context.getModuleMetaData(Application.class);
    if (application == null) return null; // this can happen for non-JavaEE type deployment. e.g., issue 15869
    if (ctx.getParentContext() == null) {
      if (application.isVirtual()) {
        // standalone module
        return application.getStandaloneBundleDescriptor();
      } else {
        // top level 
        return application;
      }
    } else {
      // a sub module of ear
      return application.getModuleByUri(ctx.getModuleUri());
    }
  }
}

代码示例来源:origin: org.glassfish.deployment/dol

public Application openWith(Application app, ReadableArchive archive)
    throws IOException, SAXParseException {
  setManifest(archive.getManifest());
  // application archivist will override this method
  if (app.isVirtual()) {
    T descriptor = readRestDeploymentDescriptors((T)app.getStandaloneBundleDescriptor(), archive, archive, app);
    if (descriptor != null) {
      postOpen(descriptor, archive);
    }
    if (descriptor instanceof BundleDescriptor) {
      ((BundleDescriptor)descriptor).setApplication(app);
    }
  }
  return app;
}

代码示例来源:origin: org.glassfish.main.deployment/dol

public static BundleDescriptor getCurrentBundleForContext(
  DeploymentContext context) {
  ExtendedDeploymentContext ctx = (ExtendedDeploymentContext)context;
  Application application = context.getModuleMetaData(Application.class);
  if (application == null) return null; // this can happen for non-JavaEE type deployment. e.g., issue 15869
  if (ctx.getParentContext() == null) {
    if (application.isVirtual()) {
      // standalone module
      return application.getStandaloneBundleDescriptor();
    } else {
      // top level 
      return application;
    }
  } else {
    // a sub module of ear
    return application.getModuleByUri(ctx.getModuleUri());
  }
}

代码示例来源:origin: org.glassfish.main.deployment/dol

public Application openWith(Application app, ReadableArchive archive)
    throws IOException, SAXException {
  setManifest(archive.getManifest());
  // application archivist will override this method
  if (app.isVirtual()) {
    T descriptor = readRestDeploymentDescriptors((T)app.getStandaloneBundleDescriptor(), archive, archive, app);
    if (descriptor != null) {
      postOpen(descriptor, archive);
      descriptor.setApplication(app);
    }
  }
  return app;
}

代码示例来源:origin: org.glassfish.main.deployment/deployment-javaee-core

ModuleDescriptor md = application.getStandaloneBundleDescriptor().getModuleDescriptor();
  md.setModuleName(name);
  ModuleDescriptor md = application.getStandaloneBundleDescriptor().getModuleDescriptor();
  md.setModuleName(name);
} catch(SAXException e) {

相关文章

微信公众号

最新文章

更多

Application类方法