@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); } } }
@Override public void send_exception(ServerRequestInfo ri) { IIOPLogger.ROOT_LOGGER.tracef("send_exception: %s", ri.operation()); CurrentRequestInfo threadLocal = (CurrentRequestInfo) threadLocalData.get(); // The check below was added for interoperability with IONA's ASP 6.0, which throws an // ArrayIndexOutOfBoundsException when it receives an IIOP reply carrying both an application exception // and a SAS reply CompleteEstablishContext. The flag serves the purpose of refraining fromsending an SAS // accept (CompleteEstablishContext) reply together with an exception. // // The CSIv2 spec does not explicitly disallow an SAS accept in an IIOP exception reply. boolean interopIONA = Boolean.valueOf(CorbaORBService.getORBProperty(Constants.INTEROP_IONA)); if (threadLocal.sasReply != null && !interopIONA) { 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); } } }
ServiceContext sc = new ServiceContext(sasContextId, codec.encode_value(any)); ri.add_request_service_context(sc, true /*replace existing context*/);
ServiceContext sc = new ServiceContext(sasContextId, codec.encode_value(any)); ri.add_request_service_context(sc, true /*replace existing context*/);
ServiceContext sc = new ServiceContext(SAS_CONTEXT_ID, codec.encode_value(any)); ri.add_request_service_context(sc, true /*replace existing context*/);
private org.omg.IOP.ServiceContext copyServiceContext( org.omg.IOP.ServiceContext sc) { org.omg.IOP.ServiceContext result = new org.omg.IOP.ServiceContext(); result.context_id = sc.context_id; result.context_data = new byte[sc.context_data.length]; System.arraycopy(sc.context_data, 0, result.context_data, 0, sc.context_data.length); return result; }
public static ServiceContext read(org.omg.CORBA.portable.InputStream in) { ServiceContext _ob_v = new ServiceContext(); _ob_v.context_id = ServiceIdHelper.read(in); int len0 = in.read_ulong(); _ob_v.context_data = new byte[len0]; in.read_octet_array(_ob_v.context_data, 0, len0); return _ob_v; }
public static org.omg.IOP.ServiceContext read (org.omg.CORBA.portable.InputStream istream) { org.omg.IOP.ServiceContext value = new org.omg.IOP.ServiceContext (); value.context_id = istream.read_ulong (); int _len0 = istream.read_long (); value.context_data = new byte[_len0]; istream.read_octet_array (value.context_data, 0, _len0); return value; }
/** * 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); } } }
@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); } } }
private void readServiceContextList(org.omg.IOP.ServiceContextListHolder scl) { int len = in_.read_ulong(); scl.value = new org.omg.IOP.ServiceContext[len]; if (len != 0) { for (int i = 0; i < len; i++) { scl.value[i] = new org.omg.IOP.ServiceContext(); org.omg.IOP.ServiceContext sc = scl.value[i]; sc.context_id = in_.read_ulong(); int datalen = in_.read_ulong(); sc.context_data = new byte[datalen]; in_.read_octet_array(sc.context_data, 0, datalen); } } }
@Override public void send_exception(ServerRequestInfo ri) { IIOPLogger.ROOT_LOGGER.tracef("send_exception: %s", ri.operation()); CurrentRequestInfo threadLocal = (CurrentRequestInfo) threadLocalData.get(); // The check below was added for interoperability with IONA's ASP 6.0, which throws an // ArrayIndexOutOfBoundsException when it receives an IIOP reply carrying both an application exception // and a SAS reply CompleteEstablishContext. The flag serves the purpose of refraining fromsending an SAS // accept (CompleteEstablishContext) reply together with an exception. // // The CSIv2 spec does not explicitly disallow an SAS accept in an IIOP exception reply. boolean interopIONA = Boolean.valueOf(CorbaORBService.getORBProperty(Constants.INTEROP_IONA)); if (threadLocal.sasReply != null && !interopIONA) { 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); } } }
@Override public void send_exception(ServerRequestInfo ri) { IIOPLogger.ROOT_LOGGER.tracef("send_exception: %s", ri.operation()); CurrentRequestInfo threadLocal = (CurrentRequestInfo) threadLocalData.get(); // The check below was added for interoperability with IONA's ASP 6.0, which throws an // ArrayIndexOutOfBoundsException when it receives an IIOP reply carrying both an application exception // and a SAS reply CompleteEstablishContext. The flag serves the purpose of refraining fromsending an SAS // accept (CompleteEstablishContext) reply together with an exception. // // The CSIv2 spec does not explicitly disallow an SAS accept in an IIOP exception reply. boolean interopIONA = Boolean.valueOf(CorbaORBService.getORBProperty(Constants.INTEROP_IONA)); if (threadLocal.sasReply != null && !interopIONA) { 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); } } }
/** * 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(); } }
public static org.omg.IOP.ServiceContext read (final org.omg.CORBA.portable.InputStream in) { org.omg.IOP.ServiceContext result = new org.omg.IOP.ServiceContext(); result.context_id=in.read_ulong(); int _lresult_context_data5 = in.read_long(); try { int x = in.available(); if ( x > 0 && _lresult_context_data5 > x ) { throw new org.omg.CORBA.MARSHAL("Sequence length too large. Only " + x + " available and trying to assign " + _lresult_context_data5); } } catch (java.io.IOException e) { } result.context_data = new byte[_lresult_context_data5]; in.read_octet_array(result.context_data,0,_lresult_context_data5); return result; } public static void write (final org.omg.CORBA.portable.OutputStream out, final org.omg.IOP.ServiceContext s)
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(); } } }
ServiceContext encodeSASContextBody(SASContextBody sasBody) { // // Create encapsulation for SAS context body // Any a = getOrb().create_any(); SASContextBodyHelper.insert(a, sasBody); // wrap the ANY in an encapsulation byte[] data; try { data = codec.encode_value(a); } catch (UserException ex) { MARSHAL me = new MARSHAL("cannot encode local security descriptor", 0, CompletionStatus.COMPLETED_NO); me.initCause(ex); throw me; } return new ServiceContext(SecurityAttributeService.value, data); }
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(); } }
private void putHAContext(final ServerRequestInfo serverRequestInfo) { // Get the current HA Context info associated to the thread HACurrent current = HACurrent.getHACurrent(); HAContext haContext = new HAContext(); Stack<RequestId> requests = current.getRequests(); haContext.setRequests(requests); logger.debug("newHACtx: " + haContext); ServiceContext serviceContext; try { serviceContext = new ServiceContext(HA_CTX_ID, marshallHAContext(haContext)); serverRequestInfo.add_reply_service_context(serviceContext, true); } catch (IOException e) { logger.error("Error while marshalling " + haContext, e); } }