/** * Give up the buffer to the caller and mark the stream closed. It is * up to the caller to eventually return the buffer to the manager. */ public byte[] releaseBuffer () { byte [] retn = buffer; buffer = null; close (); return retn; }
public ExceptionHolderImpl(ORB orb, org.omg.CORBA.SystemException exception) { this(orb); is_system_exception = true; byte_order = false; final CDROutputStream out = new CDROutputStream(orb); try { SystemExceptionHelper.write(out, exception); marshaled_exception = out.getBufferCopy(); } finally { out.close(); } }
/** * Marshals this object into a new buffer and returns that buffer. */ public byte[] marshal() { final CDROutputStream out = new CDROutputStream( orb ); try { out.write_value( this, "IDL:omg.org/Messaging/ExceptionHolder:1.0" ); return out.getBufferCopy(); } finally { out.close(); } } }
public byte [] toCDR () { final CDROutputStream out = new CDROutputStream(); try { out.beginEncapsulatedArray(); this.write(out); return out.getBufferCopy(); } finally { out.close(); } }
public byte[] encode(Any data) throws InvalidTypeForEncoding { final CDROutputStream out = new CDROutputStream(orb); try { out.beginEncapsulatedArray(); out.write_any(data); // do not end encapsulation since it will patch the // array with a size! return out.getBufferCopy(); } finally { out.close(); } }
/** * Returns a CDR encapsulation of the given UtcT. */ public static byte[] toCDR(UtcT time) { final CDROutputStream out = new CDROutputStream(); try { out.beginEncapsulatedArray(); UtcTHelper.write(out, time); return out.getBufferCopy(); } finally { out.close(); } }
public byte[] encode_value(Any data) throws InvalidTypeForEncoding { final CDROutputStream out = new CDROutputStream(orb); try { out.beginEncapsulatedArray(); data.write_value(out); // do not end encapsulation since it will patch the // array with a size! return out.getBufferCopy(); } finally { out.close(); } } }
/** * The group object key, or the tagGroup as a byte array. * * @return tagGroup as a byte array. */ @Override public byte[] get_object_key () { if (objectKey == null) { CDROutputStream out = new CDROutputStream (); out.beginEncapsulatedArray (); TagGroupTaggedComponentHelper.write (out, tagGroup); objectKey = out.getBufferCopy (); out.close(); } return objectKey; }
/** * Creates an ORB_TYPE_ID tagged component for JacORB. */ private TaggedComponent create_ORB_TYPE_ID() { final CDROutputStream out = new CDROutputStream( this ); try { out.beginEncapsulatedArray(); out.write_long( ORBConstants.JACORB_ORB_ID ); return new TaggedComponent ( TAG_ORB_TYPE.value, out.getBufferCopy() ); } finally { out.close(); } }
/** * Creates a ServiceContext for transmitting an exception detail message, * as per section 1.15.2 of the Java Mapping. */ public static ServiceContext createExceptionDetailMessage (String message) { final CDROutputStream out = new CDROutputStream(); try { out.beginEncapsulatedArray(); out.write_wstring(message); return new ServiceContext(org.omg.IOP.ExceptionDetailMessage.value, out.getBufferCopy()); } finally { out.close(); } }
/** * Encode this profile as a TaggedProfile (marshaled). * * @param taggedProfile a tagged profile holder. * @param taggedComponentSeq unused. */ @Override public void marshal (TaggedProfileHolder taggedProfile, TaggedComponentSeqHolder taggedComponentSeq) { if (data == null) { CDROutputStream out = new CDROutputStream (); out.beginEncapsulatedArray (); UIPMC_ProfileBodyHelper.write (out, uipmc); data = out.getBufferCopy (); out.close (); } taggedProfile.value = new TaggedProfile (TAG_UIPMC.value, data); }
private ServiceContext createInvocationPolicies() { final CDROutputStream out = new CDROutputStream( orb ); try { out.beginEncapsulatedArray(); PolicyValueSeqHelper.write(out, getTimingPolicyValues()); return new ServiceContext (INVOCATION_POLICIES.value, out.getBufferCopy()); } finally { out.close(); } } }
public org.omg.CORBA.portable.InputStream create_input_stream() { if(value instanceof org.jacorb.orb.CDROutputStream) { return new org.jacorb.orb.CDRInputStream( orb, ((CDROutputStream)value).getBufferCopy()); } final org.jacorb.orb.CDROutputStream out = new org.jacorb.orb.CDROutputStream(orb); try { write_value(out); return new org.jacorb.orb.CDRInputStream(orb, out.getBufferCopy()); } finally { out.close(); } }
private static byte[] getEncapsulatedUIPMCProfile (org.jacorb.orb.ORB orb, ClientConnection connection, UIPMC_ProfileBody upb) { CDROutputStream out = new CDROutputStream (orb); out.beginEncapsulatedArray (); if (connection != null) { UIPMC_ProfileBodyHelper.write (out, ((MIOPProfile)connection.getRegisteredProfile ()).getUIPMCProfile ()); } else { UIPMC_ProfileBodyHelper.write (out, upb); } byte []result = out.getBufferCopy (); out.close(); return result; } }
private ServiceContext createCodesetContext( CodeSet tcs, CodeSet tcsw ) { // encapsulate context final CDROutputStream os = new CDROutputStream( orb ); try { os.beginEncapsulatedArray(); CodeSetContextHelper.write( os, new CodeSetContext( tcs.getId(), tcsw.getId() )); return new ServiceContext( TAG_CODE_SETS.value, os.getBufferCopy() ); } finally { os.close(); } }
public CodeSetInfoInterceptor(ORB orb) throws ConfigurationException { super(); configure(orb.getConfiguration()); // encapsulate it into TaggedComponent final CDROutputStream out = new CDROutputStream( orb ); try { out.beginEncapsulatedArray(); CodeSetComponentInfoHelper.write( out, orb.getLocalCodeSetComponentInfo() ); tagc = new TaggedComponent(TAG_CODE_SETS.value, out.getBufferCopy()); } finally { out.close(); } }
private void decode_extensions(String ident) throws ConfigurationException { this.components = new TaggedComponentList(); if (ident.equals("ssliop")) { ssl = new SSL(); ssl.port = (short)primaryAddress.getPort(); ssl.target_supports = get_ssl_options("jacorb.security.ssl.corbaloc_ssliop.supported_options"); ssl.target_requires = get_ssl_options("jacorb.security.ssl.corbaloc_ssliop.required_options"); isSSLSet = true; //create the tagged component containing the ssl struct final CDROutputStream out = new CDROutputStream(); try { out.beginEncapsulatedArray(); SSLHelper.write( out, ssl ); // TAG_SSL_SEC_TRANS must be disambiguated in case OpenORB-generated // OMG classes are in the classpath. components.addComponent (new TaggedComponent( org.omg.SSLIOP.TAG_SSL_SEC_TRANS.value, out.getBufferCopy() ) ); } finally { out.close(); } } }
public org.omg.CORBA.Any to_any() { checkDestroyed (); final CDROutputStream out = new CDROutputStream(orb); try { out.write_long( enumValue ); org.omg.CORBA.Any out_any = orb.create_any(); out_any.type(type()); final CDRInputStream in = new CDRInputStream(orb, out.getBufferCopy()); try { out_any.read_value( in, type()); return out_any; } finally { in.close(); } } finally { out.close(); } }
public org.omg.CORBA.Any to_any() { checkDestroyed (); final org.omg.CORBA.Any out_any = orb.create_any(); out_any.type( type()); final CDROutputStream out = new CDROutputStream(orb); try { for( int i = 0; i < limit; i++) { out.write_value( elementType, members[i].create_input_stream()); } final CDRInputStream in = new CDRInputStream(orb, out.getBufferCopy()); try { out_any.read_value( in, type()); return out_any; } finally { in.close(); } } finally { out.close(); } }