Sets up the protocol stack. Each ProtocolConfiguration has the protocol name and a map of attribute names and values (strings). Reflection is used to find the right fields (or setters) based on attribute names, and set them (by converting the attribute value to the proper object).
(List<ProtocolConfiguration> protocol_configs, ProtocolStack st)
| 50 | * and set them (by converting the attribute value to the proper object). |
| 51 | */ |
| 52 | public static Protocol setupProtocolStack(List<ProtocolConfiguration> protocol_configs, ProtocolStack st) throws Exception { |
| 53 | List<Protocol> protocols=createProtocolsAndInitializeAttrs(protocol_configs, st); |
| 54 | // Fixes NPE with concurrent channel creation when using a shared stack (https://issues.redhat.com/browse/JGRP-1488) |
| 55 | Protocol top_protocol=protocols.get(protocols.size() - 1); |
| 56 | top_protocol.setUpProtocol(st); |
| 57 | return connectProtocols(protocols); |
| 58 | } |
| 59 | |
| 60 | |
| 61 | public static Protocol createProtocol(String prot_spec, ProtocolStack stack) throws Exception { |
no test coverage detected