private static DescriptorImpl createDescriptor( String typeName, HK2Loader cl, Map<String, List<String>> metadata) { DescriptorImpl retVal = new DescriptorImpl(); retVal.setImplementation(typeName); retVal.addAdvertisedContract(typeName); retVal.setLoader(cl); retVal.setMetadata(metadata); return retVal; }
/** * Makes a deep copy of the incoming descriptor * * @param copyMe The descriptor to copy * @return A new descriptor with all fields copied */ public static DescriptorImpl deepCopyDescriptor(Descriptor copyMe) { return new DescriptorImpl(copyMe); }
/** * Makes a deep copy of the incoming descriptor * * @param copyMe The descriptor to copy * @return A new descriptor with all fields copied */ public static DescriptorImpl deepCopyDescriptor(Descriptor copyMe) { return new DescriptorImpl(copyMe); }
/** * Makes a deep copy of the incoming descriptor * * @param copyMe The descriptor to copy * @return A new descriptor with all fields copied */ public static DescriptorImpl deepCopyDescriptor(Descriptor copyMe) { return new DescriptorImpl(copyMe); }
@Override public DescriptorImpl build() throws IllegalArgumentException { return new DescriptorImpl(contracts, name, scope, implementation, metadatas, qualifiers, DescriptorType.CLASS, visibility, loader, rank, proxy, proxyForSameScope, analysisName, null, null); }
@Override public DescriptorImpl build() throws IllegalArgumentException { return new DescriptorImpl(contracts, name, scope, implementation, metadatas, qualifiers, DescriptorType.CLASS, visibility, loader, rank, proxy, proxyForSameScope, analysisName, null, null); }
@Override public DescriptorImpl build() throws IllegalArgumentException { return new DescriptorImpl(contracts, name, scope, implementation, metadatas, qualifiers, DescriptorType.CLASS, visibility, loader, rank, proxy, proxyForSameScope, analysisName, null, null); }
@Override public DescriptorImpl build() throws IllegalArgumentException { return new DescriptorImpl(contracts, name, scope, implementation, metadatas, qualifiers, DescriptorType.CLASS, visibility, loader, rank, proxy, proxyForSameScope, analysisName, null, null); }
/** * Makes a deep copy of the incoming descriptor * * @param copyMe The descriptor to copy * @return A new descriptor with all fields copied */ public static DescriptorImpl deepCopyDescriptor(Descriptor copyMe) { return new DescriptorImpl(copyMe); }
final Descriptor filterDescriptor = (deepCopy) ? new DescriptorImpl(descriptorImpl) : descriptorImpl ; return new IndexedFilter() {
@Override public FactoryDescriptors buildFactory(String factoryScope) throws IllegalArgumentException { Set<String> factoryContracts = new HashSet<String>(); factoryContracts.add(implementation); factoryContracts.add(Factory.class.getName()); Set<String> factoryQualifiers = Collections.emptySet(); Map<String, List<String>> factoryMetadata = Collections.emptyMap(); DescriptorImpl asService = new DescriptorImpl(factoryContracts, null, factoryScope, implementation, factoryMetadata, factoryQualifiers, DescriptorType.CLASS, DescriptorVisibility.NORMAL, loader, rank, null, null, analysisName, null, null); // We want to remove the impl class from the contracts in this case Set<String> serviceContracts = new HashSet<String>(contracts); if (implementation != null) serviceContracts.remove(implementation); DescriptorImpl asFactory = new DescriptorImpl(serviceContracts, name, scope, implementation, metadatas, qualifiers, DescriptorType.PROVIDE_METHOD, visibility, loader, rank, proxy, proxyForSameScope, null, null, null); return new FactoryDescriptorsImpl(asService, asFactory); }
@Override public FactoryDescriptors buildFactory(String factoryScope) throws IllegalArgumentException { Set<String> factoryContracts = new HashSet<String>(); factoryContracts.add(implementation); factoryContracts.add(Factory.class.getName()); Set<String> factoryQualifiers = Collections.emptySet(); Map<String, List<String>> factoryMetadata = Collections.emptyMap(); DescriptorImpl asService = new DescriptorImpl(factoryContracts, null, factoryScope, implementation, factoryMetadata, factoryQualifiers, DescriptorType.CLASS, DescriptorVisibility.NORMAL, loader, rank, null, null, analysisName, null, null); // We want to remove the impl class from the contracts in this case Set<String> serviceContracts = new HashSet<String>(contracts); if (implementation != null) serviceContracts.remove(implementation); DescriptorImpl asFactory = new DescriptorImpl(serviceContracts, name, scope, implementation, metadatas, qualifiers, DescriptorType.PROVIDE_METHOD, visibility, loader, rank, proxy, proxyForSameScope, null, null, null); return new FactoryDescriptorsImpl(asService, asFactory); }
@Override public FactoryDescriptors buildFactory(String factoryScope) throws IllegalArgumentException { Set<String> factoryContracts = new HashSet<String>(); factoryContracts.add(implementation); factoryContracts.add(Factory.class.getName()); Set<String> factoryQualifiers = Collections.emptySet(); Map<String, List<String>> factoryMetadata = Collections.emptyMap(); DescriptorImpl asService = new DescriptorImpl(factoryContracts, null, factoryScope, implementation, factoryMetadata, factoryQualifiers, DescriptorType.CLASS, DescriptorVisibility.NORMAL, loader, rank, null, null, analysisName, null, null); // We want to remove the impl class from the contracts in this case Set<String> serviceContracts = new HashSet<String>(contracts); if (implementation != null) serviceContracts.remove(implementation); DescriptorImpl asFactory = new DescriptorImpl(serviceContracts, name, scope, implementation, metadatas, qualifiers, DescriptorType.PROVIDE_METHOD, visibility, loader, rank, proxy, proxyForSameScope, null, null, null); return new FactoryDescriptorsImpl(asService, asFactory); }
@Override public FactoryDescriptors buildFactory(String factoryScope) throws IllegalArgumentException { Set<String> factoryContracts = new HashSet<String>(); factoryContracts.add(implementation); factoryContracts.add(Factory.class.getName()); Set<String> factoryQualifiers = Collections.emptySet(); Map<String, List<String>> factoryMetadata = Collections.emptyMap(); DescriptorImpl asService = new DescriptorImpl(factoryContracts, null, factoryScope, implementation, factoryMetadata, factoryQualifiers, DescriptorType.CLASS, DescriptorVisibility.NORMAL, loader, rank, null, null, analysisName, null, null); // We want to remove the impl class from the contracts in this case Set<String> serviceContracts = new HashSet<String>(contracts); if (implementation != null) serviceContracts.remove(implementation); DescriptorImpl asFactory = new DescriptorImpl(serviceContracts, name, scope, implementation, metadatas, qualifiers, DescriptorType.PROVIDE_METHOD, visibility, loader, rank, proxy, proxyForSameScope, null, null, null); return new FactoryDescriptorsImpl(asService, asFactory); }
private void parseInHk2LocatorOrig(BufferedReader reader, Map<String, String> cliCommandNames) throws IOException { DescriptorImpl desc = new DescriptorImpl(); while (desc.readObject(reader)) { if (StringUtils.ok(desc.getName()) && desc.getAdvertisedContracts().contains(CLICommand.class.getName())) { cliCommandNames.put(desc.getName(), desc.getImplementation()); } } }
private static DescriptorImpl createDescriptor( String typeName, HK2Loader cl, Map<String, List<String>> metadata) { DescriptorImpl retVal = new DescriptorImpl(); retVal.setImplementation(typeName); retVal.addAdvertisedContract(typeName); retVal.setLoader(cl); retVal.setMetadata(metadata); return retVal; }
private static DescriptorImpl createDescriptor( String typeName, HK2Loader cl, Map<String, List<String>> metadata) { DescriptorImpl retVal = new DescriptorImpl(); retVal.setImplementation(typeName); retVal.addAdvertisedContract(typeName); retVal.setLoader(cl); retVal.setMetadata(metadata); return retVal; }
Descriptor addProvideMethod = new DescriptorImpl(provideMethod);
Descriptor addProvideMethod = new DescriptorImpl(provideMethod);
descriptors.add(new DescriptorImpl(d)); for (Descriptor descriptor : descriptors) { DescriptorImpl di = (descriptor instanceof DescriptorImpl) ? (DescriptorImpl) descriptor : new DescriptorImpl(descriptor) ;