1 26 27 package org.objectweb.corba.trace.PI; 28 29 30 36 public class ServerRequestInfoReader extends RequestInfoReader { 38 39 42 final static private short logLevelServerStart = 2; 43 44 48 public ServerRequestInfoReader(short logLevel) { 49 super(logLevel); 50 } 51 52 55 60 public String displayServerRequestInfoMonolog(org.omg.PortableInterceptor.ServerRequestInfo info) { 61 return displayServerRequestInfoMonolog(info,true); 62 } 63 64 70 public String displayServerRequestInfoMonolog(org.omg.PortableInterceptor.ServerRequestInfo info, boolean withException) { 71 String res = ""; 72 res = res + displayRequestInfo(info, logLevel) ; 73 if (withException) res = res + displayException(info); 74 if (logLevel > logLevelServerStart) { 75 res = res + displayObjectID(info) + displayAdapterID(info); 76 } 77 res = res + displayMostDerivedInterface(info); 78 79 return res; 80 } 81 82 85 86 91 protected String displayObjectID(org.omg.PortableInterceptor.ServerRequestInfo info) { 92 String res = ""; 93 try { 94 byte[] octets = info.object_id(); 95 res = res + "object id = "; 96 for (int i = 0; i < octets.length; i++) 97 res = res + getOctet(octets[i]); 98 } catch (org.omg.CORBA.BAD_INV_ORDER ex) { 99 } 101 return res; 102 } 103 104 109 protected String displayAdapterID(org.omg.PortableInterceptor.ServerRequestInfo info) { 110 String res = ""; 111 try { 112 byte[] octets = info.adapter_id(); 113 res = res + "adapter id = "; 114 for (int i = 0; i < octets.length; i++) 115 res = res + getOctet(octets[i]); 116 } catch (org.omg.CORBA.BAD_INV_ORDER ex) { 117 } 119 return res; 120 } 121 122 127 protected String displayMostDerivedInterface(org.omg.PortableInterceptor.ServerRequestInfo info) { 128 String res = ""; 129 try { 130 String tmdi = info.target_most_derived_interface(); 131 res = res + "\ttarget most derived interface = " + tmdi; 132 } catch (org.omg.CORBA.BAD_INV_ORDER ex) { 133 } 135 return res; 136 } 137 138 141 142 protected String displayMore(org.omg.PortableInterceptor.RequestInfo info) { 143 return displayServerRequestInfoMonolog((org.omg.PortableInterceptor.ServerRequestInfo ) info); 144 } 145 146 protected String getLabelException() { 147 return "sending exception = "; 148 } 149 150 protected org.omg.CORBA.Any requestOpException(org.omg.PortableInterceptor.RequestInfo info) { 151 return ((org.omg.PortableInterceptor.ServerRequestInfo ) info).sending_exception(); 152 } 153 } | Popular Tags |