public Map<String, List<String>> getMetadata() { return injector.getMetadata(); }
/** * Creates {@link ConfigModel} for the given {@link ConfigInjector} if we haven't done so. */ /*package*/ ConfigModel buildModel(ActiveDescriptor<? extends ConfigInjector> i) { ConfigModel m = models.get(i); if(m==null) m = new ConfigModel(this, i, i.getMetadata(), habitat); return m; }
/** * @param in * If provided, this is used to record the source location where this DOM object is loaded from. * Otherwise this can be null. */ public Dom(ServiceLocator habitat, DomDocument document, Dom parent, ConfigModel model, XMLStreamReader in) { super(createDescriptor( model.targetTypeName, model.injector.getLoader(), model.injector.getMetadata())); this.habitat = habitat; if (in!=null) { this.location = new LocationImpl(in.getLocation()); } else { this.location=null; } this.model = model; this.document = document; this.parent = parent; // TODO: This code is disabled as it does fail from time to time when assertions are enabled // assert (parent==null || parent.document==document); // all the nodes in the tree must belong to the same document }
public Map<String, List<String>> getMetadata() { return injector.getMetadata(); }
public Map<String, List<String>> getMetadata() { return injector.getMetadata(); }
private static String getAnnotationHandlerForStringValue(ActiveDescriptor<AnnotationHandler> onMe) { Map<String, List<String>> metadata = onMe.getMetadata(); List<String> answers = metadata.get(AnnotationHandler.ANNOTATION_HANDLER_METADATA); if (answers == null || answers.isEmpty()) return null; return answers.get(0); }
/** * Creates {@link ConfigModel} for the given {@link ConfigInjector} if we haven't done so. */ /*package*/ ConfigModel buildModel(ActiveDescriptor<? extends ConfigInjector> i) { ConfigModel m = models.get(i); if(m==null) m = new ConfigModel(this, i, i.getMetadata(), habitat); return m; }
/** * Creates {@link ConfigModel} for the given {@link ConfigInjector} if we haven't done so. */ /*package*/ ConfigModel buildModel(ActiveDescriptor<? extends ConfigInjector> i) { ConfigModel m = models.get(i); if(m==null) m = new ConfigModel(this, i, i.getMetadata(), habitat); return m; }
private static boolean debugCommand(ServiceHandle<?> command) { ActiveDescriptor<?> ad = command.getActiveDescriptor(); Map<String, List<String>> metadata = ad.getMetadata(); List<String> modes = metadata.get(MODE); if (modes == null) return false; for (String mode : modes) { if (DEBUG.equals(mode)) return true; } return false; }
public static List<ConfigurationDeploymentDescriptorFile> getConfigurationDeploymentDescriptorFiles(ServiceLocator habitat, String containerType) { List<ConfigurationDeploymentDescriptorFile> confDDFiles = new ArrayList<ConfigurationDeploymentDescriptorFile>(); for (ServiceHandle<?> serviceHandle : habitat.getAllServiceHandles(ConfigurationDeploymentDescriptorFileFor.class)) { ActiveDescriptor<?> descriptor = serviceHandle.getActiveDescriptor(); String indexedType = descriptor.getMetadata().get(ConfigurationDeploymentDescriptorFileFor.DESCRIPTOR_FOR).get(0); if(indexedType.equals(containerType)) { ConfigurationDeploymentDescriptorFile confDD = (ConfigurationDeploymentDescriptorFile) serviceHandle.getService(); confDDFiles.add(confDD); } } return confDDFiles; }
/** * Get list of all supplemental commands, map it to various commands and cache this list */ private synchronized Map<String, List<ServiceHandle<?>>> getSupplementalCommandsList() { if (supplementalCommandsMap != null) return supplementalCommandsMap; supplementalCommandsMap = new ConcurrentHashMap<String, List<ServiceHandle<?>>>(); List<ServiceHandle<Supplemental>> supplementals = habitat.getAllServiceHandles(Supplemental.class); for (ServiceHandle<Supplemental> handle : supplementals) { ActiveDescriptor<Supplemental> inh = handle.getActiveDescriptor(); String commandName = getOne("target", inh.getMetadata()); if(supplementalCommandsMap.containsKey(commandName)) { supplementalCommandsMap.get(commandName).add(handle); } else { ArrayList<ServiceHandle<?>> inhList = new ArrayList<ServiceHandle<?>>(); inhList.add(handle); supplementalCommandsMap.put(commandName, inhList); } } return supplementalCommandsMap; }
private void dumpInhabitantsImplementingContractPattern(String pattern, StringBuilder sb) { sb.append("\n*********** List of all services for contract named like " + contract + " **************\n"); List<ActiveDescriptor<?>> allDescriptors = serviceLocator.getDescriptors(BuilderHelper.allFilter()); HashSet<String> allContracts = new HashSet<String>(); for (ActiveDescriptor<?> aDescriptor : allDescriptors) { allContracts.addAll(aDescriptor.getAdvertisedContracts()); } Iterator<String> it = allContracts.iterator(); while (it.hasNext()) { String cn = it.next(); if (cn.toLowerCase(Locale.ENGLISH).indexOf(pattern.toLowerCase(Locale.ENGLISH)) < 0) continue; sb.append("\n-----------------------------\n"); for ( ActiveDescriptor<?> descriptor : serviceLocator.getDescriptors(BuilderHelper.createContractFilter(cn))) { sb.append("Inhabitant-Metadata: " + descriptor.getMetadata()); sb.append("\n"); boolean isStarted = Boolean.parseBoolean(started); if (isStarted) { ServiceHandle<?> handle = serviceLocator.getServiceHandle(descriptor); sb.append((handle.isActive() ? " started" : " not started")); } } } }
if (desc == null) continue; List<String> resourceImpls = desc.getMetadata().get(METADATA_KEY); if (resourceImpls == null || resourceImpls.isEmpty()) continue; String resourceImpl = resourceImpls.get(0);
/** * @param in * If provided, this is used to record the source location where this DOM object is loaded from. * Otherwise this can be null. */ public Dom(ServiceLocator habitat, DomDocument document, Dom parent, ConfigModel model, XMLStreamReader in) { super(createDescriptor( model.targetTypeName, model.injector.getLoader(), model.injector.getMetadata())); this.habitat = habitat; if (in!=null) { this.location = new LocationImpl(in.getLocation()); } else { this.location=null; } this.model = model; this.document = document; this.parent = parent; // TODO: This code is disabled as it does fail from time to time when assertions are enabled // assert (parent==null || parent.document==document); // all the nodes in the tree must belong to the same document }
/** * @param in * If provided, this is used to record the source location where this DOM object is loaded from. * Otherwise this can be null. */ public Dom(ServiceLocator habitat, DomDocument document, Dom parent, ConfigModel model, XMLStreamReader in) { super(createDescriptor( model.targetTypeName, model.injector.getLoader(), model.injector.getMetadata())); this.habitat = habitat; if (in!=null) { this.location = new LocationImpl(in.getLocation()); } else { this.location=null; } this.model = model; this.document = document; this.parent = parent; // TODO: This code is disabled as it does fail from time to time when assertions are enabled // assert (parent==null || parent.document==document); // all the nodes in the tree must belong to the same document }
List<String> prefixes = inhabitant.getActiveDescriptor().getMetadata().get(GlassfishNamingManager.NAMESPACE_METADATA_KEY); if (prefixes == null) continue;
descriptor.isProxyForSameScope(), descriptor.getClassAnalysisName(), descriptor.getMetadata()); this.locator = locator; this.descriptor = descriptor;
descriptor.isProxyForSameScope(), descriptor.getClassAnalysisName(), descriptor.getMetadata()); this.locator = locator; this.descriptor = descriptor;
descriptor.isProxyForSameScope(), descriptor.getClassAnalysisName(), descriptor.getMetadata()); this.locator = locator; this.descriptor = descriptor;
descriptor.isProxyForSameScope(), descriptor.getClassAnalysisName(), descriptor.getMetadata()); this.locator = locator; this.descriptor = descriptor;