use of org.glassfish.enterprise.iiop.util.IIOPUtils in project Payara by payara.
the class PEORBConfigurator method configure.
public void configure(DataCollector dc, ORB orb) {
try {
// end temp fix for bug 6320008
if (threadpoolMgr != null) {
// This will be the case for the Server Side ORB created
// For client side threadpoolMgr will be null, so we will
// never come here
orb.setThreadPoolManager(threadpoolMgr);
}
// Do the stats for the threadpool
ThreadPoolManager tpool = orb.getThreadPoolManager();
// ORB creates its own threadpool if threadpoolMgr was null above
ThreadPool thpool = tpool.getDefaultThreadPool();
String ThreadPoolName = thpool.getName();
ThreadPoolStats tpStats = new ThreadPoolStatsImpl(thpool.getWorkQueue(0).getThreadPool());
StatsProviderManager.register("orb", PluginPoint.SERVER, "thread-pool/orb/threadpool/" + ThreadPoolName, tpStats);
configureCopiers(orb);
configureCallflowInvocationInterceptor(orb);
// In the server-case, iiop acceptors need to be set up after the
// initial part of the orb creation but before any
// portable interceptor initialization
IIOPUtils iiopUtils = IIOPUtils.getInstance();
if (iiopUtils.getProcessType().isServer()) {
List<IiopListener> iiop_listener_list = IIOPUtils.getInstance().getIiopService().getIiopListener();
IiopListener[] iiopListenerBeans = iiop_listener_list.toArray(new IiopListener[iiop_listener_list.size()]);
this.createORBListeners(iiopUtils, iiopListenerBeans, orb);
}
if (orb.getORBData().environmentIsGFServer()) {
// Start the transient name service, which publishes NameService
// in the ORB's local resolver.
new TransientNameService(orb);
}
// Publish the ORB reference back to GlassFishORBHelper, so that
// subsequent calls from interceptor ORBInitializers can call
// GlassFishORBHelper.getORB() without problems. This is
// especially important for code running in the service initializer
// thread.
getHelper().setORB(orb);
} catch (NoSuchWorkQueueException ex) {
Logger.getLogger(PEORBConfigurator.class.getName()).log(Level.SEVERE, null, ex);
}
}
use of org.glassfish.enterprise.iiop.util.IIOPUtils 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