use of com.arjuna.ats.arjuna.exceptions.FatalError 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) 2);
cdr_codec = init_info.codec_factory().create_codec(cdr_encoding);
} catch (UnknownEncoding ex) {
jtsLogger.i18NLogger.warn_orbspecific_javaidl_interceptors_context_codecerror("ContextORBInitializerImpl", "ENCODING_CDR_ENCAPS", ex);
throw new FatalError(jtsLogger.i18NLogger.get_orbspecific_javaidl_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_javaidl_interceptors_context_duplicatename("ContextORBInitializerImpl", "ClientRequestInterceptor", ex);
throw new FatalError(jtsLogger.i18NLogger.get_orbspecific_javaidl_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_javaidl_interceptors_context_duplicatename("ContextORBInitializerImpl", "ServerRequestInterceptor", ex);
throw new FatalError(jtsLogger.i18NLogger.get_orbspecific_javaidl_interceptors_context_sie(), ex);
}
}
use of com.arjuna.ats.arjuna.exceptions.FatalError in project narayana by jbosstm.
the class ORBSetupTest method test.
@Test
public void test() {
boolean staticSet = false;
ORB myORB = null;
RootOA myOA = null;
Map<String, String> properties = opPropertyManager.getOrbPortabilityEnvironmentBean().getOrbInitializationProperties();
properties.put(PostInitLoader.generateORBPropertyName("com.arjuna.orbportability.orb", ORB_NAME), "com.arjuna.ats.jts.utils.ORBSetup");
opPropertyManager.getOrbPortabilityEnvironmentBean().setOrbInitializationProperties(properties);
try {
myORB = ORB.getInstance(ORB_NAME);
myOA = OA.getRootOA(myORB);
if (staticSet) {
ORBManager.setORB(myORB);
}
try {
myORB.initORB(new String[] {}, null);
myOA.initOA();
assertEquals(myORB, ORBManager.getORB());
} catch (FatalError e) {
if (staticSet) {
System.out.println("FatalError thrown as expected");
} else {
fail("Error: " + e);
e.printStackTrace(System.err);
}
}
myOA.destroy();
myORB.destroy();
} catch (Throwable e) {
fail("Error: " + e);
e.printStackTrace(System.err);
}
}
use of com.arjuna.ats.arjuna.exceptions.FatalError in project narayana by jbosstm.
the class OTSThread method run.
public void run() {
if (_currentControl != null) {
try {
CurrentImple current = OTSImpleManager.current();
if (current != null) {
current.resume(_currentControl);
current = null;
}
} catch (Exception e) {
jtsLogger.i18NLogger.warn_thread_resumefailed("OTSThread.run", e);
throw new FatalError("OTSThread.run - " + jtsLogger.i18NLogger.get_thread_resumefailederror(), e);
}
_currentControl = null;
}
}
use of com.arjuna.ats.arjuna.exceptions.FatalError 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) 2);
cdr_codec = init_info.codec_factory().create_codec(cdr_encoding);
} catch (UnknownEncoding ex) {
jtsLogger.i18NLogger.warn_orbspecific_javaidl_interceptors_context_codecerror("ContextORBInitializerImpl", "ENCODING_CDR_ENCAPS", ex);
throw new FatalError(jtsLogger.i18NLogger.get_orbspecific_javaidl_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_javaidl_interceptors_context_duplicatename("ContextORBInitializerImpl", "ClientRequestInterceptor", ex);
throw new FatalError(jtsLogger.i18NLogger.get_orbspecific_javaidl_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_javaidl_interceptors_context_duplicatename("ContextORBInitializerImpl", "ServerRequestInterceptor", ex);
throw new FatalError(jtsLogger.i18NLogger.get_orbspecific_javaidl_interceptors_context_sie(), ex);
}
}
Aggregations