/* */
/* 221 */ ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
/* 222 */ Thread.currentThread().setContextClassLoader(this.containerClassLoader);
/* */ try
/* */ {
/* 225 */ SkeletonStrategy op = (SkeletonStrategy)this.methodInvokerMap.get(opName);
/* 226 */ if (op == null)
/* */ {
/* 228 */ this.logger.debug("Unable to find opname '" + opName + "' valid operations:" + this.methodInvokerMap.keySet());
/* 229 */ throw new BAD_OPERATION(opName);
/* */ }
/* */ java.lang.Object id;
/* */ try
/* */ {
/* 235 */ id = ReferenceData.extractObjectId(this.poaCurrent.get_object_id());
/* 236 */ if ((this.traceEnabled) && (id != null)) {
/* 237 */ this.logger.trace(" id class is " + id.getClass().getName());
/* */ }
/* */ }
/* */ catch (Exception e)
/* */ {
/* 242 */ this.logger.error("Error getting EJBObject id", e);
/* 243 */ throw new UnknownException(e);
/* */ }
/* */
/* 247 */ ENCFactory.pushContextId(this.containerName);
/* */ org.omg.CORBA_2_3.portable.OutputStream out;
/* */ try
/* */ {
/* */ java.lang.Object retVal;
/* */ java.lang.Object retVal;
/* 254 */ if (opName.equals("_get_handle"))
/* */ {
/* 256 */ EJBObject obj = (EJBObject)PortableRemoteObject.narrow(_this_object(), EJBObject.class);
/* */
/* 258 */ retVal = new HandleImplIIOP(obj);
/* */ }
/* */ else
/* */ {
/* 262 */ Transaction tx = null;
/* 263 */ if (this.inboundTxCurrent != null)
/* 264 */ tx = this.inboundTxCurrent.getCurrentTransaction();
/* 265 */ SimplePrincipal principal = null;
/* 266 */ char[] password = null;
/* 267 */ if (this.sasCurrent != null)
/* */ {
/* 269 */ byte[] username = this.sasCurrent.get_incoming_username();
/* 270 */ byte[] credential = this.sasCurrent.get_incoming_password();
/* 271 */ String name = new String(username, "UTF-8");
/* 272 */ int domainIndex = name.indexOf('@');
/* 273 */ if (domainIndex > 0)
/* 274 */ name = name.substring(0, domainIndex);
/* 275 */ if (name.length() == 0)
/* */ {
/* 277 */ byte[] incomingName = this.sasCurrent.get_incoming_principal_name();
/* */
/* 279 */ if (incomingName.length > 0)
/* */ {
/* 281 */ name = new String(incomingName, "UTF-8");
/* 282 */ domainIndex = name.indexOf('@');
/* 283 */ if (domainIndex > 0)
/* 284 */ name = name.substring(0, domainIndex);
/* 285 */ principal = new SimplePrincipal(name);
/* */
/* 288 */ password = name.toCharArray();
/* */ }
/* */ }
/* */ else
/* */ {
/* 293 */ principal = new SimplePrincipal(name);
/* 294 */ password = new String(credential, "UTF-8").toCharArray();
/* */ }
/* */ }
/* */
/* 298 */ java.lang.Object[] params = op.readParams((org.omg.CORBA_2_3.portable.InputStream)in);
/* */
/* 300 */ Invocation inv = new Invocation(id, op.getMethod(), params, tx, principal, password);
/* */
/* 306 */ inv.setValue(InvocationKey.INVOKER_PROXY_BINDING, "iiop", PayloadKey.AS_IS);
/* */
/* 309 */ inv.setType(InvocationType.REMOTE);
/* 310 */ retVal = this.mbeanServer.invoke(this.containerName, "invoke", new java.lang.Object[] { inv }, Invocation.INVOKE_SIGNATURE);
/* */ }
/* */
/* 316 */ out = (org.omg.CORBA_2_3.portable.OutputStream)handler.createReply();
/* */
/* 318 */ if (op.isNonVoid())
/* */ {
/* 320 */ op.writeRetval(out, retVal);
/* */ }
/* */ }
/* */ catch (Exception e)
/* */ {
/* 325 */ if (this.traceEnabled)
/* */ {
/* 327 */ this.logger.trace("Exception in EJBObject invocation", e);
/* */ }
/* 329 */ if ((e instanceof MBeanException))
/* */ {
/* 331 */ e = ((MBeanException)e).getTargetException();
/* */ }
/* 333 */ RmiIdlUtil.rethrowIfCorbaSystemException(e);
/* 334 */ out = (org.omg.CORBA_2_3.portable.OutputStream)handler.createExceptionReply();
/* */
/* 336 */ op.writeException(out, e);
/* */ }
/* 338 */ e = out;
/* */ return e;
/* */ }
/* */ finally