@Override public MetaValue createMetaValue(MetaType metaType, Map<String, ProtocolStackConfigInfo> object) { Map<String, MetaValue> result = new HashMap<String, MetaValue>(); for (Map.Entry<String, ProtocolStackConfigInfo> entry : object.entrySet()) { ProtocolStackConfigInfo info = entry.getValue(); Map<String, MetaValue> stackValue = new HashMap<String, MetaValue>(); stackValue.put("name", SimpleValueSupport.wrap(info.getName())); stackValue.put("description", SimpleValueSupport.wrap(info.getDescription())); ProtocolData[] data = info.getConfiguration(); stackValue.put("configuration", CONFIG_MAPPER.createMetaValue(CONFIG_MAPPER.getMetaType(), data)); result.put(entry.getKey(), new CompositeValueSupport(TYPE, stackValue)); } return new MapCompositeValueSupport(result, TYPE); }
/** * {@inheritDoc} */ @Override public String getConfig(String stack_name) throws Exception { ProtocolStackConfigInfo cfg = stacks.get(stack_name); if (cfg == null) throw new Exception("stack \"" + stack_name + "\" not found in " + stacks.keySet()); return cfg.getProtocolStackString(); }
result.put(st_name, new ProtocolStackConfigInfo(st_name, stack_descr, protocolData));
ProtocolData[] protocols = config.getConfiguration(); JChannel channel = initializeChannel(protocols, stack_name, forceSingletonStack);
result.put(stack, new ProtocolStackConfigInfo(name, description, protocolData));
/** * {@inheritDoc} */ @Override public String getMultiplexerConfig() { StringBuilder sb = new StringBuilder(); for (Map.Entry<String, ProtocolStackConfigInfo> entry : stacks.entrySet()) { sb.append(entry.getKey()).append(": ").append(entry.getValue().getProtocolStackString()).append("\n"); } return sb.toString(); }