@Override public void receive_exception(ClientRequestInfo ri) throws ForwardRequest { try { ServiceContext sc = ri.get_reply_service_context(SAS_CONTEXT_ID); Any msg = codec.decode_value(sc.context_data, SASContextBodyHelper.type()); SASContextBody contextBody = SASContextBodyHelper.extract(msg); // At this point contextBody may contain either a CompleteEstablishContext message or a ContextError message. // Neither message requires any treatment. We decoded the context body just to check that it contains // a well-formed message. IIOPLogger.ROOT_LOGGER.tracef("receive_exception: got SAS reply, type %d", contextBody.discriminator()); } catch (BAD_PARAM e) { // no service context with sasContextId: do nothing. } catch (FormatMismatch | TypeMismatch e) { throw IIOPLogger.ROOT_LOGGER.errorParsingSASReply(e, 0, CompletionStatus.COMPLETED_MAYBE); } }
Any any = ORB.init().create_any(); SASContextBodyHelper.insert(any, contextBody); ServiceContext sc = new ServiceContext(sasContextId, codec.encode_value(any)); ri.add_request_service_context(sc, true /*replace existing context*/);
TransactionalObject ptr = TransactionalObjectHelper.narrow(request_info.target()); throw new BAD_PARAM(); Any localData = request_info.get_slot(_localSlot); String threadId = null; boolean problem = false; if ( (localData != null) && (localData.type().kind().value() != TCKind._tk_null) ) if ( (threadId = localData.extract_string()) == null ) throw new UNKNOWN(jtsLogger.i18NLogger.get_orbspecific_jacorb_interceptors_context_invalidparam()); stringRef = ORBManager.getORB().orb().object_to_string(theCoordinator); throw new TRANSACTION_REQUIRED(); else stringRef = null; Any data = ORBManager.getORB().orb().create_any(); data.insert_string(stringRef); byte[] octets = _codec.encode_value(data); ServiceContext service_context = new ServiceContext(OTSManager.serviceId, octets); request_info.add_request_service_context(service_context, true);
(com.arjuna.ats.jts.logging.FacilityCode.FAC_OTS | com.arjuna.ats.jts.logging.FacilityCode.FAC_INTERCEPTOR), "InterpositionClientRequestInterceptorImpl::send_request ( "+request_info.operation()+" )"); TransactionalObject ptr = TransactionalObjectHelper.narrow(request_info.target()); throw new BAD_PARAM(); Any localData = request_info.get_slot(_localSlot); String threadId = null; boolean problem = false; if ( localData != null && (localData.type().kind().value() != TCKind._tk_null) ) if ( (threadId = localData.extract_string()) == null ) throw new UNKNOWN(jtsLogger.logMesg.getString("com.arjuna.ats.internal.jts.orbspecific.jacorb.interceptors.interposition.invalidparam")); throw new TRANSACTION_REQUIRED(); byte[] octets = _codec.encode_value(data); ServiceContext service_context = new ServiceContext(OTSManager.serviceId, octets); request_info.add_request_service_context(service_context, true);
public void establish_components(IORInfo info) { try { // Invocation Policy = EITHER Any any = ORB.init().create_any(); any.insert_short(EITHER); byte[] taggedComponentData = codec.encode_value(any); info.add_ior_component(new TaggedComponent(TAG_INV_POLICY, taggedComponentData)); // OTS Policy = ADAPTS any = ORB.init().create_any(); any.insert_short(ADAPTS); taggedComponentData = codec.encode_value(any); info.add_ior_component(new TaggedComponent(TAG_OTS_POLICY, taggedComponentData)); } catch (InvalidTypeForEncoding e) { throw IIOPLogger.ROOT_LOGGER.errorEncodingContext(e); } } }
Any any = ORB.init().create_any(); InitialContextTokenHelper.insert(any, authToken); try { out = codec.encode_value(any); } catch (Exception e) { return new byte[0];
throw new BAD_PARAM(); Any receivedData = _codec.decode_value(serviceContext.context_data, ORBManager.getORB().orb().get_primitive_tc(TCKind.tk_string)); throw new TRANSACTION_REQUIRED(); ex.printStackTrace();
otsComp = ri.get_effective_component(TAG_OTS_POLICY.value); } catch (BAD_PARAM e) { } else { TypeCode typeCode = txOrb.get_primitive_tc(TCKind.tk_short); Any any = null; try { any = this.codec.decode_value(otsComp.component_data, typeCode); } catch (TypeMismatch e) { throw new INTERNAL(); if (!isTxAssociated) { // no tx context if (otsPolicyValue == REQUIRES.value && this.checkPolicy) { throw new TRANSACTION_REQUIRED(); Any any = txOrb.create_any(); PropagationContextHelper.insert(any, hctx.value); byte[] ctxData = null; try { ctxData = this.codec.encode_value(any); } catch (InvalidTypeForEncoding e) { throw new INTERNAL(); ServiceContext svc = new ServiceContext(TransactionServiceId, ctxData); ri.add_request_service_context(svc, false);
if( ri.response_expected() ) System.out.println("request: call to op " + ri.operation()); ri.effective_target(). hashCode() << 32 | ((myTraceId & 0xffff) << 16) | Any any = ri.get_slot(slot_id); if (any.type().kind().value() != TCKind._tk_null) RequestHelper.insert( ctx_any, current_request ); ServiceContext context = new ServiceContext ( TracingContextID.value, codec.encode( ctx_any ) ); timer.start( ri.request_id(), ri.target() );
svc = ri.get_reply_service_context(TransactionServiceId); } catch (BAD_PARAM e) { return; // do nothing (no tx service context in reply). _logger.log(Level.FINE," received_reply[" + ri.request_id() + "] : " + ri.operation() + ", ThreadName : " + Thread.currentThread().toString()); try { TypeCode typeCode = PropagationContextHelper.type(); any = this.codec.decode_value(svc.context_data, typeCode); } catch (TypeMismatch e) { throw new INTERNAL(0, CompletionStatus.COMPLETED_YES); env = txOrb.create_environment(); } else { env = ORB.init().create_environment();
svc = ri.get_reply_service_context(TransactionServiceId); } catch (BAD_PARAM e) { return; // do nothing (no tx service context in reply). env = txOrb.create_environment(); } else { env = ORB.init().create_environment(); Any any = ri.received_exception(); InputStream strm = any.create_input_stream(); String repId = ri.received_exception_id(); any = this.codec.decode_value(svc.context_data, typeCode); } catch (TypeMismatch e) { throw new INTERNAL(0, completionStatus);
/** * Add the propagation context to the outgoing message */ public void send_request( ClientRequestInfo ri ) throws ForwardRequest { try { org.omg.CORBA.Any any = ri.get_slot(slot_id); if (! (any.type().kind().value() == org.omg.CORBA.TCKind._tk_null)) { ServiceContext ctx = new ServiceContext(TransactionService.value, codec.encode(any)); if (logger.isDebugEnabled()) logger.debug("adding Transaction Service Context" + " to outgoing request"); ri.add_request_service_context(ctx, false); } } catch (Exception e) { } }
throw new BAD_PARAM(); Any receivedData = _codec.decode_value(serviceContext.context_data, PropagationContextHelper.type()); throw new TRANSACTION_REQUIRED();
Any any = orb.create_any(); CompoundSecMechListHelper.insert(any, csmList); byte[] b = codec.encode_value(any); tc = new TaggedComponent(TAG_CSI_SEC_MECH_LIST.value, b); } catch (InvalidTypeForEncoding e) {
/** * @see org.omg.PortableInterceptor.IORInterceptorOperations#establish_components(IORInfo) */ public void establish_components(IORInfo info) { String codeBase = (String) currentCodeBase.get(); if (codeBase != null) { logger.finer("registering " + codeBase + " for ORB"); // // Create encapsulation // Any any = ORB.init().create_any(); any.insert_string(codeBase); try { byte[] data = codec.encode(any); TaggedComponent component = new TaggedComponent( TAG_JAVA_CODEBASE.value, data); info.add_ior_component(component); } catch (InvalidTypeForEncoding e) { logger.log(Level.WARNING, "Failed to add java codebase to IOR" + e.getMessage(), e); } } }
/** * CDR encode a SAS Context body and then construct a service context * element. */ private ServiceContext createSvcContext(SASContextBody sasctxtbody, ORB orb) { ServiceContext sc = null; Any a = orb.create_any(); SASContextBodyHelper.insert(a, sasctxtbody); byte[] cdr_encoded_saselm = {}; try { cdr_encoded_saselm = codec.encode_value(a); } catch (Exception e) { _logger.log(Level.SEVERE,"iiop.encode_exception",e); } sc = new ServiceContext(); sc.context_id = SECURITY_ATTRIBUTE_SERVICE_ID; sc.context_data = cdr_encoded_saselm; return sc; }
@Override public void send_reply(ServerRequestInfo ri) { IIOPLogger.ROOT_LOGGER.tracef("send_reply: %s", ri.operation()); CurrentRequestInfo threadLocal = (CurrentRequestInfo) threadLocalData.get(); if (threadLocal.sasReply != null) { try { ServiceContext sc = new ServiceContext(sasContextId, codec.encode_value(threadLocal.sasReply)); ri.add_reply_service_context(sc, true); } catch (InvalidTypeForEncoding e) { throw IIOPLogger.ROOT_LOGGER.unexpectedException(e); } } }
org.omg.CORBA.Object effective_target = ri.effective_target(); try{ secctxt = secContextUtil.getSecurityContext(effective_target); Any SasAny = orb.create_any(); SASContextBodyHelper.insert(SasAny, sasctxbody); cdr_encoded_saselm = codec.encode_value(SasAny); } catch (Exception e) { _logger.log(Level.SEVERE,"iiop.encode_exception",e); ServiceContext sc = new ServiceContext(); sc.context_id = SECURITY_ATTRIBUTE_SERVICE_ID; sc.context_data = cdr_encoded_saselm; ri.add_request_service_context(sc, no_replace); if(_logger.isLoggable(Level.FINE)){ _logger.log(Level.FINE,"Added EstablishContext message to service context list");
Any any = codec.decode(authorities[i].name); atlasProfile = ATLASProfileHelper.extract(any); try org.omg.CORBA.Object obj = orb.string_to_object(locator); dispenser = AuthTokenDispenserHelper.narrow(obj);
Any any; try { any = codec.decode_value(encodedInitialContextToken, InitialContextTokenHelper.type()); } catch (Exception e) { return null;