1 7 15 16 package com.sun.corba.se.impl.orb; 17 18 import java.util.Collection ; 19 import java.util.Properties ; 20 import java.util.Hashtable ; 21 22 import java.applet.Applet ; 23 24 import java.net.URL ; 25 26 import java.io.IOException ; 27 28 import java.util.logging.Logger ; 29 30 import org.omg.CORBA.Context ; 31 import org.omg.CORBA.ContextList ; 32 import org.omg.CORBA.Environment ; 33 import org.omg.CORBA.ExceptionList ; 34 import org.omg.CORBA.ORBPackage.InvalidName ; 35 import org.omg.CORBA.NVList ; 36 import org.omg.CORBA.TCKind ; 37 import org.omg.CORBA.NamedValue ; 38 import org.omg.CORBA.NO_IMPLEMENT ; 39 import org.omg.CORBA.Object ; 40 import org.omg.CORBA.Request ; 41 import org.omg.CORBA.TypeCode ; 42 import org.omg.CORBA.Any ; 43 import org.omg.CORBA.StructMember ; 44 import org.omg.CORBA.UnionMember ; 45 import org.omg.CORBA.ValueMember ; 46 import org.omg.CORBA.Policy ; 47 import org.omg.CORBA.PolicyError ; 48 49 import org.omg.CORBA.portable.OutputStream ; 50 import org.omg.CORBA.portable.RemarshalException ; 51 52 import com.sun.corba.se.pept.protocol.ClientInvocationInfo ; 53 import com.sun.corba.se.pept.transport.ContactInfo; 54 import com.sun.corba.se.pept.transport.ConnectionCache; 55 import com.sun.corba.se.pept.transport.Selector ; 56 import com.sun.corba.se.pept.transport.TransportManager; 57 58 import com.sun.corba.se.spi.legacy.connection.ORBSocketFactory; 59 import com.sun.corba.se.spi.orb.ORBData; 60 import com.sun.corba.se.spi.orb.Operation; 61 import com.sun.corba.se.spi.orb.ORB; 62 import com.sun.corba.se.spi.orb.ORBVersion; 63 import com.sun.corba.se.spi.orb.ORBVersionFactory; 64 import com.sun.corba.se.spi.oa.OAInvocationInfo; 65 import com.sun.corba.se.spi.oa.ObjectAdapter; 66 import com.sun.corba.se.spi.protocol.CorbaMessageMediator; 67 import com.sun.corba.se.spi.protocol.ClientDelegateFactory; 68 import com.sun.corba.se.spi.protocol.RequestDispatcherRegistry; 69 import com.sun.corba.se.spi.protocol.CorbaServerRequestDispatcher; 70 import com.sun.corba.se.spi.protocol.PIHandler; 71 import com.sun.corba.se.spi.resolver.Resolver; 72 import com.sun.corba.se.spi.resolver.LocalResolver; 73 import com.sun.corba.se.spi.ior.IOR; 74 import com.sun.corba.se.spi.ior.IdentifiableFactoryFinder; 75 import com.sun.corba.se.spi.ior.TaggedComponentFactoryFinder; 76 import com.sun.corba.se.spi.ior.ObjectKey; 77 import com.sun.corba.se.spi.ior.ObjectKeyFactory; 78 import com.sun.corba.se.spi.ior.iiop.GIOPVersion; 79 import com.sun.corba.se.pept.transport.ByteBufferPool ; 80 import com.sun.corba.se.spi.transport.CorbaContactInfoListFactory ; 81 import com.sun.corba.se.spi.transport.CorbaTransportManager; 82 import com.sun.corba.se.spi.legacy.connection.LegacyServerSocketManager; 83 import com.sun.corba.se.spi.orbutil.closure.Closure; 84 import com.sun.corba.se.spi.orbutil.threadpool.ThreadPoolManager; 85 import com.sun.corba.se.spi.logging.LogWrapperFactory; 86 import com.sun.corba.se.spi.logging.LogWrapperBase; 87 import com.sun.corba.se.spi.copyobject.CopierManager; 88 import com.sun.corba.se.spi.presentation.rmi.PresentationManager; 89 import com.sun.corba.se.spi.presentation.rmi.PresentationDefaults; 90 91 import com.sun.corba.se.spi.servicecontext.ServiceContextRegistry; 92 import com.sun.corba.se.spi.servicecontext.ServiceContexts; 93 94 import com.sun.corba.se.impl.corba.TypeCodeFactory; 95 import com.sun.corba.se.impl.corba.TypeCodeImpl; 96 import com.sun.corba.se.impl.corba.NVListImpl; 97 import com.sun.corba.se.impl.corba.NamedValueImpl; 98 import com.sun.corba.se.impl.corba.ExceptionListImpl; 99 import com.sun.corba.se.impl.corba.ContextListImpl; 100 import com.sun.corba.se.impl.corba.EnvironmentImpl; 101 import com.sun.corba.se.impl.corba.AnyImpl; 102 import com.sun.corba.se.impl.encoding.BufferManagerFactory; 103 import com.sun.corba.se.impl.encoding.CodeSetComponentInfo; 104 import com.sun.corba.se.impl.encoding.MarshalInputStream; 105 import com.sun.corba.se.impl.encoding.EncapsOutputStream; 106 import com.sun.corba.se.impl.encoding.MarshalOutputStream; 107 import com.sun.corba.se.impl.oa.poa.BadServerIdHandler; 108 import com.sun.corba.se.impl.orbutil.ORBConstants; 109 import com.sun.corba.se.spi.legacy.connection.LegacyServerSocketEndPointInfo; 110 111 119 public class ORBSingleton extends ORB 120 { 121 private static ORB fullORB; 123 private static PresentationManager.StubFactoryFactory staticStubFactoryFactory = 124 PresentationDefaults.getStaticStubFactoryFactory() ; 125 126 public void set_parameters( Properties props ) { 127 } 128 129 protected void set_parameters(Applet app, Properties props) { 130 } 131 132 protected void set_parameters (String params[], Properties props) { 133 } 134 135 public OutputStream create_output_stream() { 136 return new EncapsOutputStream(this); 137 } 138 139 public TypeCode create_struct_tc(String id, 140 String name, 141 StructMember [] members) 142 { 143 return new TypeCodeImpl(this, TCKind._tk_struct, id, name, members); 144 } 145 146 public TypeCode create_union_tc(String id, 147 String name, 148 TypeCode discriminator_type, 149 UnionMember [] members) 150 { 151 return new TypeCodeImpl(this, 152 TCKind._tk_union, 153 id, 154 name, 155 discriminator_type, 156 members); 157 } 158 159 public TypeCode create_enum_tc(String id, 160 String name, 161 String [] members) 162 { 163 return new TypeCodeImpl(this, TCKind._tk_enum, id, name, members); 164 } 165 166 public TypeCode create_alias_tc(String id, 167 String name, 168 TypeCode original_type) 169 { 170 return new TypeCodeImpl(this, TCKind._tk_alias, id, name, original_type); 171 } 172 173 public TypeCode create_exception_tc(String id, 174 String name, 175 StructMember [] members) 176 { 177 return new TypeCodeImpl(this, TCKind._tk_except, id, name, members); 178 } 179 180 public TypeCode create_interface_tc(String id, 181 String name) 182 { 183 return new TypeCodeImpl(this, TCKind._tk_objref, id, name); 184 } 185 186 public TypeCode create_string_tc(int bound) { 187 return new TypeCodeImpl(this, TCKind._tk_string, bound); 188 } 189 190 public TypeCode create_wstring_tc(int bound) { 191 return new TypeCodeImpl(this, TCKind._tk_wstring, bound); 192 } 193 194 public TypeCode create_sequence_tc(int bound, 195 TypeCode element_type) 196 { 197 return new TypeCodeImpl(this, TCKind._tk_sequence, bound, element_type); 198 } 199 200 public TypeCode create_recursive_sequence_tc(int bound, 201 int offset) 202 { 203 return new TypeCodeImpl(this, TCKind._tk_sequence, bound, offset); 204 } 205 206 public TypeCode create_array_tc(int length, 207 TypeCode element_type) 208 { 209 return new TypeCodeImpl(this, TCKind._tk_array, length, element_type); 210 } 211 212 public org.omg.CORBA.TypeCode create_native_tc(String id, 213 String name) 214 { 215 return new TypeCodeImpl(this, TCKind._tk_native, id, name); 216 } 217 218 public org.omg.CORBA.TypeCode create_abstract_interface_tc( 219 String id, 220 String name) 221 { 222 return new TypeCodeImpl(this, TCKind._tk_abstract_interface, id, name); 223 } 224 225 public org.omg.CORBA.TypeCode create_fixed_tc(short digits, short scale) 226 { 227 return new TypeCodeImpl(this, TCKind._tk_fixed, digits, scale); 228 } 229 230 232 public org.omg.CORBA.TypeCode create_value_tc(String id, 233 String name, 234 short type_modifier, 235 TypeCode concrete_base, 236 ValueMember [] members) 237 { 238 return new TypeCodeImpl(this, TCKind._tk_value, id, name, 239 type_modifier, concrete_base, members); 240 } 241 242 public org.omg.CORBA.TypeCode create_recursive_tc(String id) { 243 return new TypeCodeImpl(this, id); 244 } 245 246 public org.omg.CORBA.TypeCode create_value_box_tc(String id, 247 String name, 248 TypeCode boxed_type) 249 { 250 return new TypeCodeImpl(this, TCKind._tk_value_box, id, name, boxed_type); 251 } 252 253 public TypeCode get_primitive_tc( TCKind tckind ) 254 { 255 return get_primitive_tc( tckind.value() ) ; 256 } 257 258 public Any create_any() { 259 return new AnyImpl(this); 260 } 261 262 268 269 public NVList create_list(int count) { 270 return new NVListImpl(this, count); 271 } 272 273 public org.omg.CORBA.NVList 274 create_operation_list(org.omg.CORBA.Object oper) { 275 throw wrapper.genericNoImpl() ; 276 } 277 278 public org.omg.CORBA.NamedValue 279 create_named_value(String s, Any any, int flags) { 280 return new NamedValueImpl(this, s, any, flags); 281 } 282 283 public org.omg.CORBA.ExceptionList create_exception_list() { 284 return new ExceptionListImpl(); 285 } 286 287 public org.omg.CORBA.ContextList create_context_list() { 288 return new ContextListImpl(this); 289 } 290 291 public org.omg.CORBA.Context get_default_context() 292 { 293 throw wrapper.genericNoImpl() ; 294 } 295 296 public org.omg.CORBA.Environment create_environment() 297 { 298 return new EnvironmentImpl(); 299 } 300 301 public org.omg.CORBA.Current get_current() 302 { 303 throw wrapper.genericNoImpl() ; 304 } 305 306 309 310 public String [] list_initial_services () 311 { 312 throw wrapper.genericNoImpl() ; 313 } 314 315 public org.omg.CORBA.Object resolve_initial_references(String identifier) 316 throws InvalidName 317 { 318 throw wrapper.genericNoImpl() ; 319 } 320 321 public void register_initial_reference( 322 String id, org.omg.CORBA.Object obj ) throws InvalidName 323 { 324 throw wrapper.genericNoImpl() ; 325 } 326 327 public void send_multiple_requests_oneway(Request [] req) { 328 throw new SecurityException ("ORBSingleton: access denied"); 329 } 330 331 public void send_multiple_requests_deferred(Request [] req) { 332 throw new SecurityException ("ORBSingleton: access denied"); 333 } 334 335 public boolean poll_next_response() { 336 throw new SecurityException ("ORBSingleton: access denied"); 337 } 338 339 public org.omg.CORBA.Request get_next_response() { 340 throw new SecurityException ("ORBSingleton: access denied"); 341 } 342 343 public String object_to_string(org.omg.CORBA.Object obj) { 344 throw new SecurityException ("ORBSingleton: access denied"); 345 } 346 347 public org.omg.CORBA.Object string_to_object(String s) { 348 throw new SecurityException ("ORBSingleton: access denied"); 349 } 350 351 public java.rmi.Remote string_to_remote(String s) 352 throws java.rmi.RemoteException 353 { 354 throw new SecurityException ("ORBSingleton: access denied"); 355 } 356 357 public void connect(org.omg.CORBA.Object servant) { 358 throw new SecurityException ("ORBSingleton: access denied"); 359 } 360 361 public void disconnect(org.omg.CORBA.Object obj) { 362 throw new SecurityException ("ORBSingleton: access denied"); 363 } 364 365 public void run() 366 { 367 throw new SecurityException ("ORBSingleton: access denied"); 368 } 369 370 public void shutdown(boolean wait_for_completion) 371 { 372 throw new SecurityException ("ORBSingleton: access denied"); 373 } 374 375 protected void shutdownServants(boolean wait_for_completion) { 376 throw new SecurityException ("ORBSingleton: access denied"); 377 } 378 379 protected void destroyConnections() { 380 throw new SecurityException ("ORBSingleton: access denied"); 381 } 382 383 public void destroy() { 384 throw new SecurityException ("ORBSingleton: access denied"); 385 } 386 387 public boolean work_pending() 388 { 389 throw new SecurityException ("ORBSingleton: access denied"); 390 } 391 392 public void perform_work() 393 { 394 throw new SecurityException ("ORBSingleton: access denied"); 395 } 396 397 public org.omg.CORBA.portable.ValueFactory register_value_factory(String repositoryID, 398 org.omg.CORBA.portable.ValueFactory factory) 399 { 400 throw new SecurityException ("ORBSingleton: access denied"); 401 } 402 403 public void unregister_value_factory(String repositoryID) 404 { 405 throw new SecurityException ("ORBSingleton: access denied"); 406 } 407 408 public org.omg.CORBA.portable.ValueFactory lookup_value_factory(String repositoryID) 409 { 410 throw new SecurityException ("ORBSingleton: access denied"); 411 } 412 413 public TransportManager getTransportManager() 414 { 415 throw new SecurityException ("ORBSingleton: access denied"); 416 } 417 418 public CorbaTransportManager getCorbaTransportManager() 419 { 420 throw new SecurityException ("ORBSingleton: access denied"); 421 } 422 423 public LegacyServerSocketManager getLegacyServerSocketManager() 424 { 425 throw new SecurityException ("ORBSingleton: access denied"); 426 } 427 428 431 432 private synchronized ORB getFullORB() 433 { 434 if (fullORB == null) { 435 Properties props = new Properties () ; 436 fullORB = new ORBImpl() ; 437 fullORB.set_parameters( props ) ; 438 } 439 440 return fullORB ; 441 } 442 443 public RequestDispatcherRegistry getRequestDispatcherRegistry() 444 { 445 447 return getFullORB().getRequestDispatcherRegistry(); 448 } 449 450 453 public ServiceContextRegistry getServiceContextRegistry() 454 { 455 throw new SecurityException ("ORBSingleton: access denied"); 456 } 457 458 461 public int getTransientServerId() 462 { 463 throw new SecurityException ("ORBSingleton: access denied"); 464 } 465 466 469 public int getORBInitialPort() 470 { 471 throw new SecurityException ("ORBSingleton: access denied"); 472 } 473 474 477 public String getORBInitialHost() 478 { 479 throw new SecurityException ("ORBSingleton: access denied"); 480 } 481 482 public String getORBServerHost() 483 { 484 throw new SecurityException ("ORBSingleton: access denied"); 485 } 486 487 public int getORBServerPort() 488 { 489 throw new SecurityException ("ORBSingleton: access denied"); 490 } 491 492 public CodeSetComponentInfo getCodeSetComponentInfo() 493 { 494 return new CodeSetComponentInfo(); 495 } 496 497 public boolean isLocalHost( String host ) 498 { 499 return false; 501 } 502 503 public boolean isLocalServerId( int subcontractId, int serverId ) 504 { 505 return false; 507 } 508 509 512 513 public ORBVersion getORBVersion() 514 { 515 return ORBVersionFactory.getORBVersion(); 517 } 518 519 public void setORBVersion(ORBVersion verObj) 520 { 521 throw new SecurityException ("ORBSingleton: access denied"); 522 } 523 524 public String getAppletHost() 525 { 526 throw new SecurityException ("ORBSingleton: access denied"); 527 } 528 529 public URL getAppletCodeBase() 530 { 531 throw new SecurityException ("ORBSingleton: access denied"); 532 } 533 534 public int getHighWaterMark(){ 535 throw new SecurityException ("ORBSingleton: access denied"); 536 } 537 538 public int getLowWaterMark(){ 539 throw new SecurityException ("ORBSingleton: access denied"); 540 } 541 542 public int getNumberToReclaim(){ 543 throw new SecurityException ("ORBSingleton: access denied"); 544 } 545 546 public int getGIOPFragmentSize() { 547 return ORBConstants.GIOP_DEFAULT_BUFFER_SIZE; 548 } 549 550 public int getGIOPBuffMgrStrategy(GIOPVersion gv) { 551 return BufferManagerFactory.GROW; 552 } 553 554 public IOR getFVDCodeBaseIOR(){ 555 throw new SecurityException ("ORBSingleton: access denied"); 556 } 557 558 public Policy create_policy( int type, Any val ) throws PolicyError 559 { 560 throw new NO_IMPLEMENT (); 561 } 562 563 public LegacyServerSocketEndPointInfo getServerEndpoint() 564 { 565 return null ; 566 } 567 568 public void setPersistentServerId( int id ) 569 { 570 } 571 572 public TypeCodeImpl getTypeCodeForClass( Class c ) 573 { 574 return null ; 575 } 576 577 public void setTypeCodeForClass( Class c, TypeCodeImpl tcimpl ) 578 { 579 } 580 581 public boolean alwaysSendCodeSetServiceContext() 582 { 583 return true ; 584 } 585 586 public boolean isDuringDispatch() 587 { 588 return false ; 589 } 590 591 public void notifyORB() { } 592 593 public PIHandler getPIHandler() 594 { 595 return null ; 596 } 597 598 public void checkShutdownState() 599 { 600 } 601 602 public void startingDispatch() 603 { 604 } 605 606 public void finishedDispatch() 607 { 608 } 609 610 public void registerInitialReference( String id, Closure closure ) 611 { 612 } 613 614 public ORBData getORBData() 615 { 616 return getFullORB().getORBData() ; 617 } 618 619 public void setClientDelegateFactory( ClientDelegateFactory factory ) 620 { 621 } 622 623 public ClientDelegateFactory getClientDelegateFactory() 624 { 625 return getFullORB().getClientDelegateFactory() ; 626 } 627 628 public void setCorbaContactInfoListFactory( CorbaContactInfoListFactory factory ) 629 { 630 } 631 632 public CorbaContactInfoListFactory getCorbaContactInfoListFactory() 633 { 634 return getFullORB().getCorbaContactInfoListFactory() ; 635 } 636 637 public Operation getURLOperation() 638 { 639 return null ; 640 } 641 642 public void setINSDelegate( CorbaServerRequestDispatcher sdel ) 643 { 644 } 645 646 public TaggedComponentFactoryFinder getTaggedComponentFactoryFinder() 647 { 648 return getFullORB().getTaggedComponentFactoryFinder() ; 649 } 650 651 public IdentifiableFactoryFinder getTaggedProfileFactoryFinder() 652 { 653 return getFullORB().getTaggedProfileFactoryFinder() ; 654 } 655 656 public IdentifiableFactoryFinder getTaggedProfileTemplateFactoryFinder() 657 { 658 return getFullORB().getTaggedProfileTemplateFactoryFinder() ; 659 } 660 661 public ObjectKeyFactory getObjectKeyFactory() 662 { 663 return getFullORB().getObjectKeyFactory() ; 664 } 665 666 public void setObjectKeyFactory( ObjectKeyFactory factory ) 667 { 668 throw new SecurityException ("ORBSingleton: access denied"); 669 } 670 671 public void handleBadServerId( ObjectKey okey ) 672 { 673 } 674 675 public OAInvocationInfo peekInvocationInfo() 676 { 677 return null ; 678 } 679 680 public void pushInvocationInfo( OAInvocationInfo info ) 681 { 682 } 683 684 public OAInvocationInfo popInvocationInfo() 685 { 686 return null ; 687 } 688 689 public ClientInvocationInfo createOrIncrementInvocationInfo() 690 { 691 return null ; 692 } 693 694 public void releaseOrDecrementInvocationInfo() 695 { 696 } 697 698 public ClientInvocationInfo getInvocationInfo() 699 { 700 return null ; 701 } 702 703 public ConnectionCache getConnectionCache(ContactInfo contactInfo) 704 { 705 return null; 706 } 707 708 public void setResolver( Resolver resolver ) 709 { 710 } 711 712 public Resolver getResolver() 713 { 714 return null ; 715 } 716 717 public void setLocalResolver( LocalResolver resolver ) 718 { 719 } 720 721 public LocalResolver getLocalResolver() 722 { 723 return null ; 724 } 725 726 public void setURLOperation( Operation stringToObject ) 727 { 728 } 729 730 public void setBadServerIdHandler( BadServerIdHandler handler ) 732 { 733 } 734 735 public void initBadServerIdHandler() 737 { 738 } 739 740 public Selector getSelector(int x) 741 { 742 return null; 743 } 744 745 public void setThreadPoolManager(ThreadPoolManager mgr) { 746 } 747 748 public ThreadPoolManager getThreadPoolManager() { 749 return null; 750 } 751 752 public CopierManager getCopierManager() { 753 return null ; 754 } 755 } 756 757 | Popular Tags |