use of org.omg.PortableInterceptor.ServerRequestInterceptor 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);
}
}
use of org.omg.PortableInterceptor.ServerRequestInterceptor in project Payara by payara.
the class SecurityIIOPInterceptorFactory method createServerRequestInterceptor.
@Override
public ServerRequestInterceptor createServerRequestInterceptor(ORBInitInfo info, Codec codec) {
ServerRequestInterceptor ret = null;
try {
if (!penv.getProcessType().isServer()) {
return null;
}
if (altSecFactory != null || (interceptorFactory != null && createAlternateSecurityInterceptorFactory())) {
ret = altSecFactory.getServerRequestInterceptor(codec);
} else {
ret = getServerInterceptorInstance(codec);
}
// also register the IOR Interceptor here
if (info instanceof com.sun.corba.ee.spi.legacy.interceptor.ORBInitInfoExt) {
com.sun.corba.ee.spi.legacy.interceptor.ORBInitInfoExt infoExt = (com.sun.corba.ee.spi.legacy.interceptor.ORBInitInfoExt) info;
IORInterceptor secIOR = getSecIORInterceptorInstance(codec, infoExt.getORB());
info.add_ior_interceptor(secIOR);
}
} catch (DuplicateName ex) {
_logger.log(Level.SEVERE, null, ex);
throw new RuntimeException(ex);
}
return ret;
}
Aggregations