public void allDone() throws IRConstructionException { // Get my original type definition: It should have been created now. try { original_type_def = IDLTypeImpl.getIDLType(type().content_type(), repository); } catch (BadKind ex) { throw IIOPLogger.ROOT_LOGGER.badKindForTypeCode(type().kind().value()); } getReference(); }
/** * Return the LocalIDLType for the given TypeCode. */ static LocalIDLType getIDLType(TypeCode typeCode, RepositoryImpl repository) { TCKind tcKind = typeCode.kind(); if (PrimitiveDefImpl.isPrimitiveTCKind(tcKind)) return new PrimitiveDefImpl(typeCode, repository); if (tcKind == TCKind.tk_sequence) return repository.getSequenceImpl(typeCode); if (tcKind == TCKind.tk_value || tcKind == TCKind.tk_value_box || tcKind == TCKind.tk_alias || tcKind == TCKind.tk_struct || tcKind == TCKind.tk_union || tcKind == TCKind.tk_enum || tcKind == TCKind.tk_objref) { try { return (LocalIDLType) repository._lookup_id(typeCode.id()); } catch (BadKind ex) { throw IIOPLogger.ROOT_LOGGER.badKindForTypeCode(tcKind.value()); } } throw IIOPLogger.ROOT_LOGGER.badKindForTypeCode(tcKind.value()); }
public int bound() { try { return type().length(); } catch (BadKind ex) { // should never happen throw new RuntimeException(); } }
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.type().kind().value() != TCKind._tk_null) if ((threadId = localData.extract_string()) == null) throw new UNKNOWN(jtsLogger.i18NLogger.get_orbspecific_javaidl_interceptors_interposition_invalidparam()); threadId = ThreadUtil.getThreadId() ; ServiceContext service_context = new ServiceContext(OTSManager.serviceId, octets); request_info.add_request_service_context(service_context, true); throw new UNKNOWN(ex.toString());
public static short extract(org.omg.CORBA.Any any) { if(any.type().equivalent(type())) return read(any.create_input_stream()); else throw new org.omg.CORBA.BAD_OPERATION(); }
public String get_string() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { if (status == STATUS_DESTROYED) { throw wrapper.dynAnyDestroyed() ; } if (any.type().kind().value() != TCKind._tk_string) throw new TypeMismatch(); return any.extract_string(); }
public static org.jacorb.imr.HostInfo[] extract (final org.omg.CORBA.Any any) { if ( any.type().kind() == org.omg.CORBA.TCKind.tk_null) { throw new org.omg.CORBA.BAD_OPERATION ("Can't extract from Any with null type."); } return read (any.create_input_stream ()); }
if (myRealType.kind().value() != otherRealType.kind().value()) { return false; try { myID = this.id(); otherID = tc.id(); int myKind = myRealType.kind().value(); try { if (myKind == TCKind._tk_struct || if (myRealType.member_count() != otherRealType.member_count()) return false; if (myRealType.default_index() != otherRealType.default_index()) return false; if (myRealType.length() != otherRealType.length()) return false; if (myRealType.fixed_digits() != otherRealType.fixed_digits() || myRealType.fixed_scale() != otherRealType.fixed_scale()) return false; for (int i=0; i<myRealType.member_count(); i++) { if (myRealType.member_label(i) != otherRealType.member_label(i)) return false; if ( ! myRealType.discriminator_type().equivalent(
RCobjectId = JacOrbRCServiceInit._poa.reference_to_id(ri.effective_target()); objectIdString = new String(RCobjectId); Any indicator = ri.get_slot(IndicatorSlotId); if (indicator.type().kind().equals(TCKind.tk_null)) ri.add_request_service_context(RCctx, false); RCctx = new ServiceContext(RecoveryContextId, RCobjectId); in_loop = false; throw new ForwardRequest( reco );
if( ! type().equivalent( value.type() )) typeCode = TypeCode.originalType( value.type() ); super.from_any( value ); value.create_input_stream(); discriminator.type( type().discriminator_type()); discriminator.read_value(is, type().discriminator_type()); for( int i = 0; i < type ().member_count (); i++ ) if( type().member_label(i).equal( discriminator )) member_any.read_value( is, type().member_type(i) ); memberName = type().member_name(i); memberIndex = i; break; int def_idx = type().default_index(); if( def_idx != -1 ) member_any.read_value( is, type().member_type(def_idx) ); memberName = type().member_name(def_idx); memberIndex = def_idx;
if (ctx.type().kind().value() != TCKind._tk_null) if (ctx.type().kind().value() == TCKind._tk_string) threadData.insert_string(ThreadUtil.getThreadId());
switch (unionTypeCode.discriminator_type().kind().value()) { _any.insert_long(discriminator); break; _any.insert_ulong(discriminator); break; _any.insert_short((short) discriminator); break; int _memberCount = unionTypeCode.member_count(); if (_any.equal(unionTypeCode.member_label(_x))) return unionTypeCode.member_name(_x);
!(disc_tc.kind().value() == TCKind._tk_short || disc_tc.kind().value() == TCKind._tk_long || disc_tc.kind().value() == TCKind._tk_longlong || disc_tc.kind().value() == TCKind._tk_ushort || disc_tc.kind().value() == TCKind._tk_ulong || disc_tc.kind().value() == TCKind._tk_ulonglong || disc_tc.kind().value() == TCKind._tk_char || disc_tc.kind().value() == TCKind._tk_boolean || disc_tc.kind().value() == TCKind._tk_enum throw new BAD_PARAM("Illegal union discriminator type", 20, CompletionStatus.COMPLETED_NO ); throw new BAD_PARAM("Illegal union member name: " + members[i].name, 17, CompletionStatus.COMPLETED_NO ); if (! discriminator_type.equivalent( label.type() ) && ! ( label.type().kind().value() == TCKind._tk_octet && label.extract_octet() == (byte)0 throw new BAD_PARAM("Label type does not match discriminator type", 19, CompletionStatus.COMPLETED_NO );
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 ) );
/** * 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) { } }
/** * Returns the transaction associated with the transaction propagation * context that arrived in the current IIOP request. */ public static Transaction getCurrentTransaction() { Transaction tx = null; if (piCurrent != null) { // A non-null piCurrent means that a TxServerInterceptor was // installed: check if there is a transaction propagation context try { Any any = piCurrent.get_slot(slotId); if (any.type().kind().value() != TCKind._tk_null) { // Yes, there is a TPC: add the foreign transaction marker tx = ForeignTransaction.INSTANCE; } } catch (InvalidSlot e) { throw IIOPLogger.ROOT_LOGGER.errorGettingSlotInTxInterceptor(e); } } return tx; }
public static FixedDef extract(org.omg.CORBA.Any any) { if(any.type().equivalent(type())) return narrow(any.extract_Object()); throw new org.omg.CORBA.BAD_OPERATION(); }
public void insert_string(String value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { if (status == STATUS_DESTROYED) { throw wrapper.dynAnyDestroyed() ; } if (any.type().kind().value() != TCKind._tk_string) throw new TypeMismatch(); if (value == null) throw new InvalidValue(); // Throw InvalidValue if this is a bounded string and the length is exceeded try { if (any.type().length() > 0 && any.type().length() < value.length()) throw new InvalidValue(); } catch (BadKind bad) { // impossible } any.insert_string(value); }
public void insert_reference(org.omg.CORBA.Object value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { if (status == STATUS_DESTROYED) { throw wrapper.dynAnyDestroyed() ; } if (any.type().kind().value() != TCKind._tk_objref) throw new TypeMismatch(); any.insert_Object(value); }