use of org.omg.IOP.Encoding 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);
}
}
use of org.omg.IOP.Encoding 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);
}
}
use of org.omg.IOP.Encoding in project wildfly by wildfly.
the class CSIv2Initializer method post_init.
@Override
public void post_init(ORBInitInfo info) {
try {
// use CDR encapsulation with GIOP 1.0 encoding.
Encoding encoding = new Encoding(ENCODING_CDR_ENCAPS.value, (byte) 1, /* GIOP version */
(byte) 0);
Codec codec = info.codec_factory().create_codec(encoding);
// add IOR interceptor for CSIv2.
info.add_ior_interceptor(new CSIv2IORInterceptor(codec));
// register CSIv2-related policy factories.
info.register_policy_factory(CSIv2Policy.TYPE, new CSIv2PolicyFactory(codec));
} catch (Exception e) {
throw IIOPLogger.ROOT_LOGGER.unexpectedException(e);
}
}
use of org.omg.IOP.Encoding in project wildfly by wildfly.
the class SASInitializer method post_init.
@Override
public void post_init(ORBInitInfo info) {
try {
// use CDR encapsulations with GIOP 1.0 encoding.
Encoding encoding = new Encoding(ENCODING_CDR_ENCAPS.value, (byte) 1, /* GIOP version */
(byte) 0);
Codec codec = info.codec_factory().create_codec(encoding);
// create and register client interceptor.
SASClientIdentityInterceptor clientInterceptor = new SASClientIdentityInterceptor(codec);
info.add_client_request_interceptor(clientInterceptor);
// create and register server interceptor.
SASTargetInterceptor serverInterceptor = new SASTargetInterceptor(codec);
info.add_server_request_interceptor(serverInterceptor);
// initialize the SASCurrent implementation.
org.omg.CORBA.Object obj = info.resolve_initial_references("SASCurrent");
final SASCurrentImpl sasCurrentImpl = (SASCurrentImpl) obj;
sasCurrentImpl.init(serverInterceptor);
// Create and register an AuthenticationObserver to be called by the SecurityInterceptor
// Registry.bind(SecurityInterceptor.AuthenticationObserver.KEY,
// new SecurityInterceptor.AuthenticationObserver() {
// public void authenticationFailed()
// {
// sasCurrentImpl.reject_incoming_context();
// }
// });
} catch (Exception e) {
throw IIOPLogger.ROOT_LOGGER.unexpectedException(e);
}
}
use of org.omg.IOP.Encoding in project wildfly by wildfly.
the class TxIORInterceptorInitializer method post_init.
public void post_init(ORBInitInfo info) {
try {
// Use CDR encapsulation with GIOP 1.0 encoding
Encoding encoding = new Encoding(ENCODING_CDR_ENCAPS.value, (byte) 1, /* GIOP version */
(byte) 0);
Codec codec = info.codec_factory().create_codec(encoding);
info.add_ior_interceptor(new TxIORInterceptor(codec));
} catch (Exception e) {
throw IIOPLogger.ROOT_LOGGER.unexpectedException(e);
}
}
Aggregations