/** * Get a target bundle descriptor based on an input bundle descriptor and * a relative uri from the perspective of the input bundle descriptor. * * @param origin bundle descriptor within this application * @param relativeTargetUri relative uri from the given bundle descriptor * to another bundle within the application. * @return target BundleDescriptor or null if not found. */ public BundleDescriptor getRelativeBundle(BundleDescriptor origin, String relativeTargetUri) { String targetBundleUri = getTargetUri(origin, relativeTargetUri); BundleDescriptor targetBundle = null; if (targetBundleUri != null) { targetBundle = getModuleByUri(targetBundleUri); } return targetBundle; }
/** * Get a target bundle descriptor based on an input bundle descriptor and * a relative uri from the perspective of the input bundle descriptor. * * @param origin bundle descriptor within this application * @param relativeTargetUri relative uri from the given bundle descriptor * to another bundle within the application. * @return target BundleDescriptor or null if not found. */ public BundleDescriptor getRelativeBundle(BundleDescriptor origin, String relativeTargetUri) { String targetBundleUri = getTargetUri(origin, relativeTargetUri); BundleDescriptor targetBundle = null; if (targetBundleUri != null) { Descriptor module = getModuleByUri(targetBundleUri); targetBundle = (module instanceof BundleDescriptor) ? (BundleDescriptor) module : null; } return targetBundle; }
@Override public <T> T getModuleMetaData(Class<T> metadataType) { try { return metadataType.cast(application.getModuleByUri(moduleUri)); } catch (Exception e) { // let's first try the extensions mechanisms... if (RootDeploymentDescriptor.class.isAssignableFrom(metadataType)) { for (RootDeploymentDescriptor extension : application.getModuleByUri(moduleUri).getExtensionsDescriptors((Class<RootDeploymentDescriptor>) metadataType)) { // we assume there can only be one type of if (extension!=null) { try { return metadataType.cast(extension); } catch (Exception e1) { // next one... } } } } return context.getModuleMetaData(metadataType); } } };
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()); } }
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()); } } }
subComponents = getAppLevelComponents(app, type, subComponentsMap); } else { BundleDescriptor bundleDesc = app.getModuleByUri(modulename); if (bundleDesc == null) { report.setMessage(localStrings.getLocalString("listsubcomponents.invalidmodulename", "Invalid module name", appname, modulename));
/** * Entry point from the framework into the command execution * @param context context for the command. */ public void execute(AdminCommandContext context) { final ActionReport report = context.getActionReport(); ActionReport.MessagePart part = report.getTopMessagePart(); ApplicationInfo appInfo = appRegistry.get(appname); if (appInfo != null) { Application app = appInfo.getMetaData(Application.class); if (app != null) { BundleDescriptor bundleDesc = app.getModuleByUri(modulename); if (bundleDesc != null && bundleDesc instanceof WebBundleDescriptor) { String contextRoot = ((WebBundleDescriptor)bundleDesc).getContextRoot(); part.addProperty(DeploymentProperties.CONTEXT_ROOT, contextRoot); part.setMessage(contextRoot); } } } } }
public ModuleInfo doBundle(ModuleDescriptor bundle) throws Exception { ExtendedDeploymentContext sContext = subContext(application, context, bundle.getArchiveUri()); ModuleInfo info = prepareBundle(bundle, application, sContext); if (info == null) { sContext.getActionReport().setActionExitCode(ActionReport.ExitCode.WARNING); String msg = localStrings.getLocalString("skipmoduleprocessing", "Skipped processing for module {0} as its module type was not recognized", bundle.getArchiveUri()); sContext.getActionReport().setMessage(msg); deplLogger.log(Level.WARNING, UNRECOGNIZED_MODULE_TYPE, bundle.getArchiveUri()); return null; } info.addMetaData(application); BundleDescriptor bundleDesc = application.getModuleByUri( bundle.getArchiveUri()); info.addMetaData(bundleDesc); for (RootDeploymentDescriptor ext : bundleDesc.getExtensionsDescriptors()) { info.addMetaData(ext); } appInfo.addModule(info); return info; }
BundleDescriptor refereeJar = null; if( referringJar instanceof Application ) { refereeJar = ((Application)referringJar).getModuleByUri(jarPath); } else { refereeJar =
BundleDescriptor refereeJar = null; if( referringJar instanceof Application ) { refereeJar = ((Application)referringJar).getModuleByUri(jarPath); } else { refereeJar =