Search in sources :

Example 1 with ClientRequestInterceptor

use of org.omg.PortableInterceptor.ClientRequestInterceptor in project narayana by jbosstm.

the class InterpositionORBInitializerImpl method pre_init.

public void pre_init(ORBInitInfo init_info) {
    if (jtsLogger.logger.isTraceEnabled()) {
        jtsLogger.logger.trace("InterpositionORBInitializer.pre_init ()");
    }
    /*
	 * These value should be part of the standard.
	 */
    int localSlot = init_info.allocate_slot_id();
    int receivedSlot = init_info.allocate_slot_id();
    OTSManager.setLocalSlotId(localSlot);
    OTSManager.setReceivedSlotId(receivedSlot);
    /*
	 * Get the CDR codec; used for encoding/decoding the service
	 * context and IOR components.
	 */
    Codec cdr_codec = null;
    try {
        if (jtsLogger.logger.isTraceEnabled()) {
            jtsLogger.logger.trace("InterpositionORBInitializerImpl - getting reference to ENCODING_CDR_ENCAPS codec");
        }
        Encoding cdr_encoding = new Encoding(ENCODING_CDR_ENCAPS.value, (byte) 1, (byte) 2);
        cdr_codec = init_info.codec_factory().create_codec(cdr_encoding);
    } catch (UnknownEncoding ex) {
        jtsLogger.i18NLogger.warn_orbspecific_javaidl_interceptors_interposition_codecerror("InterpositionORBInitializerImpl", "ENCODING_CDR_ENCAPS", ex);
        throw new FatalError(jtsLogger.i18NLogger.get_orbspecific_javaidl_interceptors_interposition_codeccreate(), ex);
    }
    try {
        if (jtsLogger.logger.isTraceEnabled()) {
            jtsLogger.logger.trace("InterpositionORBInitializerImpl - registering ClientRequestInterceptor");
        }
        ClientRequestInterceptor client_interceptor = new InterpositionClientRequestInterceptorImpl(localSlot, cdr_codec);
        init_info.add_client_request_interceptor(client_interceptor);
    } catch (DuplicateName ex) {
        jtsLogger.i18NLogger.warn_orbspecific_javaidl_interceptors_interposition_duplicatename("InterpositionORBInitializerImpl", "ClientRequestInterceptor", ex);
        throw new FatalError(jtsLogger.i18NLogger.get_orbspecific_javaidl_interceptors_interposition_cie(), ex);
    }
    try {
        if (jtsLogger.logger.isTraceEnabled()) {
            jtsLogger.logger.trace("InterpositionORBInitializerImpl - registering ServerRequestInterceptor");
        }
        ServerRequestInterceptor server_interceptor = new InterpositionServerRequestInterceptorImpl(receivedSlot, cdr_codec);
        init_info.add_server_request_interceptor(server_interceptor);
    } catch (DuplicateName ex) {
        jtsLogger.i18NLogger.warn_orbspecific_javaidl_interceptors_interposition_duplicatename("InterpositionORBInitializerImpl", "ServerRequestInterceptor", ex);
        throw new FatalError(jtsLogger.i18NLogger.get_orbspecific_javaidl_interceptors_interposition_sie(), ex);
    }
}
Also used : FatalError(com.arjuna.ats.arjuna.exceptions.FatalError) Codec(org.omg.IOP.Codec) ClientRequestInterceptor(org.omg.PortableInterceptor.ClientRequestInterceptor) UnknownEncoding(org.omg.IOP.CodecFactoryPackage.UnknownEncoding) DuplicateName(org.omg.PortableInterceptor.ORBInitInfoPackage.DuplicateName) Encoding(org.omg.IOP.Encoding) UnknownEncoding(org.omg.IOP.CodecFactoryPackage.UnknownEncoding) ServerRequestInterceptor(org.omg.PortableInterceptor.ServerRequestInterceptor)

Example 2 with ClientRequestInterceptor

use of org.omg.PortableInterceptor.ClientRequestInterceptor in project narayana by jbosstm.

the class InterpositionORBInitializerImpl method pre_init.

public void pre_init(ORBInitInfo init_info) {
    if (jtsLogger.logger.isTraceEnabled()) {
        jtsLogger.logger.trace("InterpositionORBInitializer.pre_init ()");
    }
    /*
	 * These value should be part of the standard.
	 */
    int localSlot = init_info.allocate_slot_id();
    int receivedSlot = init_info.allocate_slot_id();
    OTSManager.setLocalSlotId(localSlot);
    OTSManager.setReceivedSlotId(receivedSlot);
    /*
	 * Get the CDR codec; used for encoding/decoding the service
	 * context and IOR components.
	 */
    Codec cdr_codec = null;
    try {
        if (jtsLogger.logger.isTraceEnabled()) {
            jtsLogger.logger.trace("InterpositionORBInitializerImpl - getting reference to ENCODING_CDR_ENCAPS codec");
        }
        Encoding cdr_encoding = new Encoding(ENCODING_CDR_ENCAPS.value, (byte) 1, (byte) 2);
        cdr_codec = init_info.codec_factory().create_codec(cdr_encoding);
    } catch (UnknownEncoding ex) {
        jtsLogger.i18NLogger.warn_orbspecific_javaidl_interceptors_interposition_codecerror("InterpositionORBInitializerImpl", "ENCODING_CDR_ENCAPS", ex);
        throw new FatalError(jtsLogger.i18NLogger.get_orbspecific_javaidl_interceptors_interposition_codeccreate(), ex);
    }
    try {
        if (jtsLogger.logger.isTraceEnabled()) {
            jtsLogger.logger.trace("InterpositionORBInitializerImpl - registering ClientRequestInterceptor");
        }
        ClientRequestInterceptor client_interceptor = new InterpositionClientRequestInterceptorImpl(localSlot, cdr_codec);
        init_info.add_client_request_interceptor(client_interceptor);
    } catch (DuplicateName ex) {
        jtsLogger.i18NLogger.warn_orbspecific_javaidl_interceptors_interposition_duplicatename("InterpositionORBInitializerImpl", "ClientRequestInterceptor", ex);
        throw new FatalError(jtsLogger.i18NLogger.get_orbspecific_javaidl_interceptors_interposition_cie(), ex);
    }
    try {
        if (jtsLogger.logger.isTraceEnabled()) {
            jtsLogger.logger.trace("InterpositionORBInitializerImpl - registering ServerRequestInterceptor");
        }
        ServerRequestInterceptor server_interceptor = new InterpositionServerRequestInterceptorImpl(receivedSlot, cdr_codec);
        init_info.add_server_request_interceptor(server_interceptor);
    } catch (DuplicateName ex) {
        jtsLogger.i18NLogger.warn_orbspecific_javaidl_interceptors_interposition_duplicatename("InterpositionORBInitializerImpl", "ServerRequestInterceptor", ex);
        throw new FatalError(jtsLogger.i18NLogger.get_orbspecific_javaidl_interceptors_interposition_sie(), ex);
    }
}
Also used : FatalError(com.arjuna.ats.arjuna.exceptions.FatalError) Codec(org.omg.IOP.Codec) ClientRequestInterceptor(org.omg.PortableInterceptor.ClientRequestInterceptor) UnknownEncoding(org.omg.IOP.CodecFactoryPackage.UnknownEncoding) DuplicateName(org.omg.PortableInterceptor.ORBInitInfoPackage.DuplicateName) Encoding(org.omg.IOP.Encoding) UnknownEncoding(org.omg.IOP.CodecFactoryPackage.UnknownEncoding) ServerRequestInterceptor(org.omg.PortableInterceptor.ServerRequestInterceptor)

Example 3 with ClientRequestInterceptor

use of org.omg.PortableInterceptor.ClientRequestInterceptor in project narayana by jbosstm.

the class ContextORBInitializerImpl method pre_init.

public void pre_init(ORBInitInfo init_info) {
    if (jtsLogger.logger.isTraceEnabled()) {
        jtsLogger.logger.trace("ContextORBInitializer.pre_init ()");
    }
    /*
	 * These value should be part of the standard.
	 */
    int localSlot = init_info.allocate_slot_id();
    int receivedSlot = init_info.allocate_slot_id();
    OTSManager.setLocalSlotId(localSlot);
    OTSManager.setReceivedSlotId(receivedSlot);
    /*
	 * Get the CDR codec; used for encoding/decoding the service
	 * context and IOR components.
	 */
    Codec cdr_codec = null;
    try {
        if (jtsLogger.logger.isTraceEnabled()) {
            jtsLogger.logger.trace("ContextORBInitializerImpl - getting reference to ENCODING_CDR_ENCAPS codec");
        }
        Encoding cdr_encoding = new Encoding(ENCODING_CDR_ENCAPS.value, (byte) 1, (byte) 0);
        cdr_codec = init_info.codec_factory().create_codec(cdr_encoding);
    } catch (UnknownEncoding ex) {
        jtsLogger.i18NLogger.warn_orbspecific_jacorb_interceptors_context_codecerror("ContextORBInitializerImpl", "ENCODING_CDR_ENCAPS", ex);
        throw new FatalError(jtsLogger.i18NLogger.get_orbspecific_jacorb_interceptors_context_codeccreate(), ex);
    }
    try {
        if (jtsLogger.logger.isTraceEnabled()) {
            jtsLogger.logger.trace("ContextORBInitializerImpl - registering ClientRequestInterceptor");
        }
        ClientRequestInterceptor client_interceptor = new ContextClientRequestInterceptorImpl(localSlot, cdr_codec);
        init_info.add_client_request_interceptor(client_interceptor);
    } catch (DuplicateName ex) {
        jtsLogger.i18NLogger.warn_orbspecific_jacorb_interceptors_context_duplicatename("ContextORBInitializerImpl", "ClientRequestInterceptor", ex);
        throw new FatalError(jtsLogger.i18NLogger.get_orbspecific_jacorb_interceptors_context_cie(), ex);
    }
    try {
        if (jtsLogger.logger.isTraceEnabled()) {
            jtsLogger.logger.trace("ContextORBInitializerImpl - registering ServerRequestInterceptor");
        }
        ServerRequestInterceptor server_interceptor = new ContextServerRequestInterceptorImpl(receivedSlot, cdr_codec);
        init_info.add_server_request_interceptor(server_interceptor);
    } catch (DuplicateName ex) {
        jtsLogger.i18NLogger.warn_orbspecific_jacorb_interceptors_context_duplicatename("ContextORBInitializerImpl", "ServerRequestInterceptor", ex);
        throw new FatalError(jtsLogger.i18NLogger.get_orbspecific_jacorb_interceptors_context_sie(), ex);
    }
}
Also used : FatalError(com.arjuna.ats.arjuna.exceptions.FatalError) Codec(org.omg.IOP.Codec) ClientRequestInterceptor(org.omg.PortableInterceptor.ClientRequestInterceptor) UnknownEncoding(org.omg.IOP.CodecFactoryPackage.UnknownEncoding) DuplicateName(org.omg.PortableInterceptor.ORBInitInfoPackage.DuplicateName) Encoding(org.omg.IOP.Encoding) UnknownEncoding(org.omg.IOP.CodecFactoryPackage.UnknownEncoding) ServerRequestInterceptor(org.omg.PortableInterceptor.ServerRequestInterceptor)

Example 4 with ClientRequestInterceptor

use of org.omg.PortableInterceptor.ClientRequestInterceptor in project narayana by jbosstm.

the class InterpositionORBInitializerImpl method pre_init.

public void pre_init(ORBInitInfo init_info) {
    if (jtsLogger.logger.isTraceEnabled()) {
        jtsLogger.logger.trace("InterpositionORBInitializer.pre_init ()");
    }
    /*
	 * These value should be part of the standard.
	 */
    int localSlot = init_info.allocate_slot_id();
    int receivedSlot = init_info.allocate_slot_id();
    OTSManager.setLocalSlotId(localSlot);
    OTSManager.setReceivedSlotId(receivedSlot);
    /*
	 * Get the CDR codec; used for encoding/decoding the service
	 * context and IOR components.
	 */
    Codec cdr_codec = null;
    try {
        if (jtsLogger.logger.isTraceEnabled()) {
            jtsLogger.logger.trace("InterpositionORBInitializerImpl - getting reference to ENCODING_CDR_ENCAPS codec");
        }
        Encoding cdr_encoding = new Encoding(ENCODING_CDR_ENCAPS.value, (byte) 1, (byte) 0);
        cdr_codec = init_info.codec_factory().create_codec(cdr_encoding);
    } catch (UnknownEncoding ex) {
        jtsLogger.i18NLogger.warn_orbspecific_jacorb_interceptors_interposition_codecerror("InterpositionORBInitializerImpl", "ENCODING_CDR_ENCAPS", ex);
        throw new FatalError(jtsLogger.i18NLogger.get_orbspecific_jacorb_interceptors_interposition_codeccreate(), ex);
    }
    try {
        if (jtsLogger.logger.isTraceEnabled()) {
            jtsLogger.logger.trace("InterpositionORBInitializerImpl - registering ClientRequestInterceptor");
        }
        ClientRequestInterceptor client_interceptor = new InterpositionClientRequestInterceptorImpl(localSlot, cdr_codec);
        init_info.add_client_request_interceptor(client_interceptor);
    } catch (DuplicateName ex) {
        jtsLogger.i18NLogger.warn_orbspecific_jacorb_interceptors_interposition_duplicatename("InterpositionORBInitializerImpl", "ClientRequestInterceptor", ex);
        throw new FatalError(jtsLogger.i18NLogger.get_orbspecific_jacorb_interceptors_interposition_cie(), ex);
    }
    try {
        if (jtsLogger.logger.isTraceEnabled()) {
            jtsLogger.logger.trace("InterpositionORBInitializerImpl - registering ServerRequestInterceptor");
        }
        ServerRequestInterceptor server_interceptor = new InterpositionServerRequestInterceptorImpl(receivedSlot, cdr_codec);
        init_info.add_server_request_interceptor(server_interceptor);
    } catch (DuplicateName ex) {
        jtsLogger.i18NLogger.warn_orbspecific_jacorb_interceptors_interposition_duplicatename("InterpositionORBInitializerImpl", "ServerRequestInterceptor", ex);
        throw new FatalError(jtsLogger.i18NLogger.get_orbspecific_jacorb_interceptors_interposition_sie(), ex);
    }
}
Also used : FatalError(com.arjuna.ats.arjuna.exceptions.FatalError) Codec(org.omg.IOP.Codec) ClientRequestInterceptor(org.omg.PortableInterceptor.ClientRequestInterceptor) UnknownEncoding(org.omg.IOP.CodecFactoryPackage.UnknownEncoding) DuplicateName(org.omg.PortableInterceptor.ORBInitInfoPackage.DuplicateName) Encoding(org.omg.IOP.Encoding) UnknownEncoding(org.omg.IOP.CodecFactoryPackage.UnknownEncoding) ServerRequestInterceptor(org.omg.PortableInterceptor.ServerRequestInterceptor)

Example 5 with ClientRequestInterceptor

use of org.omg.PortableInterceptor.ClientRequestInterceptor in project Payara by payara.

the class GlassFishORBInitializer method post_init.

/**
 * This method is called during ORB initialization.
 *
 * @param info object that provides initialization attributes
 *            and operations by which interceptors are registered.
 */
@Override
public void post_init(org.omg.PortableInterceptor.ORBInitInfo info) {
    Codec codec = null;
    fineLog("J2EE Initializer post_init");
    fineLog("Creating Codec for CDR encoding");
    CodecFactory cf = info.codec_factory();
    byte major_version = 1;
    byte minor_version = 2;
    Encoding encoding = new Encoding(ENCODING_CDR_ENCAPS.value, major_version, minor_version);
    try {
        codec = cf.create_codec(encoding);
        IIOPUtils iiopUtils = IIOPUtils.getInstance();
        Collection<IIOPInterceptorFactory> interceptorFactories = iiopUtils.getAllIIOPInterceptrFactories();
        for (IIOPInterceptorFactory factory : interceptorFactories) {
            fineLog("Processing interceptor factory: {0}", factory);
            ClientRequestInterceptor clientReq = factory.createClientRequestInterceptor(info, codec);
            ServerRequestInterceptor serverReq = factory.createServerRequestInterceptor(info, codec);
            if (clientReq != null) {
                fineLog("Registering client interceptor: {0}", clientReq);
                info.add_client_request_interceptor(clientReq);
            }
            if (serverReq != null) {
                fineLog("Registering server interceptor: {0}", serverReq);
                info.add_server_request_interceptor(serverReq);
            }
        }
    } catch (Exception e) {
        if (_logger.isLoggable(Level.WARNING)) {
            _logger.log(Level.WARNING, "Exception registering interceptors", e);
        }
        throw new RuntimeException(e.getMessage(), e);
    }
}
Also used : Codec(org.omg.IOP.Codec) ClientRequestInterceptor(org.omg.PortableInterceptor.ClientRequestInterceptor) IIOPInterceptorFactory(org.glassfish.enterprise.iiop.api.IIOPInterceptorFactory) Encoding(org.omg.IOP.Encoding) CodecFactory(org.omg.IOP.CodecFactory) IIOPUtils(org.glassfish.enterprise.iiop.util.IIOPUtils) ServerRequestInterceptor(org.omg.PortableInterceptor.ServerRequestInterceptor)

Aggregations

Codec (org.omg.IOP.Codec)7 Encoding (org.omg.IOP.Encoding)7 ClientRequestInterceptor (org.omg.PortableInterceptor.ClientRequestInterceptor)7 ServerRequestInterceptor (org.omg.PortableInterceptor.ServerRequestInterceptor)7 FatalError (com.arjuna.ats.arjuna.exceptions.FatalError)6 UnknownEncoding (org.omg.IOP.CodecFactoryPackage.UnknownEncoding)6 DuplicateName (org.omg.PortableInterceptor.ORBInitInfoPackage.DuplicateName)6 IIOPInterceptorFactory (org.glassfish.enterprise.iiop.api.IIOPInterceptorFactory)1 IIOPUtils (org.glassfish.enterprise.iiop.util.IIOPUtils)1 CodecFactory (org.omg.IOP.CodecFactory)1