PageRenderTime 57ms CodeModel.GetById 26ms RepoModel.GetById 0ms app.codeStats 0ms

/projects/jre-1.6.0/src/com/sun/corba/se/impl/orb/ORBConfiguratorImpl.java

https://gitlab.com/essere.lab.public/qualitas.class-corpus
Java | 610 lines | 441 code | 89 blank | 80 comment | 42 complexity | c61fdc39ec1568107574354da5512290 MD5 | raw file
  1. /*
  2. * %W% %E%
  3. *
  4. * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
  5. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package com.sun.corba.se.impl.orb ;
  8. import java.lang.reflect.InvocationTargetException;
  9. import java.lang.reflect.Method;
  10. import java.net.InetAddress ;
  11. import java.security.PrivilegedAction ;
  12. import java.security.PrivilegedExceptionAction ;
  13. import java.security.AccessController ;
  14. import java.util.Collection ;
  15. import java.util.Iterator ;
  16. import org.omg.CORBA.CompletionStatus ;
  17. import org.omg.CORBA.portable.ValueFactory ;
  18. import com.sun.corba.se.pept.protocol.ClientRequestDispatcher ;
  19. import com.sun.corba.se.pept.transport.Acceptor;
  20. import com.sun.corba.se.spi.activation.Locator ;
  21. import com.sun.corba.se.spi.activation.Activator ;
  22. import com.sun.corba.se.spi.activation.LocatorHelper ;
  23. import com.sun.corba.se.spi.activation.ActivatorHelper ;
  24. import com.sun.corba.se.spi.activation.EndPointInfo ;
  25. import com.sun.corba.se.spi.copyobject.ObjectCopierFactory ;
  26. import com.sun.corba.se.spi.copyobject.CopyobjectDefaults ;
  27. import com.sun.corba.se.spi.copyobject.CopierManager ;
  28. import com.sun.corba.se.spi.ior.IdentifiableFactoryFinder ;
  29. import com.sun.corba.se.spi.ior.IOR;
  30. import com.sun.corba.se.spi.ior.IORFactories ;
  31. import com.sun.corba.se.spi.ior.iiop.IIOPFactories ;
  32. import com.sun.corba.se.spi.legacy.connection.ORBSocketFactory;
  33. import com.sun.corba.se.spi.logging.CORBALogDomains ;
  34. import com.sun.corba.se.spi.oa.OADefault ;
  35. import com.sun.corba.se.spi.oa.ObjectAdapter ;
  36. import com.sun.corba.se.spi.oa.ObjectAdapterFactory ;
  37. import com.sun.corba.se.spi.orb.Operation ;
  38. import com.sun.corba.se.spi.orb.OperationFactory ;
  39. import com.sun.corba.se.spi.orb.ORBData ;
  40. import com.sun.corba.se.spi.orb.DataCollector ;
  41. import com.sun.corba.se.spi.orb.ORBConfigurator ;
  42. import com.sun.corba.se.spi.orb.ParserImplBase ;
  43. import com.sun.corba.se.spi.orb.PropertyParser ;
  44. import com.sun.corba.se.spi.orb.ORB ;
  45. import com.sun.corba.se.spi.orbutil.closure.Closure ;
  46. import com.sun.corba.se.spi.orbutil.closure.ClosureFactory ;
  47. import com.sun.corba.se.spi.protocol.RequestDispatcherRegistry ;
  48. import com.sun.corba.se.spi.protocol.CorbaServerRequestDispatcher ;
  49. import com.sun.corba.se.spi.protocol.RequestDispatcherDefault ;
  50. import com.sun.corba.se.spi.protocol.LocalClientRequestDispatcherFactory ;
  51. import com.sun.corba.se.spi.resolver.LocalResolver ;
  52. import com.sun.corba.se.spi.resolver.Resolver ;
  53. import com.sun.corba.se.spi.resolver.ResolverDefault ;
  54. import com.sun.corba.se.spi.transport.CorbaContactInfoList;
  55. import com.sun.corba.se.spi.transport.CorbaContactInfoListFactory;
  56. import com.sun.corba.se.spi.transport.SocketInfo;
  57. import com.sun.corba.se.spi.transport.TransportDefault ;
  58. import com.sun.corba.se.spi.presentation.rmi.PresentationManager ;
  59. import com.sun.corba.se.spi.presentation.rmi.PresentationDefaults ;
  60. import com.sun.corba.se.spi.servicecontext.ServiceContext ;
  61. import com.sun.corba.se.spi.servicecontext.ServiceContextRegistry ;
  62. import com.sun.corba.se.spi.servicecontext.UEInfoServiceContext ;
  63. import com.sun.corba.se.spi.servicecontext.CodeSetServiceContext ;
  64. import com.sun.corba.se.spi.servicecontext.SendingContextServiceContext ;
  65. import com.sun.corba.se.spi.servicecontext.ORBVersionServiceContext ;
  66. import com.sun.corba.se.spi.servicecontext.MaxStreamFormatVersionServiceContext ;
  67. import com.sun.corba.se.impl.logging.ORBUtilSystemException ;
  68. import com.sun.corba.se.impl.transport.SocketOrChannelAcceptorImpl;
  69. // XXX This should go away once we get rid of the port exchange for ORBD
  70. import com.sun.corba.se.spi.legacy.connection.LegacyServerSocketEndPointInfo;
  71. import com.sun.corba.se.impl.legacy.connection.SocketFactoryAcceptorImpl;
  72. import com.sun.corba.se.impl.legacy.connection.SocketFactoryContactInfoListImpl;
  73. import com.sun.corba.se.impl.legacy.connection.USLPort;
  74. // XXX These should move to SPI
  75. import com.sun.corba.se.impl.orbutil.ORBConstants ;
  76. // XXX This needs an SPI
  77. import com.sun.corba.se.impl.dynamicany.DynAnyFactoryImpl ;
  78. public class ORBConfiguratorImpl implements ORBConfigurator {
  79. private ORBUtilSystemException wrapper ;
  80. public static class ConfigParser extends ParserImplBase {
  81. public Class[] userConfigurators = null ;
  82. public PropertyParser makeParser()
  83. {
  84. PropertyParser parser = new PropertyParser() ;
  85. Operation action = OperationFactory.compose(
  86. OperationFactory.suffixAction(),
  87. OperationFactory.classAction()
  88. ) ;
  89. parser.addPrefix( ORBConstants.SUN_PREFIX + "ORBUserConfigurators",
  90. action, "userConfigurators", Class.class ) ;
  91. return parser ;
  92. }
  93. }
  94. public void configure( DataCollector collector, ORB orb )
  95. {
  96. ORB theOrb = orb ;
  97. wrapper = ORBUtilSystemException.get( orb, CORBALogDomains.ORB_LIFECYCLE ) ;
  98. initObjectCopiers( theOrb ) ;
  99. initIORFinders( theOrb ) ;
  100. theOrb.setClientDelegateFactory(
  101. // REVISIT: this should be ProtocolDefault.
  102. TransportDefault.makeClientDelegateFactory( theOrb )) ;
  103. initializeTransport(theOrb) ;
  104. initializeNaming( theOrb ) ;
  105. initServiceContextRegistry( theOrb ) ;
  106. initRequestDispatcherRegistry( theOrb ) ;
  107. registerInitialReferences( theOrb ) ;
  108. persistentServerInitialization( theOrb ) ;
  109. runUserConfigurators( collector, theOrb ) ;
  110. }
  111. private void runUserConfigurators( DataCollector collector, ORB orb )
  112. {
  113. // Run any pluggable configurators. This is a lot like
  114. // ORBInitializers, only it uses the internal ORB and has
  115. // access to all data for parsing.
  116. ConfigParser parser = new ConfigParser() ;
  117. parser.init( collector ) ;
  118. if (parser.userConfigurators != null) {
  119. for (int ctr=0; ctr<parser.userConfigurators.length; ctr++) {
  120. Class cls = parser.userConfigurators[ctr] ;
  121. try {
  122. ORBConfigurator config = (ORBConfigurator)(cls.newInstance()) ;
  123. config.configure( collector, orb ) ;
  124. } catch (Exception exc) {
  125. // XXX Log this exception
  126. // ignore this for now: a bad user configurator does nothing
  127. }
  128. }
  129. }
  130. }
  131. private void persistentServerInitialization( ORB orb )
  132. {
  133. ORBData data = orb.getORBData() ;
  134. // determine the ORBD port so that persistent objrefs can be
  135. // created.
  136. if (data.getServerIsORBActivated()) {
  137. try {
  138. Locator locator = LocatorHelper.narrow(
  139. orb.resolve_initial_references(
  140. ORBConstants.SERVER_LOCATOR_NAME )) ;
  141. Activator activator = ActivatorHelper.narrow(
  142. orb.resolve_initial_references(
  143. ORBConstants.SERVER_ACTIVATOR_NAME )) ;
  144. Collection serverEndpoints =
  145. orb.getCorbaTransportManager().getAcceptors(null, null);
  146. EndPointInfo[] endpointList =
  147. new EndPointInfo[serverEndpoints.size()];
  148. Iterator iterator = serverEndpoints.iterator();
  149. int i = 0 ;
  150. while (iterator.hasNext()) {
  151. Object n = iterator.next();
  152. if (! (n instanceof LegacyServerSocketEndPointInfo)) {
  153. continue;
  154. }
  155. LegacyServerSocketEndPointInfo ep =
  156. (LegacyServerSocketEndPointInfo) n;
  157. // REVISIT - use exception instead of -1.
  158. int port = locator.getEndpoint(ep.getType());
  159. if (port == -1) {
  160. port = locator.getEndpoint(SocketInfo.IIOP_CLEAR_TEXT);
  161. if (port == -1) {
  162. throw new Exception(
  163. "ORBD must support IIOP_CLEAR_TEXT");
  164. }
  165. }
  166. ep.setLocatorPort(port);
  167. endpointList[i++] =
  168. new EndPointInfo(ep.getType(), ep.getPort());
  169. }
  170. activator.registerEndpoints(
  171. data.getPersistentServerId(), data.getORBId(),
  172. endpointList);
  173. } catch (Exception ex) {
  174. throw wrapper.persistentServerInitError(
  175. CompletionStatus.COMPLETED_MAYBE, ex ) ;
  176. }
  177. }
  178. }
  179. /**
  180. * This is made somewhat complex because we are currently supporting
  181. * the ContactInfoList/Acceptor *AND* the legacy SocketFactory
  182. * transport architecture.
  183. */
  184. private void initializeTransport(final ORB orb)
  185. {
  186. ORBData od = orb.getORBData();
  187. CorbaContactInfoListFactory contactInfoListFactory =
  188. od.getCorbaContactInfoListFactory();
  189. Acceptor[] acceptors = od.getAcceptors();
  190. // BEGIN Legacy
  191. ORBSocketFactory legacySocketFactory = od.getLegacySocketFactory();
  192. USLPort[] uslPorts = od.getUserSpecifiedListenPorts() ;
  193. setLegacySocketFactoryORB(orb, legacySocketFactory);
  194. // END Legacy
  195. //
  196. // Check for incorrect configuration.
  197. //
  198. if (legacySocketFactory != null && contactInfoListFactory != null) {
  199. throw wrapper.socketFactoryAndContactInfoListAtSameTime();
  200. }
  201. if (acceptors.length != 0 && legacySocketFactory != null) {
  202. throw wrapper.acceptorsAndLegacySocketFactoryAtSameTime();
  203. }
  204. //
  205. // Client and Server side setup.
  206. //
  207. od.getSocketFactory().setORB(orb);
  208. //
  209. // Set up client side.
  210. //
  211. if (legacySocketFactory != null) {
  212. // BEGIN Legacy
  213. // Since the user specified a legacy socket factory we need to
  214. // use a ContactInfoList that will use the legacy socket factory.
  215. contactInfoListFactory =
  216. new CorbaContactInfoListFactory() {
  217. public void setORB(ORB orb) { }
  218. public CorbaContactInfoList create( IOR ior ) {
  219. return new SocketFactoryContactInfoListImpl(
  220. orb, ior);
  221. }
  222. };
  223. // END Legacy
  224. } else if (contactInfoListFactory != null) {
  225. // The user specified an explicit ContactInfoListFactory.
  226. contactInfoListFactory.setORB(orb);
  227. } else {
  228. // Use the default.
  229. contactInfoListFactory =
  230. TransportDefault.makeCorbaContactInfoListFactory(orb);
  231. }
  232. orb.setCorbaContactInfoListFactory(contactInfoListFactory);
  233. //
  234. // Set up server side.
  235. //
  236. //
  237. // Maybe allocate the Legacy default listener.
  238. //
  239. // If old legacy properties set, or there are no explicit
  240. // acceptors then register a default listener. Type of
  241. // default listener depends on presence of legacy socket factory.
  242. //
  243. // Note: this must happen *BEFORE* registering explicit acceptors.
  244. //
  245. // BEGIN Legacy
  246. int port = -1;
  247. if (od.getORBServerPort() != 0) {
  248. port = od.getORBServerPort();
  249. } else if (od.getPersistentPortInitialized()) {
  250. port = od.getPersistentServerPort();
  251. } else if (acceptors.length == 0) {
  252. port = 0;
  253. }
  254. if (port != -1) {
  255. createAndRegisterAcceptor(orb, legacySocketFactory, port,
  256. LegacyServerSocketEndPointInfo.DEFAULT_ENDPOINT,
  257. SocketInfo.IIOP_CLEAR_TEXT);
  258. }
  259. // END Legacy
  260. for (int i = 0; i < acceptors.length; i++) {
  261. orb.getCorbaTransportManager().registerAcceptor(acceptors[i]);
  262. }
  263. // BEGIN Legacy
  264. // Allocate user listeners.
  265. USLPort[] ports = od.getUserSpecifiedListenPorts() ;
  266. if (ports != null) {
  267. for (int i = 0; i < ports.length; i++) {
  268. createAndRegisterAcceptor(
  269. orb, legacySocketFactory, ports[i].getPort(),
  270. LegacyServerSocketEndPointInfo.NO_NAME,
  271. ports[i].getType());
  272. }
  273. }
  274. // END Legacy
  275. }
  276. /*
  277. * Legacy: name.
  278. */
  279. // REVISIT: see ORBD. make factory in TransportDefault.
  280. private void createAndRegisterAcceptor(ORB orb,
  281. ORBSocketFactory legacySocketFactory,
  282. int port, String name, String type)
  283. {
  284. Acceptor acceptor;
  285. if (legacySocketFactory == null) {
  286. acceptor =
  287. new SocketOrChannelAcceptorImpl(orb, port, name, type);
  288. } else {
  289. acceptor =
  290. new SocketFactoryAcceptorImpl(orb, port, name, type);
  291. }
  292. orb.getTransportManager().registerAcceptor(acceptor);
  293. }
  294. private void setLegacySocketFactoryORB(
  295. final ORB orb, final ORBSocketFactory legacySocketFactory)
  296. {
  297. if (legacySocketFactory == null) {
  298. return;
  299. }
  300. // Note: the createServerSocket and createSocket methods on the
  301. // DefaultSocketFactory need to get data from the ORB but
  302. // we cannot change the interface. So set the ORB (if it's ours)
  303. // by reflection.
  304. try {
  305. AccessController.doPrivileged(
  306. new PrivilegedExceptionAction() {
  307. public Object run()
  308. throws InstantiationException, IllegalAccessException
  309. {
  310. try {
  311. Class[] params = { ORB.class };
  312. Method method =
  313. legacySocketFactory.getClass().getMethod(
  314. "setORB", params);
  315. Object[] args = { orb };
  316. method.invoke(legacySocketFactory, args);
  317. } catch (NoSuchMethodException e) {
  318. // NOTE: If there is no method then it
  319. // is not ours - so ignore it.
  320. ;
  321. } catch (IllegalAccessException e) {
  322. RuntimeException rte = new RuntimeException();
  323. rte.initCause(e);
  324. throw rte;
  325. } catch (InvocationTargetException e) {
  326. RuntimeException rte = new RuntimeException();
  327. rte.initCause(e);
  328. throw rte;
  329. }
  330. return null;
  331. }
  332. }
  333. );
  334. } catch (Throwable t) {
  335. throw wrapper.unableToSetSocketFactoryOrb(t);
  336. }
  337. }
  338. private void initializeNaming( ORB orb )
  339. {
  340. LocalResolver localResolver = ResolverDefault.makeLocalResolver() ;
  341. orb.setLocalResolver( localResolver ) ;
  342. Resolver bootResolver = ResolverDefault.makeBootstrapResolver( orb,
  343. orb.getORBData().getORBInitialHost(),
  344. orb.getORBData().getORBInitialPort() ) ;
  345. Operation urlOperation = ResolverDefault.makeINSURLOperation( orb,
  346. bootResolver ) ;
  347. orb.setURLOperation( urlOperation ) ;
  348. Resolver irResolver = ResolverDefault.makeORBInitRefResolver( urlOperation,
  349. orb.getORBData().getORBInitialReferences() ) ;
  350. Resolver dirResolver = ResolverDefault.makeORBDefaultInitRefResolver(
  351. urlOperation, orb.getORBData().getORBDefaultInitialReference() ) ;
  352. Resolver resolver =
  353. ResolverDefault.makeCompositeResolver( localResolver,
  354. ResolverDefault.makeCompositeResolver( irResolver,
  355. ResolverDefault.makeCompositeResolver( dirResolver,
  356. bootResolver ) ) ) ;
  357. orb.setResolver( resolver ) ;
  358. }
  359. private void initServiceContextRegistry( ORB orb )
  360. {
  361. ServiceContextRegistry scr = orb.getServiceContextRegistry() ;
  362. scr.register( UEInfoServiceContext.class ) ;
  363. scr.register( CodeSetServiceContext.class ) ;
  364. scr.register( SendingContextServiceContext.class ) ;
  365. scr.register( ORBVersionServiceContext.class ) ;
  366. scr.register( MaxStreamFormatVersionServiceContext.class ) ;
  367. }
  368. private void registerInitialReferences( final ORB orb )
  369. {
  370. // Register the Dynamic Any factory
  371. Closure closure = new Closure() {
  372. public java.lang.Object evaluate() {
  373. return new DynAnyFactoryImpl( orb ) ;
  374. }
  375. } ;
  376. Closure future = ClosureFactory.makeFuture( closure ) ;
  377. orb.getLocalResolver().register( ORBConstants.DYN_ANY_FACTORY_NAME,
  378. future ) ;
  379. }
  380. private static final int ORB_STREAM = 0 ;
  381. private void initObjectCopiers( ORB orb )
  382. {
  383. // No optimization or policy selection here.
  384. ObjectCopierFactory orbStream =
  385. CopyobjectDefaults.makeORBStreamObjectCopierFactory( orb ) ;
  386. CopierManager cm = orb.getCopierManager() ;
  387. cm.setDefaultId( ORB_STREAM ) ;
  388. cm.registerObjectCopierFactory( orbStream, ORB_STREAM ) ;
  389. }
  390. private void initIORFinders( ORB orb )
  391. {
  392. IdentifiableFactoryFinder profFinder =
  393. orb.getTaggedProfileFactoryFinder() ;
  394. profFinder.registerFactory( IIOPFactories.makeIIOPProfileFactory() ) ;
  395. IdentifiableFactoryFinder profTempFinder =
  396. orb.getTaggedProfileTemplateFactoryFinder() ;
  397. profTempFinder.registerFactory(
  398. IIOPFactories.makeIIOPProfileTemplateFactory() ) ;
  399. IdentifiableFactoryFinder compFinder =
  400. orb.getTaggedComponentFactoryFinder() ;
  401. compFinder.registerFactory(
  402. IIOPFactories.makeCodeSetsComponentFactory() ) ;
  403. compFinder.registerFactory(
  404. IIOPFactories.makeJavaCodebaseComponentFactory() ) ;
  405. compFinder.registerFactory(
  406. IIOPFactories.makeORBTypeComponentFactory() ) ;
  407. compFinder.registerFactory(
  408. IIOPFactories.makeMaxStreamFormatVersionComponentFactory() ) ;
  409. compFinder.registerFactory(
  410. IIOPFactories.makeAlternateIIOPAddressComponentFactory() ) ;
  411. compFinder.registerFactory(
  412. IIOPFactories.makeRequestPartitioningComponentFactory() ) ;
  413. compFinder.registerFactory(
  414. IIOPFactories.makeJavaSerializationComponentFactory());
  415. // Register the ValueFactory instances for ORT
  416. IORFactories.registerValueFactories( orb ) ;
  417. // Register an ObjectKeyFactory
  418. orb.setObjectKeyFactory( IORFactories.makeObjectKeyFactory(orb) ) ;
  419. }
  420. private void initRequestDispatcherRegistry( ORB orb )
  421. {
  422. RequestDispatcherRegistry scr = orb.getRequestDispatcherRegistry() ;
  423. // register client subcontracts
  424. ClientRequestDispatcher csub =
  425. RequestDispatcherDefault.makeClientRequestDispatcher() ;
  426. scr.registerClientRequestDispatcher( csub,
  427. ORBConstants.TOA_SCID ) ;
  428. scr.registerClientRequestDispatcher( csub,
  429. ORBConstants.TRANSIENT_SCID ) ;
  430. scr.registerClientRequestDispatcher( csub,
  431. ORBConstants.PERSISTENT_SCID ) ;
  432. scr.registerClientRequestDispatcher( csub,
  433. ORBConstants.SC_TRANSIENT_SCID ) ;
  434. scr.registerClientRequestDispatcher( csub,
  435. ORBConstants.SC_PERSISTENT_SCID ) ;
  436. scr.registerClientRequestDispatcher( csub,
  437. ORBConstants.IISC_TRANSIENT_SCID ) ;
  438. scr.registerClientRequestDispatcher( csub,
  439. ORBConstants.IISC_PERSISTENT_SCID ) ;
  440. scr.registerClientRequestDispatcher( csub,
  441. ORBConstants.MINSC_TRANSIENT_SCID ) ;
  442. scr.registerClientRequestDispatcher( csub,
  443. ORBConstants.MINSC_PERSISTENT_SCID ) ;
  444. // register server delegates
  445. CorbaServerRequestDispatcher sd =
  446. RequestDispatcherDefault.makeServerRequestDispatcher( orb );
  447. scr.registerServerRequestDispatcher( sd,
  448. ORBConstants.TOA_SCID ) ;
  449. scr.registerServerRequestDispatcher( sd,
  450. ORBConstants.TRANSIENT_SCID ) ;
  451. scr.registerServerRequestDispatcher( sd,
  452. ORBConstants.PERSISTENT_SCID ) ;
  453. scr.registerServerRequestDispatcher( sd,
  454. ORBConstants.SC_TRANSIENT_SCID ) ;
  455. scr.registerServerRequestDispatcher( sd,
  456. ORBConstants.SC_PERSISTENT_SCID ) ;
  457. scr.registerServerRequestDispatcher( sd,
  458. ORBConstants.IISC_TRANSIENT_SCID ) ;
  459. scr.registerServerRequestDispatcher( sd,
  460. ORBConstants.IISC_PERSISTENT_SCID ) ;
  461. scr.registerServerRequestDispatcher( sd,
  462. ORBConstants.MINSC_TRANSIENT_SCID ) ;
  463. scr.registerServerRequestDispatcher( sd,
  464. ORBConstants.MINSC_PERSISTENT_SCID ) ;
  465. orb.setINSDelegate(
  466. RequestDispatcherDefault.makeINSServerRequestDispatcher( orb ) ) ;
  467. // register local client subcontracts
  468. LocalClientRequestDispatcherFactory lcsf =
  469. RequestDispatcherDefault.makeJIDLLocalClientRequestDispatcherFactory(
  470. orb ) ;
  471. scr.registerLocalClientRequestDispatcherFactory( lcsf,
  472. ORBConstants.TOA_SCID ) ;
  473. lcsf =
  474. RequestDispatcherDefault.makePOALocalClientRequestDispatcherFactory(
  475. orb ) ;
  476. scr.registerLocalClientRequestDispatcherFactory( lcsf,
  477. ORBConstants.TRANSIENT_SCID ) ;
  478. scr.registerLocalClientRequestDispatcherFactory( lcsf,
  479. ORBConstants.PERSISTENT_SCID ) ;
  480. lcsf = RequestDispatcherDefault.
  481. makeFullServantCacheLocalClientRequestDispatcherFactory( orb ) ;
  482. scr.registerLocalClientRequestDispatcherFactory( lcsf,
  483. ORBConstants.SC_TRANSIENT_SCID ) ;
  484. scr.registerLocalClientRequestDispatcherFactory( lcsf,
  485. ORBConstants.SC_PERSISTENT_SCID ) ;
  486. lcsf = RequestDispatcherDefault.
  487. makeInfoOnlyServantCacheLocalClientRequestDispatcherFactory( orb ) ;
  488. scr.registerLocalClientRequestDispatcherFactory( lcsf,
  489. ORBConstants.IISC_TRANSIENT_SCID ) ;
  490. scr.registerLocalClientRequestDispatcherFactory( lcsf,
  491. ORBConstants.IISC_PERSISTENT_SCID ) ;
  492. lcsf = RequestDispatcherDefault.
  493. makeMinimalServantCacheLocalClientRequestDispatcherFactory( orb ) ;
  494. scr.registerLocalClientRequestDispatcherFactory( lcsf,
  495. ORBConstants.MINSC_TRANSIENT_SCID ) ;
  496. scr.registerLocalClientRequestDispatcherFactory( lcsf,
  497. ORBConstants.MINSC_PERSISTENT_SCID ) ;
  498. /* Register the server delegate that implements the ancient bootstrap
  499. * naming protocol. This takes an object key of either "INIT" or
  500. * "TINI" to allow for big or little endian implementations.
  501. */
  502. CorbaServerRequestDispatcher bootsd =
  503. RequestDispatcherDefault.makeBootstrapServerRequestDispatcher(
  504. orb ) ;
  505. scr.registerServerRequestDispatcher( bootsd, "INIT" ) ;
  506. scr.registerServerRequestDispatcher( bootsd, "TINI" ) ;
  507. // Register object adapter factories
  508. ObjectAdapterFactory oaf = OADefault.makeTOAFactory( orb ) ;
  509. scr.registerObjectAdapterFactory( oaf, ORBConstants.TOA_SCID ) ;
  510. oaf = OADefault.makePOAFactory( orb ) ;
  511. scr.registerObjectAdapterFactory( oaf, ORBConstants.TRANSIENT_SCID ) ;
  512. scr.registerObjectAdapterFactory( oaf, ORBConstants.PERSISTENT_SCID ) ;
  513. scr.registerObjectAdapterFactory( oaf, ORBConstants.SC_TRANSIENT_SCID ) ;
  514. scr.registerObjectAdapterFactory( oaf, ORBConstants.SC_PERSISTENT_SCID ) ;
  515. scr.registerObjectAdapterFactory( oaf, ORBConstants.IISC_TRANSIENT_SCID ) ;
  516. scr.registerObjectAdapterFactory( oaf, ORBConstants.IISC_PERSISTENT_SCID ) ;
  517. scr.registerObjectAdapterFactory( oaf, ORBConstants.MINSC_TRANSIENT_SCID ) ;
  518. scr.registerObjectAdapterFactory( oaf, ORBConstants.MINSC_PERSISTENT_SCID ) ;
  519. }
  520. }
  521. // End of file.