/** * Start of validation logic. */ private void validateResources(AppResources appResources) { for (AppResource resource : appResources.myResources) { if (!resource.validate) continue; if (resource.getType().equals("CFD") || resource.getType().equals("AODD")) validateRAName(resource); else validateJNDIRefs(resource, appResources.myNamespace); } // Validate the ra-names of app scoped resources // RA-name and the type of this resource are stored List<Map.Entry<String, String>> raNames = (List<Map.Entry<String, String>>) dc.getTransientAppMetadata().get(ResourceConstants.APP_SCOPED_RESOURCES_RA_NAMES); if (raNames == null) return; for (Map.Entry<String, String> entry: raNames) { validateRAName(entry.getKey(), entry.getValue()); } }
Application app = dc.getTransientAppMetaData(Application.APPLICATION, Application.class); Map<String, Map<String, List>> resourcesList = (Map<String, Map<String, List>>)dc.getTransientAppMetadata().get(ConnectorConstants.APP_SCOPED_RESOURCES_MAP);
Application app = dc.getTransientAppMetaData(ServerTags.APPLICATION, Application.class); Map<String, Map<String, List>> resourcesList = (Map<String, Map<String, List>>)dc.getTransientAppMetadata().get(APP_SCOPED_RESOURCES_MAP);
/** * Store all the resources before starting the validation. */ private void parseResources(AppResources appResources) { parseResources(application, appResources); for (BundleDescriptor bd : application.getBundleDescriptors()) { if (bd instanceof WebBundleDescriptor || bd instanceof ApplicationClientDescriptor) parseResources(bd, appResources); if (bd instanceof EjbBundleDescriptor) { // Resources from Java files in the ejb.jar which are neither an EJB nor a managed bean are stored here. // Skip validation for them, validate only Managed Beans. for (ManagedBeanDescriptor mbd: bd.getManagedBeans()) { parseResources(mbd, (JndiNameEnvironment) bd, appResources); } EjbBundleDescriptor ebd = (EjbBundleDescriptor) bd; for (EjbDescriptor ejb : ebd.getEjbs()) parseEJB(ejb, appResources); } } parseManagedBeans(appResources); // Parse AppScoped resources String appName = DOLUtils.getApplicationName(application); Map<String, List<String>> resourcesList = (Map<String, List<String>>) dc.getTransientAppMetadata().get(ResourceConstants.APP_SCOPED_RESOURCES_JNDI_NAMES); appResources.storeAppScopedResources(resourcesList, appName); }