public static void insert (org.omg.CORBA.Any a, org.omg.CosTransactions.PropagationContext that) { org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); a.type (type ()); write (out, that); a.read_value (out.create_input_stream (), type ()); }
public void _read(final org.omg.CORBA.portable.InputStream _in) { value = org.omg.CosTransactions.PropagationContextHelper.read(_in); } public void _write(final org.omg.CORBA.portable.OutputStream _out)
contexts.put(thread, control); (timeouts.containsKey(thread))? ((Integer) timeouts.get(thread)).intValue() : DEFAULT_TIMEOUT; PropagationContextHelper.insert(context_any, context); pi_current.set_slot(slot_id, context_any);
_out = handler.createReply(); org.omg.CosTransactions.StatusHelper.write(_out,get_top_level_status()); break; _out = handler.createReply(); _out.write_string(topLevelUid()); break; _out = handler.createReply(); org.omg.CosTransactions.RecoveryCoordinatorHelper.write(_out,register_resource(_arg0)); boolean _arg0=_input.read_boolean(); _out = handler.createReply(); commit(_arg0); _out = handler.createReply(); _out.write_boolean(is_related_transaction(_arg0)); break; _out = handler.createReply(); _out.write_boolean(is_ancestor_transaction(_arg0)); break; _out = handler.createReply(); org.omg.CosTransactions.PropagationContextHelper.write(_out,get_txcontext());
public org.omg.CORBA.portable.OutputStream _invoke(String method, org.omg.CORBA.portable.InputStream _input, org.omg.CORBA.portable.ResponseHandler handler) throws org.omg.CORBA.SystemException { org.omg.CORBA.portable.OutputStream _out = null; // do something // quick lookup of operation java.lang.Integer opsIndex = (java.lang.Integer)m_opsHash.get ( method ); if ( null == opsIndex ) throw new org.omg.CORBA.BAD_OPERATION(method + " not found"); switch ( opsIndex.intValue() ) { case 0: // create { int _arg0=_input.read_ulong(); _out = handler.createReply(); org.omg.CosTransactions.ControlHelper.write(_out,create(_arg0)); break; } case 1: // recreate { org.omg.CosTransactions.PropagationContext _arg0=org.omg.CosTransactions.PropagationContextHelper.read(_input); _out = handler.createReply(); org.omg.CosTransactions.ControlHelper.write(_out,recreate(_arg0)); break; } } return _out; }
public static org.omg.CORBA.TypeCode type () { if (_type == null) { _type = org.omg.CORBA.ORB.init().create_struct_tc(org.omg.CosTransactions.PropagationContextHelper.id(),"PropagationContext",new org.omg.CORBA.StructMember[]{new org.omg.CORBA.StructMember("timeout", org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.from_int(5)), null),new org.omg.CORBA.StructMember("current", org.omg.CosTransactions.TransIdentityHelper.type(), null),new org.omg.CORBA.StructMember("parents", org.omg.CORBA.ORB.init().create_sequence_tc(0, org.omg.CosTransactions.TransIdentityHelper.type()), null),new org.omg.CORBA.StructMember("implementation_specific_data", org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.from_int(11)), null)}); } return _type; }
public org.omg.CosTransactions.PropagationContext get_txcontext () throws org.omg.CosTransactions.Unavailable { org.omg.CORBA.portable.InputStream $in = null; try { org.omg.CORBA.portable.OutputStream $out = _request ("get_txcontext", true); $in = _invoke ($out); org.omg.CosTransactions.PropagationContext $result = org.omg.CosTransactions.PropagationContextHelper.read ($in); return $result; } catch (org.omg.CORBA.portable.ApplicationException $ex) { $in = $ex.getInputStream (); String _id = $ex.getId (); if (_id.equals ("IDL:omg.org/CosTransactions/Unavailable:1.0")) throw org.omg.CosTransactions.UnavailableHelper.read ($in); else throw new org.omg.CORBA.MARSHAL (_id); } catch (org.omg.CORBA.portable.RemarshalException $rm) { return get_txcontext (); } finally { _releaseReply ($in); } } // get_txcontext
org.omg.CosTransactions.PropagationContext _result = org.omg.CosTransactions.PropagationContextHelper.read(_is); return _result; catch( org.omg.CORBA.portable.ApplicationException _ax ) String _id = _ax.getId(); try throw org.omg.CosTransactions.UnavailableHelper.read(_ax.getInputStream()); _ax.getInputStream().close(); _os.close();
env = txOrb.create_environment(); } else { env = ORB.init().create_environment(); InputStream strm = any.create_input_stream(); String repId = ri.received_exception_id(); strm.read_string(); // read repId int minorCode = strm.read_long(); // read minorCode CompletionStatus.from_int(strm.read_long()); if (repId.indexOf("UNKNOWN") != -1) { // user exception ? if (minorCode == 1) { // read minorCode TypeCode typeCode = PropagationContextHelper.type(); any = this.codec.decode_value(svc.context_data, typeCode); } catch (TypeMismatch e) { throw new INTERNAL(0, completionStatus); PropagationContext ctx = PropagationContextHelper.extract(any);
org.omg.CosTransactions.PropagationContextHelper.write(_os,ctx); _is = _invoke(_os); org.omg.CosTransactions.Control _result = org.omg.CosTransactions.ControlHelper.read(_is); catch( org.omg.CORBA.portable.ApplicationException _ax ) String _id = _ax.getId(); try _ax.getInputStream().close(); _os.close();
public org.omg.CosTransactions.Control recreate (org.omg.CosTransactions.PropagationContext ctx) { org.omg.CORBA.portable.InputStream $in = null; try { org.omg.CORBA.portable.OutputStream $out = _request ("recreate", true); org.omg.CosTransactions.PropagationContextHelper.write ($out, ctx); $in = _invoke ($out); org.omg.CosTransactions.Control $result = org.omg.CosTransactions.ControlHelper.read ($in); return $result; } catch (org.omg.CORBA.portable.ApplicationException $ex) { $in = $ex.getInputStream (); String _id = $ex.getId (); throw new org.omg.CORBA.MARSHAL (_id); } catch (org.omg.CORBA.portable.RemarshalException $rm) { return recreate (ctx ); } finally { _releaseReply ($in); } } // recreate
TypeCode typeCode = PropagationContextHelper.type(); any = this.codec.decode_value(svc.context_data, typeCode); } catch (TypeMismatch e) { throw new INTERNAL(0, CompletionStatus.COMPLETED_YES); PropagationContext ctx = PropagationContextHelper.extract(any); env = txOrb.create_environment(); } else { env = ORB.init().create_environment();
} else { TypeCode typeCode = txOrb.get_primitive_tc(TCKind.tk_short); Any any = null; try { Any any = txOrb.create_any(); PropagationContextHelper.insert(any, hctx.value); byte[] ctxData = null; try {
private final Any packPropagationContext (PropagationContext ctx) { if (jtsLogger.logger.isTraceEnabled()) { jtsLogger.logger.trace("InterpositionClientRequestInterceptorImpl.packPropagationContext ( "+ctx+" )"); } Any data = ORBManager.getORB().orb().create_any(); if (ctx != null) PropagationContextHelper.insert(data, ctx); return data; }
/** * This method is a convenience method for the server * programmer the exctract the Control from the * PICurrent. */ public static Control getControl(org.omg.CORBA.ORB orb) { try { org.omg.PortableInterceptor.Current pi_current = (org.omg.PortableInterceptor.Current)orb.resolve_initial_references("PICurrent"); PropagationContext context = PropagationContextHelper.extract (pi_current.get_slot(slot_id)); return ControlHelper.extract(context.implementation_specific_data); } catch(Exception e) { if (logger.isDebugEnabled()) logger.debug("Unable to obtain Transaction Service reference. Giving up.", e ); } return null; }
org.omg.CosTransactions.PropagationContextHelper.write(_os,ctx); _is = _invoke(_os); org.omg.CosTransactions.Control _result = org.omg.CosTransactions.ControlHelper.read(_is); catch( org.omg.CORBA.portable.ApplicationException _ax ) String _id = _ax.getId(); throw new RuntimeException("Unexpected exception " + _id );
public void receive_request_service_contexts(ServerRequestInfo ri) { IIOPLogger.ROOT_LOGGER.tracef("Intercepting receive_request_service_contexts, operation: %s", ri.operation()); try { ServiceContext sc = ri.get_request_service_context(txContextId); Any any = codec.decode_value(sc.context_data, PropagationContextHelper.type()); ri.set_slot(slotId, any); } catch (BAD_PARAM e) { // no service context with txContextId: do nothing } catch (FormatMismatch e) { throw IIOPLogger.ROOT_LOGGER.errorDecodingContextData(this.name(), e); } catch (TypeMismatch e) { throw IIOPLogger.ROOT_LOGGER.errorDecodingContextData(this.name(), e); } catch (InvalidSlot e) { throw IIOPLogger.ROOT_LOGGER.errorSettingSlotInTxInterceptor(e); } }
public static org.omg.CosTransactions.PropagationContext extract (final org.omg.CORBA.Any any) { org.omg.CORBA.portable.InputStream in = any.create_input_stream(); try { return read (in); } finally { try { in.close(); } catch (java.io.IOException e) { throw new RuntimeException("Unexpected exception " + e.toString() ); } } }