Produced by Araxis Merge on 9/25/2018 2:13:01 PM Central Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
# | Location | File | Last Modified |
---|---|---|---|
1 | build 3.zip\build 3\MHLTH_YS_137_Source\JavaScript\resources\javaJDF-1.8.0\src\com\sun\corba\se\impl\orb | ORBConfiguratorImpl.java | Mon Jan 22 14:46:40 2018 UTC |
2 | build 3.zip\build 3\MHLTH_YS_137_Source\JavaScript\resources\javaJDF-1.8.0\src\com\sun\corba\se\impl\orb | ORBConfiguratorImpl.java | Wed Sep 12 16:19:23 2018 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 2 | 1254 |
Changed | 1 | 2 |
Inserted | 0 | 0 |
Removed | 0 | 0 |
Whitespace | |
---|---|
Character case | Differences in character case are significant |
Line endings | Differences in line endings (CR and LF characters) are ignored |
CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
1 | /* | |
2 | * Copyrig ht (c) 200 2, 2004, O racle and/ or its aff iliates. A ll rights reserved. | |
3 | * DO NOT ALTER OR R EMOVE COPY RIGHT NOTI CES OR THI S FILE HEA DER. | |
4 | * | |
5 | * This co de is free software; you can r edistribut e it and/o r modify i t | |
6 | * under t he terms o f the GNU General Pu blic Licen se version 2 only, a s | |
7 | * publish ed by the Free Softw are Founda tion. Ora cle design ates this | |
8 | * particu lar file a s subject to the "Cl asspath" e xception a s provided | |
9 | * by Orac le in the LICENSE fi le that ac companied this code. | |
10 | * | |
11 | * This co de is dist ributed in the hope that it wi ll be usef ul, but WI THOUT | |
12 | * ANY WAR RANTY; wit hout even the implie d warranty of MERCHA NTABILITY or | |
13 | * FITNESS FOR A PAR TICULAR PU RPOSE. Se e the GNU General Pu blic Licen se | |
14 | * version 2 for mor e details (a copy is included in the LIC ENSE file that | |
15 | * accompa nied this code). | |
16 | * | |
17 | * You sho uld have r eceived a copy of th e GNU Gene ral Public License v ersion | |
18 | * 2 along with this work; if not, write to the Fr ee Softwar e Foundati on, | |
19 | * Inc., 5 1 Franklin St, Fifth Floor, Bo ston, MA 0 2110-1301 USA. | |
20 | * | |
21 | * Please contact Or acle, 500 Oracle Par kway, Redw ood Shores , CA 94065 USA | |
22 | * or visi t www.orac le.com if you need a dditional informatio n or have any | |
23 | * questio ns. | |
24 | */ | |
25 | ||
26 | package co m.sun.corb a.se.impl. orb ; | |
27 | ||
28 | import jav a.lang.ref lect.Invoc ationTarge tException ; | |
29 | import jav a.lang.ref lect.Metho d; | |
30 | import jav a.net.Inet Address ; | |
31 | import jav a.security .Privilege dAction ; | |
32 | import jav a.security .Privilege dException Action ; | |
33 | import jav a.security .AccessCon troller ; | |
34 | import jav a.util.Col lection ; | |
35 | import jav a.util.Ite rator ; | |
36 | ||
37 | import org .omg.CORBA .Completio nStatus ; | |
38 | import org .omg.CORBA .portable. ValueFacto ry ; | |
39 | ||
40 | import com .sun.corba .se.pept.p rotocol.Cl ientReques tDispatche r ; | |
41 | import com .sun.corba .se.pept.t ransport.A cceptor; | |
42 | ||
43 | import com .sun.corba .se.spi.ac tivation.L ocator ; | |
44 | import com .sun.corba .se.spi.ac tivation.A ctivator ; | |
45 | import com .sun.corba .se.spi.ac tivation.L ocatorHelp er ; | |
46 | import com .sun.corba .se.spi.ac tivation.A ctivatorHe lper ; | |
47 | import com .sun.corba .se.spi.ac tivation.E ndPointInf o ; | |
48 | ||
49 | import com .sun.corba .se.spi.co pyobject.O bjectCopie rFactory ; | |
50 | import com .sun.corba .se.spi.co pyobject.C opyobjectD efaults ; | |
51 | import com .sun.corba .se.spi.co pyobject.C opierManag er ; | |
52 | ||
53 | import com .sun.corba .se.spi.io r.Identifi ableFactor yFinder ; | |
54 | import com .sun.corba .se.spi.io r.IOR; | |
55 | import com .sun.corba .se.spi.io r.IORFacto ries ; | |
56 | ||
57 | import com .sun.corba .se.spi.io r.iiop.IIO PFactories ; | |
58 | ||
59 | import com .sun.corba .se.spi.le gacy.conne ction.ORBS ocketFacto ry; | |
60 | ||
61 | import com .sun.corba .se.spi.lo gging.CORB ALogDomain s ; | |
62 | ||
63 | import com .sun.corba .se.spi.oa .OADefault ; | |
64 | import com .sun.corba .se.spi.oa .ObjectAda pter ; | |
65 | import com .sun.corba .se.spi.oa .ObjectAda pterFactor y ; | |
66 | ||
67 | import com .sun.corba .se.spi.or b.Operatio n ; | |
68 | import com .sun.corba .se.spi.or b.Operatio nFactory ; | |
69 | import com .sun.corba .se.spi.or b.ORBData ; | |
70 | import com .sun.corba .se.spi.or b.DataColl ector ; | |
71 | import com .sun.corba .se.spi.or b.ORBConfi gurator ; | |
72 | import com .sun.corba .se.spi.or b.ParserIm plBase ; | |
73 | import com .sun.corba .se.spi.or b.Property Parser ; | |
74 | import com .sun.corba .se.spi.or b.ORB ; | |
75 | ||
76 | import com .sun.corba .se.spi.or butil.clos ure.Closur e ; | |
77 | import com .sun.corba .se.spi.or butil.clos ure.Closur eFactory ; | |
78 | ||
79 | import com .sun.corba .se.spi.pr otocol.Req uestDispat cherRegist ry ; | |
80 | import com .sun.corba .se.spi.pr otocol.Cor baServerRe questDispa tcher ; | |
81 | import com .sun.corba .se.spi.pr otocol.Req uestDispat cherDefaul t ; | |
82 | import com .sun.corba .se.spi.pr otocol.Loc alClientRe questDispa tcherFacto ry ; | |
83 | ||
84 | import com .sun.corba .se.spi.re solver.Loc alResolver ; | |
85 | import com .sun.corba .se.spi.re solver.Res olver ; | |
86 | import com .sun.corba .se.spi.re solver.Res olverDefau lt ; | |
87 | ||
88 | import com .sun.corba .se.spi.tr ansport.Co rbaContact InfoList; | |
89 | import com .sun.corba .se.spi.tr ansport.Co rbaContact InfoListFa ctory; | |
90 | import com .sun.corba .se.spi.tr ansport.So cketInfo; | |
91 | import com .sun.corba .se.spi.tr ansport.Tr ansportDef ault ; | |
92 | ||
93 | import com .sun.corba .se.spi.pr esentation .rmi.Prese ntationMan ager ; | |
94 | import com .sun.corba .se.spi.pr esentation .rmi.Prese ntationDef aults ; | |
95 | ||
96 | import com .sun.corba .se.spi.se rviceconte xt.Service Context ; | |
97 | import com .sun.corba .se.spi.se rviceconte xt.Service ContextReg istry ; | |
98 | import com .sun.corba .se.spi.se rviceconte xt.UEInfoS erviceCont ext ; | |
99 | import com .sun.corba .se.spi.se rviceconte xt.CodeSet ServiceCon text ; | |
100 | import com .sun.corba .se.spi.se rviceconte xt.Sending ContextSer viceContex t ; | |
101 | import com .sun.corba .se.spi.se rviceconte xt.ORBVers ionService Context ; | |
102 | import com .sun.corba .se.spi.se rviceconte xt.MaxStre amFormatVe rsionServi ceContext ; | |
103 | import com .sun.corba .se.impl.l ogging.ORB UtilSystem Exception ; | |
104 | import com .sun.corba .se.impl.t ransport.S ocketOrCha nnelAccept orImpl; | |
105 | ||
106 | // XXX Thi s should g o away onc e we get r id of the port excha nge for OR BD | |
107 | import com .sun.corba .se.spi.le gacy.conne ction.Lega cyServerSo cketEndPoi ntInfo; | |
108 | import com .sun.corba .se.impl.l egacy.conn ection.Soc ketFactory AcceptorIm pl; | |
109 | import com .sun.corba .se.impl.l egacy.conn ection.Soc ketFactory ContactInf oListImpl; | |
110 | import com .sun.corba .se.impl.l egacy.conn ection.USL Port; | |
111 | ||
112 | // XXX The se should move to SP I | |
113 | import com .sun.corba .se.impl.o rbutil.ORB Constants ; | |
114 | ||
115 | // XXX Thi s needs an SPI | |
116 | import com .sun.corba .se.impl.d ynamicany. DynAnyFact oryImpl ; | |
117 | ||
118 | public cla ss ORBConf iguratorIm pl impleme nts ORBCon figurator { | |
119 | privat e ORBUtilS ystemExcep tion wrapp er ; | |
120 | ||
121 | public static cl ass Config Parser ext ends Parse rImplBase { | |
122 | pu blic Class [] userCon figurators = null ; | |
123 | ||
124 | pu blic Prope rtyParser makeParser () | |
125 | { | |
126 | Property Parser par ser = new PropertyPa rser() ; | |
127 | Operatio n action = Operation Factory.co mpose( | |
128 | Oper ationFacto ry.suffixA ction(), | |
129 | Oper ationFacto ry.classAc tion() | |
130 | ) ; | |
131 | parser.a ddPrefix( ORBConstan ts.SUN_PRE FIX + "ORB UserConfig urators", | |
132 | acti on, "userC onfigurato rs", Class .class ) ; | |
133 | return p arser ; | |
134 | } | |
135 | } | |
136 | ||
137 | public void conf igure( Dat aCollector collector , ORB orb ) | |
138 | { | |
139 | OR B theOrb = orb ; | |
140 | wr apper = OR BUtilSyste mException .get( orb, CORBALogD omains.ORB _LIFECYCLE ) ; | |
141 | ||
142 | in itObjectCo piers( the Orb ) ; | |
143 | in itIORFinde rs( theOrb ) ; | |
144 | ||
145 | th eOrb.setCl ientDelega teFactory( | |
146 | // REVIS IT: this s hould be P rotocolDef ault. | |
147 | Transpor tDefault.m akeClientD elegateFac tory( theO rb )) ; | |
148 | ||
149 | in itializeTr ansport(th eOrb) ; | |
150 | ||
151 | in itializeNa ming( theO rb ) ; | |
152 | in itServiceC ontextRegi stry( theO rb ) ; | |
153 | in itRequestD ispatcherR egistry( t heOrb ) ; | |
154 | re gisterInit ialReferen ces( theOr b ) ; | |
155 | ||
156 | pe rsistentSe rverInitia lization( theOrb ) ; | |
157 | ||
158 | ru nUserConfi gurators( collector, theOrb ) ; | |
159 | } | |
160 | ||
161 | privat e void run UserConfig urators( D ataCollect or collect or, ORB or b ) | |
162 | { | |
163 | // Run any p luggable c onfigurato rs. This is a lot l ike | |
164 | // ORBInitia lizers, on ly it uses the inter nal ORB an d has | |
165 | // access to all data for parsin g. | |
166 | Co nfigParser parser = new Config Parser() ; | |
167 | pa rser.init( collector ) ; | |
168 | if (parser.u serConfigu rators != null) { | |
169 | for (int ctr=0; ct r<parser.u serConfigu rators.len gth; ctr++ ) { | |
170 | Clas s cls = pa rser.userC onfigurato rs[ctr] ; | |
171 | try { | |
172 | ORBConfigu rator conf ig = (ORBC onfigurato r)(cls.new Instance() ) ; | |
173 | config.con figure( co llector, o rb ) ; | |
174 | } ca tch (Excep tion exc) { | |
175 | // XXX Log this exce ption | |
176 | // ignore this for n ow: a bad user confi gurator do es nothing | |
177 | } | |
178 | } | |
179 | } | |
180 | } | |
181 | ||
182 | privat e void per sistentSer verInitial ization( O RB orb ) | |
183 | { | |
184 | OR BData data = orb.get ORBData() ; | |
185 | ||
186 | // determine the ORBD port so th at persist ent objref s can be | |
187 | // created. | |
188 | if (data.get ServerIsOR BActivated ()) { | |
189 | try { | |
190 | Loca tor locato r = Locato rHelper.na rrow( | |
191 | orb.resolv e_initial_ references ( | |
192 | ORBCon stants.SER VER_LOCATO R_NAME )) ; | |
193 | Acti vator acti vator = Ac tivatorHel per.narrow ( | |
194 | orb.resolv e_initial_ references ( | |
195 | ORBCon stants.SER VER_ACTIVA TOR_NAME ) ) ; | |
196 | Coll ection ser verEndpoin ts = | |
197 | orb.getCor baTranspor tManager() .getAccept ors(null, null); | |
198 | EndP ointInfo[] endpointL ist = | |
199 | new EndPoi ntInfo[ser verEndpoin ts.size()] ; | |
200 | Iter ator itera tor = serv erEndpoint s.iterator (); | |
201 | int i = 0 ; | |
202 | whil e (iterato r.hasNext( )) { | |
203 | Object n = iterator. next(); | |
204 | if (! (n i nstanceof LegacyServ erSocketEn dPointInfo )) { | |
205 | contin ue; | |
206 | } | |
207 | LegacyServ erSocketEn dPointInfo ep = | |
208 | (Legac yServerSoc ketEndPoin tInfo) n; | |
209 | // REVISIT - use exc eption ins tead of -1 . | |
210 | int port = locator.g etEndpoint (ep.getTyp e()); | |
211 | if (port = = -1) { | |
212 | port = locator.g etEndpoint (SocketInf o.IIOP_CLE AR_TEXT); | |
213 | if (po rt == -1) { | |
214 | th row new Ex ception( | |
215 | "ORBD mu st support IIOP_CLEA R_TEXT"); | |
216 | } | |
217 | } | |
218 | ||
219 | ep.setLoca torPort(po rt); | |
220 | ||
221 | endpointLi st[i++] = | |
222 | new En dPointInfo (ep.getTyp e(), ep.ge tPort()); | |
223 | } | |
224 | ||
225 | acti vator.regi sterEndpoi nts( | |
226 | data.getPe rsistentSe rverId(), data.getOR BId(), | |
227 | endpoi ntList); | |
228 | } catch (Exception ex) { | |
229 | thro w wrapper. persistent ServerInit Error( | |
230 | Completion Status.COM PLETED_MAY BE, ex ) ; | |
231 | } | |
232 | } | |
233 | } | |
234 | ||
235 | /** | |
236 | * Thi s is made somewhat c omplex bec ause we ar e currentl y supporti ng | |
237 | * the ContactIn foList/Acc eptor *AND * the lega cy SocketF actory | |
238 | * tra nsport arc hitecture. | |
239 | */ | |
240 | privat e void ini tializeTra nsport(fin al ORB orb ) | |
241 | { | |
242 | OR BData od = orb.getOR BData(); | |
243 | ||
244 | Co rbaContact InfoListFa ctory cont actInfoLis tFactory = | |
245 | od.getCo rbaContact InfoListFa ctory(); | |
246 | Ac ceptor[] a cceptors = od.getAcc eptors(); | |
247 | ||
248 | // BEGIN Leg acy | |
249 | OR BSocketFac tory legac ySocketFac tory = od. getLegacyS ocketFacto ry(); | |
250 | US LPort[] us lPorts = o d.getUserS pecifiedLi stenPorts( ) ; | |
251 | se tLegacySoc ketFactory ORB(orb, l egacySocke tFactory); | |
252 | // END Legac y | |
253 | ||
254 | // | |
255 | // Check for incorrect configura tion. | |
256 | // | |
257 | ||
258 | if (legacySo cketFactor y != null && contact InfoListFa ctory != n ull) { | |
259 | throw wr apper.sock etFactoryA ndContactI nfoListAtS ameTime(); | |
260 | } | |
261 | ||
262 | if (acceptor s.length ! = 0 && leg acySocketF actory != null) { | |
263 | throw wr apper.acce ptorsAndLe gacySocket FactoryAtS ameTime(); | |
264 | } | |
265 | ||
266 | ||
267 | // | |
268 | // Client an d Server s ide setup. | |
269 | // | |
270 | ||
271 | od .getSocket Factory(). setORB(orb ); | |
272 | ||
273 | // | |
274 | // Set up cl ient side. | |
275 | // | |
276 | ||
277 | if (legacySo cketFactor y != null) { | |
278 | // BEGIN Legacy | |
279 | // Since the user specified a legacy s ocket fact ory we nee d to | |
280 | // use a ContactIn foList tha t will use the legac y socket f actory. | |
281 | contactI nfoListFac tory = | |
282 | new CorbaConta ctInfoList Factory() { | |
283 | public void setO RB(ORB orb ) { } | |
284 | public CorbaCont actInfoLis t create( IOR ior ) { | |
285 | re turn new S ocketFacto ryContactI nfoListImp l( | |
286 | orb, ior ); | |
287 | } | |
288 | }; | |
289 | // END L egacy | |
290 | } else if (c ontactInfo ListFactor y != null) { | |
291 | // The u ser specif ied an exp licit Cont actInfoLis tFactory. | |
292 | contactI nfoListFac tory.setOR B(orb); | |
293 | } else { | |
294 | // Use t he default . | |
295 | contactI nfoListFac tory = | |
296 | Tran sportDefau lt.makeCor baContactI nfoListFac tory(orb); | |
297 | } | |
298 | or b.setCorba ContactInf oListFacto ry(contact InfoListFa ctory); | |
299 | ||
300 | // | |
301 | // Set up se rver side. | |
302 | // | |
303 | ||
304 | // | |
305 | // Maybe all ocate the Legacy def ault liste ner. | |
306 | // | |
307 | // If old le gacy prope rties set, or there are no exp licit | |
308 | // acceptors then regi ster a def ault liste ner. Type of | |
309 | // default l istener de pends on p resence of legacy so cket facto ry. | |
310 | // | |
311 | // Note: thi s must hap pen *BEFOR E* registe ring expli cit accept ors. | |
312 | // | |
313 | ||
314 | // BEGIN Leg acy | |
315 | in t port = - 1; | |
316 | if (od.getOR BServerPor t() != 0) { | |
317 | port = o d.getORBSe rverPort() ; | |
318 | } else if (o d.getPersi stentPortI nitialized ()) { | |
319 | port = o d.getPersi stentServe rPort(); | |
320 | } else if (a cceptors.l ength == 0 ) { | |
321 | PORT ; | |
322 | } | |
323 | if (port != -1) { | |
324 | createAn dRegisterA cceptor(or b, legacyS ocketFacto ry, port, | |
325 | Legacy ServerSock etEndPoint Info.DEFAU LT_ENDPOIN T, | |
326 | Socket Info.IIOP_ CLEAR_TEXT ); | |
327 | } | |
328 | // END Legac y | |
329 | ||
330 | fo r (int i = 0; i < ac ceptors.le ngth; i++) { | |
331 | orb.getC orbaTransp ortManager ().registe rAcceptor( acceptors[ i]); | |
332 | } | |
333 | ||
334 | // BEGIN Leg acy | |
335 | // Allocate user liste ners. | |
336 | US LPort[] po rts = od.g etUserSpec ifiedListe nPorts() ; | |
337 | if (ports != null) { | |
338 | for (int i = 0; i < ports.le ngth; i++) { | |
339 | crea teAndRegis terAccepto r( | |
340 | orb, legac ySocketFac tory, port s[i].getPo rt(), | |
341 | LegacyServ erSocketEn dPointInfo .NO_NAME, | |
342 | ports[i].g etType()); | |
343 | } | |
344 | } | |
345 | // END Legac y | |
346 | } | |
347 | ||
348 | /* | |
349 | * Leg acy: name. | |
350 | */ | |
351 | // REV ISIT: see ORBD. make factory i n Transpor tDefault. | |
352 | privat e void cre ateAndRegi sterAccept or(ORB orb , | |
353 | ORBSock etFactory legacySock etFactory, | |
354 | int por t, String name, Stri ng type) | |
355 | { | |
356 | Ac ceptor acc eptor; | |
357 | if (legacySo cketFactor y == null) { | |
358 | acceptor = | |
359 | new SocketOrCh annelAccep torImpl(or b, port, n ame, type) ; | |
360 | } else { | |
361 | acceptor = | |
362 | new SocketFact oryAccepto rImpl(orb, port, nam e, type); | |
363 | } | |
364 | or b.getTrans portManage r().regist erAcceptor (acceptor) ; | |
365 | } | |
366 | ||
367 | privat e void set LegacySock etFactoryO RB( | |
368 | fi nal ORB or b, final O RBSocketFa ctory lega cySocketFa ctory) | |
369 | { | |
370 | if (legacySo cketFactor y == null) { | |
371 | return; | |
372 | } | |
373 | ||
374 | // Note: the createSer verSocket and create Socket met hods on th e | |
375 | // DefaultSo cketFactor y need to get data f rom the OR B but | |
376 | // we cannot change th e interfac e. So set the ORB ( if it's ou rs) | |
377 | // by reflec tion. | |
378 | ||
379 | tr y { | |
380 | AccessCo ntroller.d oPrivilege d( | |
381 | new Privileged ExceptionA ction() { | |
382 | public Obj ect run() | |
383 | throws Instantia tionExcept ion, Illeg alAccessEx ception | |
384 | { | |
385 | try { | |
386 | Cl ass[] para ms = { ORB .class }; | |
387 | Me thod metho d = | |
388 | legacySo cketFactor y.getClass ().getMeth od( | |
389 | "setOR B", params ); | |
390 | Ob ject[] arg s = { orb }; | |
391 | me thod.invok e(legacySo cketFactor y, args); | |
392 | } catc h (NoSuchM ethodExcep tion e) { | |
393 | // NOTE: If there is n o method t hen it | |
394 | // is not ou rs - so ig nore it. | |
395 | ; | |
396 | } catc h (Illegal AccessExce ption e) { | |
397 | Ru ntimeExcep tion rte = new Runti meExceptio n(); | |
398 | rt e.initCaus e(e); | |
399 | th row rte; | |
400 | } catc h (Invocat ionTargetE xception e ) { | |
401 | Ru ntimeExcep tion rte = new Runti meExceptio n(); | |
402 | rt e.initCaus e(e); | |
403 | th row rte; | |
404 | } | |
405 | return null; | |
406 | } | |
407 | } | |
408 | ); | |
409 | } catch (Thr owable t) { | |
410 | throw wr apper.unab leToSetSoc ketFactory Orb(t); | |
411 | } | |
412 | } | |
413 | ||
414 | privat e void ini tializeNam ing( ORB o rb ) | |
415 | { | |
416 | Lo calResolve r localRes olver = Re solverDefa ult.makeLo calResolve r() ; | |
417 | or b.setLocal Resolver( localResol ver ) ; | |
418 | ||
419 | Re solver boo tResolver = Resolver Default.ma keBootstra pResolver( orb, | |
420 | orb.getO RBData().g etORBIniti alHost(), | |
421 | orb.getO RBData().g etORBIniti alPort() ) ; | |
422 | ||
423 | Op eration ur lOperation = Resolve rDefault.m akeINSURLO peration( orb, | |
424 | bootReso lver ) ; | |
425 | or b.setURLOp eration( u rlOperatio n ) ; | |
426 | ||
427 | Re solver irR esolver = ResolverDe fault.make ORBInitRef Resolver( urlOperati on, | |
428 | orb.getO RBData().g etORBIniti alReferenc es() ) ; | |
429 | ||
430 | Re solver dir Resolver = ResolverD efault.mak eORBDefaul tInitRefRe solver( | |
431 | urlOpera tion, orb. getORBData ().getORBD efaultInit ialReferen ce() ) ; | |
432 | ||
433 | Re solver res olver = | |
434 | Resolver Default.ma keComposit eResolver( localReso lver, | |
435 | Reso lverDefaul t.makeComp ositeResol ver( irRes olver, | |
436 | ResolverDe fault.make CompositeR esolver( d irResolver , | |
437 | bootRe solver ) ) ) ; | |
438 | or b.setResol ver( resol ver ) ; | |
439 | } | |
440 | ||
441 | privat e void ini tServiceCo ntextRegis try( ORB o rb ) | |
442 | { | |
443 | Se rviceConte xtRegistry scr = orb .getServic eContextRe gistry() ; | |
444 | ||
445 | sc r.register ( UEInfoSe rviceConte xt.class ) ; | |
446 | sc r.register ( CodeSetS erviceCont ext.class ) ; | |
447 | sc r.register ( SendingC ontextServ iceContext .class ) ; | |
448 | sc r.register ( ORBVersi onServiceC ontext.cla ss ) ; | |
449 | sc r.register ( MaxStrea mFormatVer sionServic eContext.c lass ) ; | |
450 | } | |
451 | ||
452 | privat e void reg isterIniti alReferenc es( final ORB orb ) | |
453 | { | |
454 | // Register the Dynami c Any fact ory | |
455 | Cl osure clos ure = new Closure() { | |
456 | public j ava.lang.O bject eval uate() { | |
457 | retu rn new Dyn AnyFactory Impl( orb ) ; | |
458 | } | |
459 | } ; | |
460 | ||
461 | Cl osure futu re = Closu reFactory. makeFuture ( closure ) ; | |
462 | or b.getLocal Resolver() .register( ORBConsta nts.DYN_AN Y_FACTORY_ NAME, | |
463 | future ) ; | |
464 | } | |
465 | ||
466 | privat e static f inal int O RB_STREAM = 0 ; | |
467 | ||
468 | privat e void ini tObjectCop iers( ORB orb ) | |
469 | { | |
470 | // No optimi zation or policy sel ection her e. | |
471 | Ob jectCopier Factory or bStream = | |
472 | Copyobje ctDefaults .makeORBSt reamObject CopierFact ory( orb ) ; | |
473 | ||
474 | Co pierManage r cm = orb .getCopier Manager() ; | |
475 | cm .setDefaul tId( ORB_S TREAM ) ; | |
476 | ||
477 | cm .registerO bjectCopie rFactory( orbStream, ORB_STREA M ) ; | |
478 | } | |
479 | ||
480 | privat e void ini tIORFinder s( ORB orb ) | |
481 | { | |
482 | Id entifiable FactoryFin der profFi nder = | |
483 | orb.getT aggedProfi leFactoryF inder() ; | |
484 | pr ofFinder.r egisterFac tory( IIOP Factories. makeIIOPPr ofileFacto ry() ) ; | |
485 | ||
486 | Id entifiable FactoryFin der profTe mpFinder = | |
487 | orb.getT aggedProfi leTemplate FactoryFin der() ; | |
488 | pr ofTempFind er.registe rFactory( | |
489 | IIOPFact ories.make IIOPProfil eTemplateF actory() ) ; | |
490 | ||
491 | Id entifiable FactoryFin der compFi nder = | |
492 | orb.getT aggedCompo nentFactor yFinder() ; | |
493 | co mpFinder.r egisterFac tory( | |
494 | IIOPFact ories.make CodeSetsCo mponentFac tory() ) ; | |
495 | co mpFinder.r egisterFac tory( | |
496 | IIOPFact ories.make JavaCodeba seComponen tFactory() ) ; | |
497 | co mpFinder.r egisterFac tory( | |
498 | IIOPFact ories.make ORBTypeCom ponentFact ory() ) ; | |
499 | co mpFinder.r egisterFac tory( | |
500 | IIOPFact ories.make MaxStreamF ormatVersi onComponen tFactory() ) ; | |
501 | co mpFinder.r egisterFac tory( | |
502 | IIOPFact ories.make AlternateI IOPAddress ComponentF actory() ) ; | |
503 | co mpFinder.r egisterFac tory( | |
504 | IIOPFact ories.make RequestPar titioningC omponentFa ctory() ) ; | |
505 | co mpFinder.r egisterFac tory( | |
506 | IIOPFact ories.make JavaSerial izationCom ponentFact ory()); | |
507 | ||
508 | // Register the ValueF actory ins tances for ORT | |
509 | IO RFactories .registerV alueFactor ies( orb ) ; | |
510 | ||
511 | // Register an ObjectK eyFactory | |
512 | or b.setObjec tKeyFactor y( IORFact ories.make ObjectKeyF actory(orb ) ) ; | |
513 | } | |
514 | ||
515 | privat e void ini tRequestDi spatcherRe gistry( OR B orb ) | |
516 | { | |
517 | Re questDispa tcherRegis try scr = orb.getReq uestDispat cherRegist ry() ; | |
518 | ||
519 | // register client sub contracts | |
520 | Cl ientReques tDispatche r csub = | |
521 | RequestD ispatcherD efault.mak eClientReq uestDispat cher() ; | |
522 | sc r.register ClientRequ estDispatc her( csub, | |
523 | ORBConst ants.TOA_S CID ) ; | |
524 | sc r.register ClientRequ estDispatc her( csub, | |
525 | ORBConst ants.TRANS IENT_SCID ) ; | |
526 | sc r.register ClientRequ estDispatc her( csub, | |
527 | ORBConst ants.PERSI STENT_SCID ) ; | |
528 | sc r.register ClientRequ estDispatc her( csub, | |
529 | ORBConst ants.SC_TR ANSIENT_SC ID ) ; | |
530 | sc r.register ClientRequ estDispatc her( csub, | |
531 | ORBConst ants.SC_PE RSISTENT_S CID ) ; | |
532 | sc r.register ClientRequ estDispatc her( csub, | |
533 | ORBConst ants.IISC_ TRANSIENT_ SCID ) ; | |
534 | sc r.register ClientRequ estDispatc her( csub, | |
535 | ORBConst ants.IISC_ PERSISTENT _SCID ) ; | |
536 | sc r.register ClientRequ estDispatc her( csub, | |
537 | ORBConst ants.MINSC _TRANSIENT _SCID ) ; | |
538 | sc r.register ClientRequ estDispatc her( csub, | |
539 | ORBConst ants.MINSC _PERSISTEN T_SCID ) ; | |
540 | ||
541 | // register server del egates | |
542 | Co rbaServerR equestDisp atcher sd = | |
543 | RequestD ispatcherD efault.mak eServerReq uestDispat cher( orb ); | |
544 | sc r.register ServerRequ estDispatc her( sd, | |
545 | ORBConst ants.TOA_S CID ) ; | |
546 | sc r.register ServerRequ estDispatc her( sd, | |
547 | ORBConst ants.TRANS IENT_SCID ) ; | |
548 | sc r.register ServerRequ estDispatc her( sd, | |
549 | ORBConst ants.PERSI STENT_SCID ) ; | |
550 | sc r.register ServerRequ estDispatc her( sd, | |
551 | ORBConst ants.SC_TR ANSIENT_SC ID ) ; | |
552 | sc r.register ServerRequ estDispatc her( sd, | |
553 | ORBConst ants.SC_PE RSISTENT_S CID ) ; | |
554 | sc r.register ServerRequ estDispatc her( sd, | |
555 | ORBConst ants.IISC_ TRANSIENT_ SCID ) ; | |
556 | sc r.register ServerRequ estDispatc her( sd, | |
557 | ORBConst ants.IISC_ PERSISTENT _SCID ) ; | |
558 | sc r.register ServerRequ estDispatc her( sd, | |
559 | ORBConst ants.MINSC _TRANSIENT _SCID ) ; | |
560 | sc r.register ServerRequ estDispatc her( sd, | |
561 | ORBConst ants.MINSC _PERSISTEN T_SCID ) ; | |
562 | ||
563 | or b.setINSDe legate( | |
564 | RequestD ispatcherD efault.mak eINSServer RequestDis patcher( o rb ) ) ; | |
565 | ||
566 | // register local clie nt subcont racts | |
567 | Lo calClientR equestDisp atcherFact ory lcsf = | |
568 | RequestD ispatcherD efault.mak eJIDLLocal ClientRequ estDispatc herFactory ( | |
569 | orb ) ; | |
570 | sc r.register LocalClien tRequestDi spatcherFa ctory( lcs f, | |
571 | ORBConst ants.TOA_S CID ) ; | |
572 | ||
573 | lc sf = | |
574 | RequestD ispatcherD efault.mak ePOALocalC lientReque stDispatch erFactory( | |
575 | orb ) ; | |
576 | sc r.register LocalClien tRequestDi spatcherFa ctory( lcs f, | |
577 | ORBConst ants.TRANS IENT_SCID ) ; | |
578 | sc r.register LocalClien tRequestDi spatcherFa ctory( lcs f, | |
579 | ORBConst ants.PERSI STENT_SCID ) ; | |
580 | ||
581 | lc sf = Reque stDispatch erDefault. | |
582 | makeFull ServantCac heLocalCli entRequest Dispatcher Factory( o rb ) ; | |
583 | sc r.register LocalClien tRequestDi spatcherFa ctory( lcs f, | |
584 | ORBConst ants.SC_TR ANSIENT_SC ID ) ; | |
585 | sc r.register LocalClien tRequestDi spatcherFa ctory( lcs f, | |
586 | ORBConst ants.SC_PE RSISTENT_S CID ) ; | |
587 | ||
588 | lc sf = Reque stDispatch erDefault. | |
589 | makeInfo OnlyServan tCacheLoca lClientReq uestDispat cherFactor y( orb ) ; | |
590 | sc r.register LocalClien tRequestDi spatcherFa ctory( lcs f, | |
591 | ORBConst ants.IISC_ TRANSIENT_ SCID ) ; | |
592 | sc r.register LocalClien tRequestDi spatcherFa ctory( lcs f, | |
593 | ORBConst ants.IISC_ PERSISTENT _SCID ) ; | |
594 | ||
595 | lc sf = Reque stDispatch erDefault. | |
596 | makeMini malServant CacheLocal ClientRequ estDispatc herFactory ( orb ) ; | |
597 | sc r.register LocalClien tRequestDi spatcherFa ctory( lcs f, | |
598 | ORBConst ants.MINSC _TRANSIENT _SCID ) ; | |
599 | sc r.register LocalClien tRequestDi spatcherFa ctory( lcs f, | |
600 | ORBConst ants.MINSC _PERSISTEN T_SCID ) ; | |
601 | ||
602 | /* Register the server delegate that imple ments the ancient bo otstrap | |
603 | * naming pr otocol. T his takes an object key of eit her "INIT" or | |
604 | * "TINI" to allow for big or li ttle endia n implemen tations. | |
605 | * / | |
606 | Co rbaServerR equestDisp atcher boo tsd = | |
607 | RequestD ispatcherD efault.mak eBootstrap ServerRequ estDispatc her( | |
608 | orb ) ; | |
609 | sc r.register ServerRequ estDispatc her( boots d, "INIT" ) ; | |
610 | sc r.register ServerRequ estDispatc her( boots d, "TINI" ) ; | |
611 | ||
612 | // Register object ada pter facto ries | |
613 | Ob jectAdapte rFactory o af = OADef ault.makeT OAFactory( orb ) ; | |
614 | sc r.register ObjectAdap terFactory ( oaf, ORB Constants. TOA_SCID ) ; | |
615 | ||
616 | oa f = OADefa ult.makePO AFactory( orb ) ; | |
617 | sc r.register ObjectAdap terFactory ( oaf, ORB Constants. TRANSIENT_ SCID ) ; | |
618 | sc r.register ObjectAdap terFactory ( oaf, ORB Constants. PERSISTENT _SCID ) ; | |
619 | sc r.register ObjectAdap terFactory ( oaf, ORB Constants. SC_TRANSIE NT_SCID ) ; | |
620 | sc r.register ObjectAdap terFactory ( oaf, ORB Constants. SC_PERSIST ENT_SCID ) ; | |
621 | sc r.register ObjectAdap terFactory ( oaf, ORB Constants. IISC_TRANS IENT_SCID ) ; | |
622 | sc r.register ObjectAdap terFactory ( oaf, ORB Constants. IISC_PERSI STENT_SCID ) ; | |
623 | sc r.register ObjectAdap terFactory ( oaf, ORB Constants. MINSC_TRAN SIENT_SCID ) ; | |
624 | sc r.register ObjectAdap terFactory ( oaf, ORB Constants. MINSC_PERS ISTENT_SCI D ) ; | |
625 | } | |
626 | } | |
627 | ||
628 | // End of file. |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.