MCPcopy Create free account
hub / github.com/belaban/JGroups / printProtocolSpec

Method printProtocolSpec

src/org/jgroups/stack/ProtocolStack.java:287–323  ·  view source on GitHub ↗

Prints the names of the protocols, from the bottom to top. If include_properties is true, the properties for each protocol will also be printed.

(boolean include_properties)

Source from the content-addressed store, hash-verified

285 * the properties for each protocol will also be printed.
286 */
287 public String printProtocolSpec(boolean include_properties) {
288 StringBuilder sb=new StringBuilder();
289 List<Protocol> protocols=getProtocols();
290
291 if(protocols == null || protocols.isEmpty()) return null;
292 boolean first_colon_printed=false;
293
294 Collections.reverse(protocols);
295 for(Protocol prot: protocols) {
296 String prot_name=prot.getClass().getName();
297 int index=prot_name.indexOf(Global.PREFIX);
298 if(index >= 0)
299 prot_name=prot_name.substring(Global.PREFIX.length());
300 if(first_colon_printed)
301 sb.append(":");
302 else
303 first_colon_printed=true;
304
305 sb.append(prot_name);
306 if(include_properties) {
307 Map<String,String> tmp=getProps(prot);
308 if(!tmp.isEmpty()) {
309 boolean printed=false;
310 sb.append("(");
311 for(Map.Entry<String,String> entry: tmp.entrySet()) {
312 if(printed)
313 sb.append(";");
314 else
315 printed=true;
316 sb.append(entry.getKey()).append("=").append(entry.getValue());
317 }
318 sb.append(")\n");
319 }
320 }
321 }
322 return sb.toString();
323 }
324
325 public String printProtocolSpecAsXML() {
326 StringBuilder sb=new StringBuilder();

Callers 3

printProtocolSpecMethod · 0.95
handleProbeMethod · 0.95
insertProtocolMethod · 0.95

Calls 10

getProtocolsMethod · 0.95
getPropsMethod · 0.95
indexOfMethod · 0.80
appendMethod · 0.80
getNameMethod · 0.65
lengthMethod · 0.65
entrySetMethod · 0.65
toStringMethod · 0.65
isEmptyMethod · 0.45
getValueMethod · 0.45

Tested by

no test coverage detected