本文整理匯總了Java中org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry類的典型用法代碼示例。如果您正苦於以下問題:Java ModuleMXBeanEntry類的具體用法?Java ModuleMXBeanEntry怎麽用?Java ModuleMXBeanEntry使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ModuleMXBeanEntry類屬於org.opendaylight.controller.config.yangjmxgenerator包,在下文中一共展示了ModuleMXBeanEntry類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: transformMbeToModuleConfigs
import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry; //導入依賴的package包/類
public Map<String/* Namespace from yang file */,
Map<String /* Name of module entry from yang file */,
ModuleConfig>> transformMbeToModuleConfigs(
final BeanReader reader,
final Map<String/* Namespace from yang file */,
Map<String /* Name of module entry from yang file */, ModuleMXBeanEntry>> mbeanentries) {
Map<String, Map<String, ModuleConfig>> namespaceToModuleNameToModuleConfig = new HashMap<>();
for (Map.Entry<String, Map<String, ModuleMXBeanEntry>> namespaceToModuleToMbe : mbeanentries.entrySet()) {
for (Map.Entry<String, ModuleMXBeanEntry> moduleNameToMbe : namespaceToModuleToMbe.getValue().entrySet()) {
String moduleName = moduleNameToMbe.getKey();
ModuleMXBeanEntry moduleMXBeanEntry = moduleNameToMbe.getValue();
ModuleConfig moduleConfig = new ModuleConfig(moduleName, new InstanceConfig(reader,
moduleMXBeanEntry.getAttributes(), moduleMXBeanEntry.getNullableDummyContainerName()));
Map<String, ModuleConfig> moduleNameToModuleConfig = namespaceToModuleNameToModuleConfig
.computeIfAbsent(namespaceToModuleToMbe.getKey(), k -> new HashMap<>());
moduleNameToModuleConfig.put(moduleName, moduleConfig);
}
}
return namespaceToModuleNameToModuleConfig;
}
示例2: toGeneratedObject
import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry; //導入依賴的package包/類
public GeneratedObject toGeneratedObject(ModuleMXBeanEntry mbe, Optional<String> copyright) {
FullyQualifiedName absFactoryFQN = new FullyQualifiedName(mbe.getPackageName(), mbe.getAbstractFactoryName());
FullyQualifiedName moduleFQN = new FullyQualifiedName(mbe.getPackageName(), mbe.getStubModuleName());
Optional<String> classJavaDoc = Optional.fromNullable(mbe.getNullableDescription());
AbstractFactoryTemplate abstractFactoryTemplate = TemplateFactory.abstractFactoryTemplateFromMbe(mbe);
Optional<String> header = abstractFactoryTemplate.getHeaderString();
List<FullyQualifiedName> providedServices = new ArrayList<>();
for(String providedService: mbe.getProvidedServices().keySet()) {
providedServices.add(FullyQualifiedName.fromString(providedService));
}
return toGeneratedObject(absFactoryFQN, copyright,
header, classJavaDoc, mbe.getYangModuleQName(),
mbe.getGloballyUniqueName(),
providedServices,
moduleFQN,
abstractFactoryTemplate.getFields());
}
示例3: tOsFromMbe
import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry; //導入依賴的package包/類
public static Map<String, GeneralClassTemplate> tOsFromMbe(
final ModuleMXBeanEntry mbe) {
final Map<String, GeneralClassTemplate> retVal = Maps.newHashMap();
final TOAttributesProcessor processor = new TOAttributesProcessor();
processor.processAttributes(mbe.getAttributes());
for (final org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.TemplateFactory.TOAttributesProcessor.TOInternal to : processor
.getTOs()) {
final List<Constructor> constructors = Lists.newArrayList();
constructors.add(new Constructor(to.getName(), "super();"));
final Header header = getHeaderFromEntry(mbe);
retVal.put(
to.getType(),
new GeneralClassTemplate(header, mbe.getPackageName(), to
.getName(), Collections.<String> emptyList(),
Collections.<String> emptyList(), to.getFields(),
to.getMethods(), false, false, constructors));
}
return retVal;
}
示例4: mockMbe
import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry; //導入依賴的package包/類
public static ModuleMXBeanEntry mockMbe(final String packageName) {
final ModuleMXBeanEntry mbe = mock(ModuleMXBeanEntry.class);
final Map<String, AttributeIfc> a = Maps.newHashMap();
final JavaAttribute attr = mockJavaAttr();
a.put("attr1", attr);
doReturn(a).when(mbe).getAttributes();
doReturn(packageName).when(mbe).getPackageName();
doReturn(Collections.emptyMap()).when(mbe).getProvidedServices();
doReturn("yang-module").when(mbe).getYangModuleName();
doReturn("local").when(mbe).getYangModuleLocalname();
doReturn("AbstractType").when(mbe).getAbstractFactoryName();
doReturn("Module").when(mbe).getStubModuleName();
doReturn("fullA").when(mbe).getFullyQualifiedName(anyString());
doReturn("uniq").when(mbe).getGloballyUniqueName();
return mbe;
}
示例5: test
import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry; //導入依賴的package包/類
@Test
public void test() throws Exception {
FullyQualifiedName fqn = new FullyQualifiedName("foo.bar", "Baz");
FullyQualifiedName abstractFQN = new FullyQualifiedName("foo.bar", "AbstractBaz");
String nullableDescription = null;
ModuleMXBeanEntry moduleMXBeanEntry = mockModuleMXBeanEntry(fqn, abstractFQN, nullableDescription);
Optional<String> copyright = Optional.absent();
Optional<String> header = Optional.absent();
GeneratedObject go = new ConcreteModuleGeneratedObjectFactory().toGeneratedObject(moduleMXBeanEntry, copyright, header);
Entry<FullyQualifiedName, File> entry = go.persist(generatorOutputPath).get();
File dstFile = entry.getValue();
Node c = parse(dstFile);
assertEquals(fqn.getPackageName(), ((ASTCompilationUnit) c).getPackageDeclaration().getPackageNameImage());
assertEquals(fqn.getTypeName(), c.getFirstDescendantOfType(ASTClassOrInterfaceDeclaration.class).getImage());
assertHasMethodNamed(c, "customValidation");
assertHasMethodNamed(c, "createInstance");
}
示例6: getModuleMXBeanEntryMap
import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry; //導入依賴的package包/類
@Deprecated
@Override
public Map<String, Map<String, ModuleMXBeanEntry>> getModuleMXBeanEntryMap() {
Map<String, Map<String, ModuleMXBeanEntry>> ret;
YangStoreSnapshot snapshot;
do {
snapshot = this.snap;
ret = snapshot.getModuleMXBeanEntryMap();
} while (!snapshot.equals(this.snap));
return ret;
}
示例7: getQNamesToIdentitiesToModuleMXBeanEntries
import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry; //導入依賴的package包/類
@Override
public Map<QName, Map<String, ModuleMXBeanEntry>> getQNamesToIdentitiesToModuleMXBeanEntries() {
Map<QName, Map<String, ModuleMXBeanEntry>> ret;
YangStoreSnapshot snapshot;
do {
snapshot = this.snap;
ret = snapshot.getQNamesToIdentitiesToModuleMXBeanEntries();
} while (!snapshot.equals(this.snap));
return ret;
}
示例8: mapRpcs
import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry; //導入依賴的package包/類
public Rpcs mapRpcs() {
final Map<String, Map<String, ModuleRpcs>> map = new HashMap<>();
for (final Map.Entry<String, Map<String, ModuleMXBeanEntry>> namespaceToModuleEntry : yangStoreService
.getModuleMXBeanEntryMap().entrySet()) {
Map<String, ModuleRpcs> namespaceToModules = map.computeIfAbsent(namespaceToModuleEntry.getKey(),
k -> new HashMap<>());
for (final Map.Entry<String, ModuleMXBeanEntry> moduleEntry : namespaceToModuleEntry.getValue()
.entrySet()) {
ModuleRpcs rpcMapping = namespaceToModules.computeIfAbsent(moduleEntry.getKey(),
k -> new ModuleRpcs(yangStoreService.getEnumResolver()));
final ModuleMXBeanEntry entry = moduleEntry.getValue();
for (final RuntimeBeanEntry runtimeEntry : entry.getRuntimeBeans()) {
rpcMapping.addNameMapping(runtimeEntry);
for (final RuntimeBeanEntry.Rpc rpc : runtimeEntry.getRpcs()) {
rpcMapping.addRpc(runtimeEntry, rpc);
}
}
}
}
return new Rpcs(map);
}
示例9: createModuleRuntimes
import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry; //導入依賴的package包/類
private Map<String, Map<String, ModuleRuntime>> createModuleRuntimes(
final ConfigRegistryClient configRegistryClient,
final Map<String, Map<String, ModuleMXBeanEntry>> mbeanentries) {
Map<String, Map<String, ModuleRuntime>> retVal = new HashMap<>();
for (Map.Entry<String, Map<String, ModuleMXBeanEntry>> namespaceToModuleEntry : mbeanentries.entrySet()) {
Map<String, ModuleRuntime> innerMap = new HashMap<>();
Map<String, ModuleMXBeanEntry> entriesFromNamespace = namespaceToModuleEntry.getValue();
for (Map.Entry<String, ModuleMXBeanEntry> moduleToMXEntry : entriesFromNamespace.entrySet()) {
ModuleMXBeanEntry mbe = moduleToMXEntry.getValue();
Map<RuntimeBeanEntry, InstanceConfig> cache = new HashMap<>();
RuntimeBeanEntry root = null;
for (RuntimeBeanEntry rbe : mbe.getRuntimeBeans()) {
cache.put(rbe, new InstanceConfig(configRegistryClient, rbe.getYangPropertiesToTypesMap(),
mbe.getNullableDummyContainerName()));
if (rbe.isRoot()) {
root = rbe;
}
}
if (root == null) {
continue;
}
InstanceRuntime rootInstanceRuntime = createInstanceRuntime(root, cache);
ModuleRuntime moduleRuntime = new ModuleRuntime(rootInstanceRuntime);
innerMap.put(moduleToMXEntry.getKey(), moduleRuntime);
}
retVal.put(namespaceToModuleEntry.getKey(), innerMap);
}
return retVal;
}
示例10: toGeneratedObject
import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry; //導入依賴的package包/類
public GeneratedObject toGeneratedObject(ModuleMXBeanEntry mbe, Optional<String> copyright) {
FullyQualifiedName abstractFQN = new FullyQualifiedName(mbe.getPackageName(), mbe.getAbstractModuleName());
Optional<String> classJavaDoc = Optional.fromNullable(mbe.getNullableDescription());
AbstractModuleTemplate abstractModuleTemplate = TemplateFactory.abstractModuleTemplateFromMbe(mbe);
Optional<String> header = abstractModuleTemplate.getHeaderString();
List<FullyQualifiedName> implementedInterfaces =
Lists.transform(abstractModuleTemplate.getTypeDeclaration().getImplemented(),
FullyQualifiedName::fromString);
Optional<FullyQualifiedName> extended =
Optional.fromNullable(
Iterables.getFirst(
Collections2.transform(abstractModuleTemplate.getTypeDeclaration().getExtended(),
FullyQualifiedName::fromString), null));
Optional<FullyQualifiedName> maybeRegistratorType;
if (abstractModuleTemplate.isRuntime()) {
maybeRegistratorType = Optional.of(FullyQualifiedName.fromString(abstractModuleTemplate.getRegistratorType()));
} else {
maybeRegistratorType = Optional.absent();
}
return toGeneratedObject(abstractFQN, copyright, header, classJavaDoc, extended, implementedInterfaces,
abstractModuleTemplate.getModuleFields(), maybeRegistratorType, abstractModuleTemplate.getMethods(),
mbe.getYangModuleQName());
}
示例11: abstractFactoryTemplateFromMbe
import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry; //導入依賴的package包/類
public static AbstractFactoryTemplate abstractFactoryTemplateFromMbe(
final ModuleMXBeanEntry mbe) {
final AbstractFactoryAttributesProcessor attrProcessor = new AbstractFactoryAttributesProcessor();
attrProcessor.processAttributes(mbe.getAttributes());
return new AbstractFactoryTemplate(getHeaderFromEntry(mbe),
mbe.getPackageName(), mbe.getAbstractFactoryName(),
attrProcessor.getFields()
);
}
示例12: stubFactoryTemplateFromMbe
import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry; //導入依賴的package包/類
public static StubFactoryTemplate stubFactoryTemplateFromMbe(
final ModuleMXBeanEntry mbe) {
return new StubFactoryTemplate(getHeaderFromEntry(mbe),
mbe.getPackageName(), mbe.getStubFactoryName(),
mbe.getFullyQualifiedName(mbe.getAbstractFactoryName())
);
}
示例13: mXBeanInterfaceTemplateFromMbe
import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry; //導入依賴的package包/類
public static GeneralInterfaceTemplate mXBeanInterfaceTemplateFromMbe(
final ModuleMXBeanEntry mbe) {
final MXBeanInterfaceAttributesProcessor attrProcessor = new MXBeanInterfaceAttributesProcessor();
attrProcessor.processAttributes(mbe.getAttributes());
final GeneralInterfaceTemplate ifcTemplate = new GeneralInterfaceTemplate(
getHeaderFromEntry(mbe), mbe.getPackageName(),
mbe.getMXBeanInterfaceName(), Lists.<String> newArrayList(),
attrProcessor.getMethods());
ifcTemplate.setJavadoc(mbe.getNullableDescription());
return ifcTemplate;
}
示例14: test
import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry; //導入依賴的package包/類
@Test
public void test() {
final ModuleMXBeanEntry mbe = mockMbe("package");
final AbstractFactoryTemplate template = TemplateFactory
.abstractFactoryTemplateFromMbe(mbe);
assertNotNull(template);
}
示例15: test
import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry; //導入依賴的package包/類
@Test
public void test() throws IOException {
Map<QName,ServiceInterfaceEntry> serviceInterfaceEntryMap = loadThreadsServiceInterfaceEntries("packages.sis");
Map<String, ModuleMXBeanEntry> namesToMBEs = loadThreadsJava(serviceInterfaceEntryMap, "packages.pack2");
ModuleMXBeanEntry dynamicThreadPool = namesToMBEs.get(THREADPOOL_DYNAMIC_MXB_NAME);
parseGeneratedFile(dynamicThreadPool);
}