KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > corba > se > impl > orb > ORBConfiguratorImpl


1 /*
2  * @(#)ORBConfiguratorImpl.java 1.60 04/06/21
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package com.sun.corba.se.impl.orb ;
9
10 import java.lang.reflect.InvocationTargetException JavaDoc;
11 import java.lang.reflect.Method JavaDoc;
12 import java.net.InetAddress JavaDoc ;
13 import java.security.PrivilegedAction JavaDoc ;
14 import java.security.PrivilegedExceptionAction JavaDoc ;
15 import java.security.AccessController JavaDoc ;
16 import java.util.Collection JavaDoc ;
17 import java.util.Iterator JavaDoc ;
18
19 import org.omg.CORBA.CompletionStatus JavaDoc ;
20 import org.omg.CORBA.portable.ValueFactory JavaDoc ;
21
22 import com.sun.corba.se.pept.protocol.ClientRequestDispatcher ;
23 import com.sun.corba.se.pept.transport.Acceptor;
24
25 import com.sun.corba.se.spi.activation.Locator ;
26 import com.sun.corba.se.spi.activation.Activator ;
27 import com.sun.corba.se.spi.activation.LocatorHelper ;
28 import com.sun.corba.se.spi.activation.ActivatorHelper ;
29 import com.sun.corba.se.spi.activation.EndPointInfo ;
30
31 import com.sun.corba.se.spi.copyobject.ObjectCopierFactory ;
32 import com.sun.corba.se.spi.copyobject.CopyobjectDefaults ;
33 import com.sun.corba.se.spi.copyobject.CopierManager ;
34
35 import com.sun.corba.se.spi.ior.IdentifiableFactoryFinder ;
36 import com.sun.corba.se.spi.ior.IOR;
37 import com.sun.corba.se.spi.ior.IORFactories ;
38
39 import com.sun.corba.se.spi.ior.iiop.IIOPFactories ;
40
41 import com.sun.corba.se.spi.legacy.connection.ORBSocketFactory;
42
43 import com.sun.corba.se.spi.logging.CORBALogDomains ;
44
45 import com.sun.corba.se.spi.oa.OADefault ;
46 import com.sun.corba.se.spi.oa.ObjectAdapter ;
47 import com.sun.corba.se.spi.oa.ObjectAdapterFactory ;
48
49 import com.sun.corba.se.spi.orb.Operation ;
50 import com.sun.corba.se.spi.orb.OperationFactory ;
51 import com.sun.corba.se.spi.orb.ORBData ;
52 import com.sun.corba.se.spi.orb.DataCollector ;
53 import com.sun.corba.se.spi.orb.ORBConfigurator ;
54 import com.sun.corba.se.spi.orb.ParserImplBase ;
55 import com.sun.corba.se.spi.orb.PropertyParser ;
56 import com.sun.corba.se.spi.orb.ORB ;
57
58 import com.sun.corba.se.spi.orbutil.closure.Closure ;
59 import com.sun.corba.se.spi.orbutil.closure.ClosureFactory ;
60
61 import com.sun.corba.se.spi.protocol.RequestDispatcherRegistry ;
62 import com.sun.corba.se.spi.protocol.CorbaServerRequestDispatcher ;
63 import com.sun.corba.se.spi.protocol.RequestDispatcherDefault ;
64 import com.sun.corba.se.spi.protocol.LocalClientRequestDispatcherFactory ;
65
66 import com.sun.corba.se.spi.resolver.LocalResolver ;
67 import com.sun.corba.se.spi.resolver.Resolver ;
68 import com.sun.corba.se.spi.resolver.ResolverDefault ;
69
70 import com.sun.corba.se.spi.transport.CorbaContactInfoList;
71 import com.sun.corba.se.spi.transport.CorbaContactInfoListFactory;
72 import com.sun.corba.se.spi.transport.SocketInfo;
73 import com.sun.corba.se.spi.transport.TransportDefault ;
74
75 import com.sun.corba.se.spi.presentation.rmi.PresentationManager ;
76 import com.sun.corba.se.spi.presentation.rmi.PresentationDefaults ;
77
78 import com.sun.corba.se.spi.servicecontext.ServiceContext ;
79 import com.sun.corba.se.spi.servicecontext.ServiceContextRegistry ;
80 import com.sun.corba.se.spi.servicecontext.UEInfoServiceContext ;
81 import com.sun.corba.se.spi.servicecontext.CodeSetServiceContext ;
82 import com.sun.corba.se.spi.servicecontext.SendingContextServiceContext ;
83 import com.sun.corba.se.spi.servicecontext.ORBVersionServiceContext ;
84 import com.sun.corba.se.spi.servicecontext.MaxStreamFormatVersionServiceContext ;
85 import com.sun.corba.se.impl.logging.ORBUtilSystemException ;
86 import com.sun.corba.se.impl.transport.SocketOrChannelAcceptorImpl;
87
88 // XXX This should go away once we get rid of the port exchange for ORBD
89
import com.sun.corba.se.spi.legacy.connection.LegacyServerSocketEndPointInfo;
90 import com.sun.corba.se.impl.legacy.connection.SocketFactoryAcceptorImpl;
91 import com.sun.corba.se.impl.legacy.connection.SocketFactoryContactInfoListImpl;
92 import com.sun.corba.se.impl.legacy.connection.USLPort;
93
94 // XXX These should move to SPI
95
import com.sun.corba.se.impl.orbutil.ORBConstants ;
96
97 // XXX This needs an SPI
98
import com.sun.corba.se.impl.dynamicany.DynAnyFactoryImpl ;
99
100 public class ORBConfiguratorImpl implements ORBConfigurator {
101     private ORBUtilSystemException wrapper ;
102
103     public static class ConfigParser extends ParserImplBase {
104     public Class JavaDoc[] userConfigurators = null ;
105
106     public PropertyParser makeParser()
107     {
108         PropertyParser parser = new PropertyParser() ;
109         Operation action = OperationFactory.compose(
110         OperationFactory.suffixAction(),
111         OperationFactory.classAction()
112         ) ;
113         parser.addPrefix( ORBConstants.SUN_PREFIX + "ORBUserConfigurators",
114         action, "userConfigurators", Class JavaDoc.class ) ;
115         return parser ;
116     }
117     }
118
119     public void configure( DataCollector collector, ORB orb )
120     {
121     ORB theOrb = orb ;
122     wrapper = ORBUtilSystemException.get( orb, CORBALogDomains.ORB_LIFECYCLE ) ;
123
124     initObjectCopiers( theOrb ) ;
125     initIORFinders( theOrb ) ;
126
127     theOrb.setClientDelegateFactory(
128             // REVISIT: this should be ProtocolDefault.
129
TransportDefault.makeClientDelegateFactory( theOrb )) ;
130
131     initializeTransport(theOrb) ;
132
133     initializeNaming( theOrb ) ;
134     initServiceContextRegistry( theOrb ) ;
135     initRequestDispatcherRegistry( theOrb ) ;
136     registerInitialReferences( theOrb ) ;
137
138     persistentServerInitialization( theOrb ) ;
139
140     runUserConfigurators( collector, theOrb ) ;
141     }
142
143     private void runUserConfigurators( DataCollector collector, ORB orb )
144     {
145     // Run any pluggable configurators. This is a lot like
146
// ORBInitializers, only it uses the internal ORB and has
147
// access to all data for parsing.
148
ConfigParser parser = new ConfigParser() ;
149     parser.init( collector ) ;
150     if (parser.userConfigurators != null) {
151         for (int ctr=0; ctr<parser.userConfigurators.length; ctr++) {
152         Class JavaDoc cls = parser.userConfigurators[ctr] ;
153         try {
154             ORBConfigurator config = (ORBConfigurator)(cls.newInstance()) ;
155             config.configure( collector, orb ) ;
156         } catch (Exception JavaDoc exc) {
157             // XXX Log this exception
158
// ignore this for now: a bad user configurator does nothing
159
}
160         }
161     }
162     }
163
164     private void persistentServerInitialization( ORB orb )
165     {
166     ORBData data = orb.getORBData() ;
167
168     // determine the ORBD port so that persistent objrefs can be
169
// created.
170
if (data.getServerIsORBActivated()) {
171         try {
172                 Locator locator = LocatorHelper.narrow(
173             orb.resolve_initial_references(
174             ORBConstants.SERVER_LOCATOR_NAME )) ;
175                 Activator activator = ActivatorHelper.narrow(
176             orb.resolve_initial_references(
177             ORBConstants.SERVER_ACTIVATOR_NAME )) ;
178         Collection JavaDoc serverEndpoints =
179             orb.getCorbaTransportManager().getAcceptors(null, null);
180         EndPointInfo[] endpointList =
181             new EndPointInfo[serverEndpoints.size()];
182         Iterator JavaDoc iterator = serverEndpoints.iterator();
183         int i = 0 ;
184         while (iterator.hasNext()) {
185             Object JavaDoc n = iterator.next();
186             if (! (n instanceof LegacyServerSocketEndPointInfo)) {
187             continue;
188             }
189             LegacyServerSocketEndPointInfo ep =
190             (LegacyServerSocketEndPointInfo) n;
191             // REVISIT - use exception instead of -1.
192
int port = locator.getEndpoint(ep.getType());
193             if (port == -1) {
194             port = locator.getEndpoint(SocketInfo.IIOP_CLEAR_TEXT);
195             if (port == -1) {
196                 throw new Exception JavaDoc(
197                 "ORBD must support IIOP_CLEAR_TEXT");
198             }
199             }
200
201             ep.setLocatorPort(port);
202             
203             endpointList[i++] =
204             new EndPointInfo(ep.getType(), ep.getPort());
205         }
206
207             activator.registerEndpoints(
208             data.getPersistentServerId(), data.getORBId(),
209             endpointList);
210         } catch (Exception JavaDoc ex) {
211         throw wrapper.persistentServerInitError(
212             CompletionStatus.COMPLETED_MAYBE, ex ) ;
213         }
214     }
215     }
216
217     /**
218      * This is made somewhat complex because we are currently supporting
219      * the ContactInfoList/Acceptor *AND* the legacy SocketFactory
220      * transport architecture.
221      */

222     private void initializeTransport(final ORB orb)
223     {
224     ORBData od = orb.getORBData();
225
226     CorbaContactInfoListFactory contactInfoListFactory =
227         od.getCorbaContactInfoListFactory();
228     Acceptor[] acceptors = od.getAcceptors();
229
230     // BEGIN Legacy
231
ORBSocketFactory legacySocketFactory = od.getLegacySocketFactory();
232     USLPort[] uslPorts = od.getUserSpecifiedListenPorts() ;
233     setLegacySocketFactoryORB(orb, legacySocketFactory);
234     // END Legacy
235

236     //
237
// Check for incorrect configuration.
238
//
239

240     if (legacySocketFactory != null && contactInfoListFactory != null) {
241         throw wrapper.socketFactoryAndContactInfoListAtSameTime();
242     }
243
244     if (acceptors.length != 0 && legacySocketFactory != null) {
245         throw wrapper.acceptorsAndLegacySocketFactoryAtSameTime();
246     }
247
248
249     //
250
// Client and Server side setup.
251
//
252

253     od.getSocketFactory().setORB(orb);
254
255     //
256
// Set up client side.
257
//
258

259     if (legacySocketFactory != null) {
260         // BEGIN Legacy
261
// Since the user specified a legacy socket factory we need to
262
// use a ContactInfoList that will use the legacy socket factory.
263
contactInfoListFactory =
264         new CorbaContactInfoListFactory() {
265             public void setORB(ORB orb) { }
266             public CorbaContactInfoList create( IOR ior ) {
267                 return new SocketFactoryContactInfoListImpl(
268                                 orb, ior);
269             }
270             };
271         // END Legacy
272
} else if (contactInfoListFactory != null) {
273         // The user specified an explicit ContactInfoListFactory.
274
contactInfoListFactory.setORB(orb);
275     } else {
276         // Use the default.
277
contactInfoListFactory =
278             TransportDefault.makeCorbaContactInfoListFactory(orb);
279     }
280     orb.setCorbaContactInfoListFactory(contactInfoListFactory);
281
282     //
283
// Set up server side.
284
//
285

286     //
287
// Maybe allocate the Legacy default listener.
288
//
289
// If old legacy properties set, or there are no explicit
290
// acceptors then register a default listener. Type of
291
// default listener depends on presence of legacy socket factory.
292
//
293
// Note: this must happen *BEFORE* registering explicit acceptors.
294
//
295

296     // BEGIN Legacy
297
int port = -1;
298     if (od.getORBServerPort() != 0) {
299         port = od.getORBServerPort();
300     } else if (od.getPersistentPortInitialized()) {
301         port = od.getPersistentServerPort();
302     } else if (acceptors.length == 0) {
303         port = 0;
304     }
305     if (port != -1) {
306         createAndRegisterAcceptor(orb, legacySocketFactory, port,
307             LegacyServerSocketEndPointInfo.DEFAULT_ENDPOINT,
308             SocketInfo.IIOP_CLEAR_TEXT);
309     }
310     // END Legacy
311

312     for (int i = 0; i < acceptors.length; i++) {
313         orb.getCorbaTransportManager().registerAcceptor(acceptors[i]);
314     }
315
316     // BEGIN Legacy
317
// Allocate user listeners.
318
USLPort[] ports = od.getUserSpecifiedListenPorts() ;
319     if (ports != null) {
320         for (int i = 0; i < ports.length; i++) {
321         createAndRegisterAcceptor(
322                     orb, legacySocketFactory, ports[i].getPort(),
323             LegacyServerSocketEndPointInfo.NO_NAME,
324             ports[i].getType());
325         }
326     }
327     // END Legacy
328
}
329
330     /*
331      * Legacy: name.
332      */

333     // REVISIT: see ORBD. make factory in TransportDefault.
334
private void createAndRegisterAcceptor(ORB orb,
335                        ORBSocketFactory legacySocketFactory,
336                        int port, String JavaDoc name, String JavaDoc type)
337     {
338     Acceptor acceptor;
339     if (legacySocketFactory == null) {
340         acceptor =
341         new SocketOrChannelAcceptorImpl(orb, port, name, type);
342     } else {
343         acceptor =
344         new SocketFactoryAcceptorImpl(orb, port, name, type);
345     }
346     orb.getTransportManager().registerAcceptor(acceptor);
347     }
348
349     private void setLegacySocketFactoryORB(
350         final ORB orb, final ORBSocketFactory legacySocketFactory)
351     {
352     if (legacySocketFactory == null) {
353         return;
354     }
355
356     // Note: the createServerSocket and createSocket methods on the
357
// DefaultSocketFactory need to get data from the ORB but
358
// we cannot change the interface. So set the ORB (if it's ours)
359
// by reflection.
360

361     try {
362             AccessController.doPrivileged(
363                 new PrivilegedExceptionAction JavaDoc() {
364                 public Object JavaDoc run()
365                 throws InstantiationException JavaDoc, IllegalAccessException JavaDoc
366             {
367             try {
368                 Class JavaDoc[] params = { ORB.class };
369                 Method JavaDoc method =
370                 legacySocketFactory.getClass().getMethod(
371                                   "setORB", params);
372                 Object JavaDoc[] args = { orb };
373                 method.invoke(legacySocketFactory, args);
374             } catch (NoSuchMethodException JavaDoc e) {
375                 // NOTE: If there is no method then it
376
// is not ours - so ignore it.
377
;
378             } catch (IllegalAccessException JavaDoc e) {
379                 RuntimeException JavaDoc rte = new RuntimeException JavaDoc();
380                 rte.initCause(e);
381                 throw rte;
382             } catch (InvocationTargetException JavaDoc e) {
383                 RuntimeException JavaDoc rte = new RuntimeException JavaDoc();
384                 rte.initCause(e);
385                 throw rte;
386             }
387             return null;
388             }
389         }
390         );
391     } catch (Throwable JavaDoc t) {
392         throw wrapper.unableToSetSocketFactoryOrb(t);
393     }
394     }
395
396     private void initializeNaming( ORB orb )
397     {
398     LocalResolver localResolver = ResolverDefault.makeLocalResolver() ;
399     orb.setLocalResolver( localResolver ) ;
400
401     Resolver bootResolver = ResolverDefault.makeBootstrapResolver( orb,
402         orb.getORBData().getORBInitialHost(),
403         orb.getORBData().getORBInitialPort() ) ;
404
405     Operation urlOperation = ResolverDefault.makeINSURLOperation( orb,
406         bootResolver ) ;
407     orb.setURLOperation( urlOperation ) ;
408
409     Resolver irResolver = ResolverDefault.makeORBInitRefResolver( urlOperation,
410         orb.getORBData().getORBInitialReferences() ) ;
411
412     Resolver dirResolver = ResolverDefault.makeORBDefaultInitRefResolver(
413         urlOperation, orb.getORBData().getORBDefaultInitialReference() ) ;
414
415     Resolver resolver =
416         ResolverDefault.makeCompositeResolver( localResolver,
417         ResolverDefault.makeCompositeResolver( irResolver,
418             ResolverDefault.makeCompositeResolver( dirResolver,
419             bootResolver ) ) ) ;
420     orb.setResolver( resolver ) ;
421     }
422
423     private void initServiceContextRegistry( ORB orb )
424     {
425     ServiceContextRegistry scr = orb.getServiceContextRegistry() ;
426
427     scr.register( UEInfoServiceContext.class ) ;
428     scr.register( CodeSetServiceContext.class ) ;
429     scr.register( SendingContextServiceContext.class ) ;
430     scr.register( ORBVersionServiceContext.class ) ;
431     scr.register( MaxStreamFormatVersionServiceContext.class ) ;
432     }
433
434     private void registerInitialReferences( final ORB orb )
435     {
436     // Register the Dynamic Any factory
437
Closure closure = new Closure() {
438             public java.lang.Object JavaDoc evaluate() {
439                 return new DynAnyFactoryImpl( orb ) ;
440             }
441         } ;
442
443         Closure future = ClosureFactory.makeFuture( closure ) ;
444         orb.getLocalResolver().register( ORBConstants.DYN_ANY_FACTORY_NAME,
445         future ) ;
446     }
447
448     private static final int ORB_STREAM = 0 ;
449
450     private void initObjectCopiers( ORB orb )
451     {
452     // No optimization or policy selection here.
453
ObjectCopierFactory orbStream =
454         CopyobjectDefaults.makeORBStreamObjectCopierFactory( orb ) ;
455
456     CopierManager cm = orb.getCopierManager() ;
457     cm.setDefaultId( ORB_STREAM ) ;
458
459     cm.registerObjectCopierFactory( orbStream, ORB_STREAM ) ;
460     }
461
462     private void initIORFinders( ORB orb )
463     {
464     IdentifiableFactoryFinder profFinder =
465         orb.getTaggedProfileFactoryFinder() ;
466     profFinder.registerFactory( IIOPFactories.makeIIOPProfileFactory() ) ;
467
468     IdentifiableFactoryFinder profTempFinder =
469         orb.getTaggedProfileTemplateFactoryFinder() ;
470     profTempFinder.registerFactory(
471         IIOPFactories.makeIIOPProfileTemplateFactory() ) ;
472
473     IdentifiableFactoryFinder compFinder =
474         orb.getTaggedComponentFactoryFinder() ;
475     compFinder.registerFactory(
476         IIOPFactories.makeCodeSetsComponentFactory() ) ;
477     compFinder.registerFactory(
478         IIOPFactories.makeJavaCodebaseComponentFactory() ) ;
479     compFinder.registerFactory(
480         IIOPFactories.makeORBTypeComponentFactory() ) ;
481     compFinder.registerFactory(
482         IIOPFactories.makeMaxStreamFormatVersionComponentFactory() ) ;
483     compFinder.registerFactory(
484         IIOPFactories.makeAlternateIIOPAddressComponentFactory() ) ;
485     compFinder.registerFactory(
486         IIOPFactories.makeRequestPartitioningComponentFactory() ) ;
487     compFinder.registerFactory(
488         IIOPFactories.makeJavaSerializationComponentFactory());
489
490     // Register the ValueFactory instances for ORT
491
IORFactories.registerValueFactories( orb ) ;
492
493     // Register an ObjectKeyFactory
494
orb.setObjectKeyFactory( IORFactories.makeObjectKeyFactory(orb) ) ;
495     }
496
497     private void initRequestDispatcherRegistry( ORB orb )
498     {
499     RequestDispatcherRegistry scr = orb.getRequestDispatcherRegistry() ;
500
501     // register client subcontracts
502
ClientRequestDispatcher csub =
503         RequestDispatcherDefault.makeClientRequestDispatcher() ;
504     scr.registerClientRequestDispatcher( csub,
505         ORBConstants.TOA_SCID ) ;
506     scr.registerClientRequestDispatcher( csub,
507         ORBConstants.TRANSIENT_SCID ) ;
508     scr.registerClientRequestDispatcher( csub,
509         ORBConstants.PERSISTENT_SCID ) ;
510     scr.registerClientRequestDispatcher( csub,
511         ORBConstants.SC_TRANSIENT_SCID ) ;
512     scr.registerClientRequestDispatcher( csub,
513         ORBConstants.SC_PERSISTENT_SCID ) ;
514     scr.registerClientRequestDispatcher( csub,
515         ORBConstants.IISC_TRANSIENT_SCID ) ;
516     scr.registerClientRequestDispatcher( csub,
517         ORBConstants.IISC_PERSISTENT_SCID ) ;
518     scr.registerClientRequestDispatcher( csub,
519         ORBConstants.MINSC_TRANSIENT_SCID ) ;
520     scr.registerClientRequestDispatcher( csub,
521         ORBConstants.MINSC_PERSISTENT_SCID ) ;
522     
523     // register server delegates
524
CorbaServerRequestDispatcher sd =
525         RequestDispatcherDefault.makeServerRequestDispatcher( orb );
526     scr.registerServerRequestDispatcher( sd,
527         ORBConstants.TOA_SCID ) ;
528     scr.registerServerRequestDispatcher( sd,
529         ORBConstants.TRANSIENT_SCID ) ;
530     scr.registerServerRequestDispatcher( sd,
531         ORBConstants.PERSISTENT_SCID ) ;
532     scr.registerServerRequestDispatcher( sd,
533         ORBConstants.SC_TRANSIENT_SCID ) ;
534     scr.registerServerRequestDispatcher( sd,
535         ORBConstants.SC_PERSISTENT_SCID ) ;
536     scr.registerServerRequestDispatcher( sd,
537         ORBConstants.IISC_TRANSIENT_SCID ) ;
538     scr.registerServerRequestDispatcher( sd,
539         ORBConstants.IISC_PERSISTENT_SCID ) ;
540     scr.registerServerRequestDispatcher( sd,
541         ORBConstants.MINSC_TRANSIENT_SCID ) ;
542     scr.registerServerRequestDispatcher( sd,
543         ORBConstants.MINSC_PERSISTENT_SCID ) ;
544     
545     orb.setINSDelegate(
546         RequestDispatcherDefault.makeINSServerRequestDispatcher( orb ) ) ;
547         
548     // register local client subcontracts
549
LocalClientRequestDispatcherFactory lcsf =
550         RequestDispatcherDefault.makeJIDLLocalClientRequestDispatcherFactory(
551         orb ) ;
552     scr.registerLocalClientRequestDispatcherFactory( lcsf,
553         ORBConstants.TOA_SCID ) ;
554
555     lcsf =
556         RequestDispatcherDefault.makePOALocalClientRequestDispatcherFactory(
557         orb ) ;
558     scr.registerLocalClientRequestDispatcherFactory( lcsf,
559         ORBConstants.TRANSIENT_SCID ) ;
560     scr.registerLocalClientRequestDispatcherFactory( lcsf,
561         ORBConstants.PERSISTENT_SCID ) ;
562
563     lcsf = RequestDispatcherDefault.
564         makeFullServantCacheLocalClientRequestDispatcherFactory( orb ) ;
565     scr.registerLocalClientRequestDispatcherFactory( lcsf,
566         ORBConstants.SC_TRANSIENT_SCID ) ;
567     scr.registerLocalClientRequestDispatcherFactory( lcsf,
568         ORBConstants.SC_PERSISTENT_SCID ) ;
569
570     lcsf = RequestDispatcherDefault.
571         makeInfoOnlyServantCacheLocalClientRequestDispatcherFactory( orb ) ;
572     scr.registerLocalClientRequestDispatcherFactory( lcsf,
573         ORBConstants.IISC_TRANSIENT_SCID ) ;
574     scr.registerLocalClientRequestDispatcherFactory( lcsf,
575         ORBConstants.IISC_PERSISTENT_SCID ) ;
576
577     lcsf = RequestDispatcherDefault.
578         makeMinimalServantCacheLocalClientRequestDispatcherFactory( orb ) ;
579     scr.registerLocalClientRequestDispatcherFactory( lcsf,
580         ORBConstants.MINSC_TRANSIENT_SCID ) ;
581     scr.registerLocalClientRequestDispatcherFactory( lcsf,
582         ORBConstants.MINSC_PERSISTENT_SCID ) ;
583
584     /* Register the server delegate that implements the ancient bootstrap
585      * naming protocol. This takes an object key of either "INIT" or
586      * "TINI" to allow for big or little endian implementations.
587      */

588     CorbaServerRequestDispatcher bootsd =
589         RequestDispatcherDefault.makeBootstrapServerRequestDispatcher(
590         orb ) ;
591     scr.registerServerRequestDispatcher( bootsd, "INIT" ) ;
592     scr.registerServerRequestDispatcher( bootsd, "TINI" ) ;
593
594     // Register object adapter factories
595
ObjectAdapterFactory oaf = OADefault.makeTOAFactory( orb ) ;
596     scr.registerObjectAdapterFactory( oaf, ORBConstants.TOA_SCID ) ;
597
598     oaf = OADefault.makePOAFactory( orb ) ;
599     scr.registerObjectAdapterFactory( oaf, ORBConstants.TRANSIENT_SCID ) ;
600     scr.registerObjectAdapterFactory( oaf, ORBConstants.PERSISTENT_SCID ) ;
601     scr.registerObjectAdapterFactory( oaf, ORBConstants.SC_TRANSIENT_SCID ) ;
602     scr.registerObjectAdapterFactory( oaf, ORBConstants.SC_PERSISTENT_SCID ) ;
603     scr.registerObjectAdapterFactory( oaf, ORBConstants.IISC_TRANSIENT_SCID ) ;
604     scr.registerObjectAdapterFactory( oaf, ORBConstants.IISC_PERSISTENT_SCID ) ;
605     scr.registerObjectAdapterFactory( oaf, ORBConstants.MINSC_TRANSIENT_SCID ) ;
606     scr.registerObjectAdapterFactory( oaf, ORBConstants.MINSC_PERSISTENT_SCID ) ;
607     }
608 }
609
610 // End of file.
611
Popular Tags