use of org.glassfish.enterprise.iiop.api.IIOPInterceptorFactory 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);
}
}
Aggregations