1 23 package com.sun.enterprise.util; 24 25 import org.omg.CORBA.ORB ; 26 27 import java.util.*; 28 import java.io.*; 29 30 import javax.rmi.PortableRemoteObject ; 32 33 import javax.naming.InitialContext ; 34 import javax.naming.Context ; 35 36 import com.sun.corba.ee.impl.orbutil.ORBConstants; 37 import com.sun.corba.ee.spi.oa.rfm.ReferenceFactoryManager; 38 39 import com.sun.enterprise.log.Log; 40 41 import com.sun.enterprise.server.ApplicationServer; 42 import com.sun.enterprise.server.ServerContext; 43 44 import com.sun.enterprise.config.ConfigContext; 45 import com.sun.enterprise.config.ConfigException; 46 import com.sun.enterprise.config.ConfigBean; 47 import com.sun.enterprise.config.serverbeans.ElementProperty; 48 import com.sun.enterprise.config.serverbeans.Server; 49 import com.sun.enterprise.config.serverbeans.IiopService; 50 import com.sun.enterprise.config.serverbeans.IiopListener; 51 import com.sun.enterprise.config.serverbeans.ServerBeansFactory; 52 import com.sun.enterprise.config.serverbeans.Orb; 53 import com.sun.enterprise.admin.monitor.GenericMonitorMBean; 54 import com.sun.enterprise.admin.monitor.MonitoredObjectType; 55 import com.sun.enterprise.admin.monitor.MonitoringHelper; 56 import com.sun.enterprise.iiop.ASORBUtilities; 57 import com.sun.enterprise.iiop.CSIv2SSLTaggedComponentHandlerImpl; 58 import com.sun.enterprise.iiop.FailoverIORInterceptor; 59 import com.sun.enterprise.iiop.IIOPPrimaryToContactInfoImpl; 60 import com.sun.enterprise.iiop.ORBMonitoring; 61 import com.sun.enterprise.iiop.PEORBConfigurator; 62 63 import javax.management.InstanceAlreadyExistsException ; 64 import javax.management.MBeanRegistrationException ; 65 import com.sun.enterprise.Switch; 66 import com.sun.enterprise.config.serverbeans.Ssl; 67 import com.sun.enterprise.config.serverbeans.SslClientConfig; 68 import java.util.logging.*; 69 import com.sun.logging.*; 70 71 76 77 public final class ORBManager { 78 static Logger logger=LogDomains.getLogger(LogDomains.UTIL_LOGGER); 79 private static final boolean debug = com.sun.enterprise.util.logging.Debug.enabled; 80 81 private static final String ORB_CLASS = 84 "com.sun.corba.ee.impl.orb.ORBImpl"; 85 private static final String ORB_SINGLETON_CLASS = 86 "com.sun.corba.ee.impl.orb.ORBSingleton"; 87 88 private static final String ORB_SE_CLASS = 89 "com.sun.corba.se.impl.orb.ORBImpl"; 90 private static final String ORB_SE_SINGLETON_CLASS = 91 "com.sun.corba.se.impl.orb.ORBSingleton"; 92 93 private static final String PEORB_CONFIG_CLASS = 94 "com.sun.enterprise.iiop.PEORBConfigurator"; 95 private static final String IIOP_SSL_SOCKET_FACTORY_CLASS = 96 "com.sun.enterprise.iiop.IIOPSSLSocketFactory"; 97 private static final String RMI_UTIL_CLASS = 98 "com.sun.corba.ee.impl.javax.rmi.CORBA.Util"; 99 private static final String RMI_STUB_CLASS = 100 "com.sun.corba.ee.impl.javax.rmi.CORBA.StubDelegateImpl"; 101 private static final String RMI_PRO_CLASS = 102 "com.sun.corba.ee.impl.javax.rmi.PortableRemoteObject"; 103 104 public static final String JNDI_PROVIDER_URL_PROPERTY = 106 "java.naming.provider.url"; 107 public static final String JNDI_CORBA_ORB_PROPERTY = 108 "java.naming.corba.orb"; 109 110 public static final String ORB_UTIL_CLASS_PROPERTY = 112 "javax.rmi.CORBA.UtilClass"; 113 public static final String RMIIIOP_STUB_DELEGATE_CLASS_PROPERTY = 114 "javax.rmi.CORBA.StubClass"; 115 public static final String RMIIIOP_PRO_DELEGATE_CLASS_PROPERTY = 116 "javax.rmi.CORBA.PortableRemoteObjectClass"; 117 118 public static final String OMG_ORB_CLASS_PROPERTY = 120 "org.omg.CORBA.ORBClass"; 121 public static final String OMG_ORB_SINGLETON_CLASS_PROPERTY = 122 "org.omg.CORBA.ORBSingletonClass"; 123 public static final String OMG_ORB_INIT_HOST_PROPERTY = 124 ORBConstants.INITIAL_HOST_PROPERTY ; 125 public static final String OMG_ORB_INIT_PORT_PROPERTY = 126 ORBConstants.INITIAL_PORT_PROPERTY ; 127 private static final String PI_ORB_INITIALIZER_CLASS_PREFIX = 128 ORBConstants.PI_ORB_INITIALIZER_CLASS_PREFIX ; 129 130 public static final String SUN_USER_CONFIGURATOR_PREFIX = 132 ORBConstants.USER_CONFIGURATOR_PREFIX ; 133 public static final String SUN_ORB_ID_PROPERTY = 134 ORBConstants.ORB_ID_PROPERTY ; 135 public static final String SUN_ORB_SERVER_HOST_PROPERTY = 136 ORBConstants.SERVER_HOST_PROPERTY ; 137 public static final String SUN_ORB_SERVER_PORT_PROPERTY = 138 ORBConstants.SERVER_PORT_PROPERTY ; 139 public static final String SUN_ORB_SOCKET_FACTORY_CLASS_PROPERTY = 140 ORBConstants.SOCKET_FACTORY_CLASS_PROPERTY ; 141 public static final String SUN_ORB_IOR_TO_SOCKETINFO_CLASS_PROPERTY = 142 ORBConstants.IOR_TO_SOCKET_INFO_CLASS_PROPERTY ; 143 public static final String SUN_MAX_CONNECTIONS_PROPERTY = 144 ORBConstants.HIGH_WATER_MARK_PROPERTY; 145 public static final String ORB_LISTEN_SOCKET_PROPERTY = 146 ORBConstants.LISTEN_SOCKET_PROPERTY ; 147 public static final String ORB_DISABLED_PORTS_PROPERTY = 150 "com.sun.CORBA.connection.ORBDisabledListenPorts"; 151 private static final String SUN_LISTEN_ADDR_ANY_ADDRESS = 152 "com.sun.CORBA.orb.AddrAnyAddress"; 153 private static final String ORB_IOR_ADDR_ANY_INITIALIZER = 154 "com.sun.enterprise.iiop.IORAddrAnyInitializer"; 155 156 private static final String DEFAULT_SERVER_ID = "100" ; 158 private static final String DEFAULT_MAX_CONNECTIONS = "1024"; 159 private static final String J2EE_INITIALIZER = 160 "com.sun.enterprise.iiop.J2EEInitializer"; 161 private static final String SUN_GIOP_DEFAULT_FRAGMENT_SIZE = "1024"; 162 private static final String SUN_GIOP_DEFAULT_BUFFER_SIZE = "1024"; 163 164 private static final String IIOP_CLEAR_TEXT_CONNECTION = 165 "IIOP_CLEAR_TEXT"; 166 private static final String DEFAULT_ORB_INIT_HOST = "localhost"; 167 168 private static final String DEFAULT_ORB_INIT_PORT = "3700"; 177 178 private static final String SSL = "SSL"; 180 private static final String SSL_MUTUALAUTH = "SSL_MUTUALAUTH"; 181 private static final String ORB_SSL_CERTDB_PATH = 182 "com.sun.CSIV2.ssl.CertDB"; 183 private static final String ORB_SSL_CERTDB_PASSWORD = 184 "com.sun.CSIV2.ssl.CertDBPassword"; 185 public static final String SUN_GIOP_FRAGMENT_SIZE_PROPERTY = 186 "com.sun.CORBA.giop.ORBFragmentSize"; 187 public static final String SUN_GIOP_BUFFER_SIZE_PROPERTY = 188 "com.sun.CORBA.giop.ORBBufferSize"; 189 190 public static final String ORB_SSL_CLIENT_REQUIRED = 193 "com.sun.CSIV2.ssl.client.required"; 194 public static final String ORB_SSL_SERVER_REQUIRED = 198 "com.sun.CSIV2.ssl.server.required"; 199 public static final String ORB_CLIENT_AUTH_REQUIRED = 203 "com.sun.CSIV2.client.auth.required"; 204 205 public static final String S1AS_ORB_ID = "S1AS-ORB"; 207 208 private static boolean propertiesInitialized = false; 209 210 private static org.omg.CORBA.ORB orb = null; 212 213 private static ReferenceFactoryManager rfm = null; 215 216 private static int orbInitialPort = -1; 217 218 private static IiopListener[] iiopListenerBeans = null; 219 private static Orb orbBean = null; 220 private static IiopService iiopServiceBean = null; 221 222 private static Properties csiv2Props = new Properties(); 223 224 private static final Properties EMPTY_PROPERTIES = new Properties() ; 225 226 229 private ORBManager () {} 230 231 234 public static boolean isEjbAdapterName( String [] adapterName ) { 235 boolean result = false ; 238 if (rfm != null) 239 result = rfm.find( adapterName ) != null ; 240 241 return result ; 242 } 243 244 247 public static boolean isIsACall( String operationName ) { 248 return operationName.equals( "_is_a" ) ; 249 } 250 251 256 public static synchronized org.omg.CORBA.ORB getORB( Properties props ) { 257 try { 258 if(logger.isLoggable(Level.FINEST)) { 259 logger.log(Level.FINEST, "ORBManager.getORB->: " + orb); 260 } 261 262 initProperties() ; 263 if (orb == null) 264 initORB( props ) ; 265 266 return orb; 267 } finally { 268 if(logger.isLoggable(Level.FINEST)) { 269 logger.log(Level.FINEST, "ORBManager.getORB<-: " + orb); 270 } 271 } 272 } 273 274 public static org.omg.CORBA.ORB getORB() { 275 return getORB( EMPTY_PROPERTIES ) ; 276 } 277 278 public static synchronized Properties getCSIv2Props() { 279 initProperties() ; 280 281 return csiv2Props; 282 } 283 284 public static synchronized int getORBInitialPort() { 285 initProperties() ; 286 287 return orbInitialPort; 288 } 289 290 private static void initProperties() { 291 try { 292 if (logger.isLoggable(Level.FINE)) { 293 logger.log(Level.FINE, "ORBManager.initProperties->: " + orb); 294 } 295 296 if (propertiesInitialized) 297 return ; 298 299 try { 300 ServerContext serverContext = ApplicationServer.getServerContext(); 301 if (serverContext == null) { 302 String initialPort = checkORBInitialPort( EMPTY_PROPERTIES ) ; 304 305 return ; 306 } else { 307 ConfigContext configContext = serverContext.getConfigContext(); 308 assert(configContext != null); 309 310 Server serverBean = ServerBeansFactory.getServerBean(configContext); 311 assert(serverBean != null); 312 313 iiopServiceBean = ServerBeansFactory.getIiopServiceBean(configContext); 314 315 assert(iiopServiceBean != null); 316 317 iiopListenerBeans = iiopServiceBean.getIiopListener(); 318 assert (iiopListenerBeans != null && iiopListenerBeans.length > 0); 319 320 String initialPort = checkORBInitialPort( EMPTY_PROPERTIES ) ; 322 323 orbBean = iiopServiceBean.getOrb(); 324 assert (orbBean != null); 325 326 csiv2Props.put(ORB_CLIENT_AUTH_REQUIRED, String.valueOf( 329 iiopServiceBean.isClientAuthenticationRequired())); 330 boolean corbaSSLRequired = true; 331 for ( int i=0; i<iiopListenerBeans.length; i++ ) { 334 if ( iiopListenerBeans[i].getSsl() == null ) { 335 corbaSSLRequired = false; 336 break; 337 } 338 } 339 340 csiv2Props.put(ORB_SSL_SERVER_REQUIRED, String.valueOf( 341 corbaSSLRequired)); 342 } 343 } catch (ConfigException cfe) { 344 logger.log(Level.SEVERE,"enterprise_util.orbmgr_config_excep", cfe); 345 } catch (NullPointerException npe) { 346 logger.log(Level.FINE,"Server Context is NULL. Ignoring and proceeding."); 348 } 349 } finally { 350 propertiesInitialized = true ; 352 if(logger.isLoggable(Level.FINE)) { 353 logger.log(Level.FINE, "ORBManager.initProperties<-: " + orb); 354 } 355 } 356 } 357 358 365 public static void setORBSystemProperties() { 366 367 java.security.AccessController.doPrivileged( 368 new java.security.PrivilegedAction () { 369 public java.lang.Object run() { 370 if (System.getProperty(OMG_ORB_CLASS_PROPERTY) == null) { 371 System.setProperty( OMG_ORB_CLASS_PROPERTY, ORB_SE_CLASS ) ; 372 } 373 374 if (System.getProperty(OMG_ORB_SINGLETON_CLASS_PROPERTY) == null) { 375 System.setProperty(OMG_ORB_SINGLETON_CLASS_PROPERTY, 376 ORB_SE_SINGLETON_CLASS); 377 } 378 379 System.setProperty(ORB_UTIL_CLASS_PROPERTY, 380 RMI_UTIL_CLASS ) ; 381 382 System.setProperty(RMIIIOP_STUB_DELEGATE_CLASS_PROPERTY, 383 RMI_STUB_CLASS ) ; 384 385 System.setProperty(RMIIIOP_PRO_DELEGATE_CLASS_PROPERTY, 386 RMI_PRO_CLASS ) ; 387 388 return null; 389 } 390 } 391 ); 392 } 393 394 396 private static void setFOLBProperties( Properties orbInitProperties ) { 397 398 orbInitProperties.put(ORBConstants.RFM_PROPERTY,"dummy"); 399 orbInitProperties.put(SUN_ORB_SOCKET_FACTORY_CLASS_PROPERTY, 400 IIOP_SSL_SOCKET_FACTORY_CLASS ) ; 401 402 orbInitProperties.setProperty( 408 ORBConstants.USER_CONFIGURATOR_PREFIX 409 + com.sun.corba.ee.impl.folb.ClientGroupManager.class.getName(), 410 "dummy"); 411 412 orbInitProperties.setProperty( 414 ORBConstants.USER_CONFIGURATOR_PREFIX 415 + CSIv2SSLTaggedComponentHandlerImpl.class.getName(), 416 "dummy"); 417 418 if (ASORBUtilities.isGMSAvailableAndClusterHeartbeatEnabled()) { 419 if(logger.isLoggable(Level.FINE)) { 420 logger.log(Level.FINE, "GMS available and enabled - doing EE initialization"); 421 } 422 423 orbInitProperties.setProperty( 428 ORBConstants.USER_CONFIGURATOR_PREFIX 429 + com.sun.corba.ee.impl.folb.ServerGroupManager.class.getName(), 430 "dummy"); 431 432 if(logger.isLoggable(Level.FINE)) { 433 logger.log(Level.FINE, "Did EE property initialization"); 434 } 435 } else { 436 if(logger.isLoggable(Level.FINE)) { 437 logger.log(Level.FINE, "Doing PE initialization"); 438 } 439 440 orbInitProperties.put(ORBConstants.PI_ORB_INITIALIZER_CLASS_PREFIX 441 + FailoverIORInterceptor.class.getName(), "dummy"); 442 443 if(logger.isLoggable(Level.FINE)) { 444 logger.log(Level.FINE, "Did PE property initialization"); 445 } 446 } 447 } 448 449 private static void initORB(Properties props) { 450 try { 451 if(logger.isLoggable(Level.FINE)) { 452 logger.log(Level.FINE, ".initORB->: " ); 453 } 454 455 457 Properties orbInitProperties = new Properties(); 458 orbInitProperties.putAll(props); 459 460 orbInitProperties.put(SUN_USER_CONFIGURATOR_PREFIX 462 + PEORB_CONFIG_CLASS, "dummy" ); 463 464 setFOLBProperties( orbInitProperties ) ; 465 466 orbInitProperties.put(ORBConstants.ORB_SERVER_ID_PROPERTY, 468 DEFAULT_SERVER_ID ) ; 469 orbInitProperties.put( OMG_ORB_CLASS_PROPERTY, ORB_CLASS); 470 orbInitProperties.put( 471 PI_ORB_INITIALIZER_CLASS_PREFIX + J2EE_INITIALIZER, ""); 472 473 orbInitProperties.put(ORBConstants.ALLOW_LOCAL_OPTIMIZATION, 474 "true" ) ; 475 476 orbInitProperties.put(SUN_ORB_ID_PROPERTY, S1AS_ORB_ID); 477 orbInitProperties.put(ORBConstants.SHOW_INFO_MESSAGES, "true"); 478 479 String initialPort = checkORBInitialPort(orbInitProperties); 482 483 String orbInitialHost = checkORBInitialHost(orbInitProperties); 484 485 String [] args = getORBInitRef(orbInitialHost, initialPort); 487 488 checkAdditionalORBListeners(orbInitProperties); 489 checkConnectionSettings(orbInitProperties); 490 checkMessageFragmentSize(orbInitProperties); 491 checkServerSSLOutboundSettings(orbInitProperties); 492 checkForOrbPropertyValues(orbInitProperties); 493 494 if (Switch.getSwitch().getContainerType() == Switch.EJBWEB_CONTAINER) { 499 PEORBConfigurator.setThreadPoolManager(); 500 } 501 502 orb = ORB.init(args, orbInitProperties); 507 508 rfm = (ReferenceFactoryManager)orb.resolve_initial_references( 509 ORBConstants.REFERENCE_FACTORY_MANAGER ) ; 510 511 ASORBUtilities.initGIS(orb); 512 513 ((com.sun.corba.ee.spi.orb.ORB)orb).getFVDCodeBaseIOR() ; 517 518 } catch ( Exception ex ) { 519 logger.log(Level.SEVERE,"enterprise_util.excep_in_createorb",ex); 520 throw new RuntimeException ( ex ) ; 521 } finally { 522 if(logger.isLoggable(Level.FINE)) { 523 logger.log(Level.FINE, ".initORB<-: " ); 524 } 525 } 526 } 527 528 private static String checkForAddrAny(Properties props, String orbInitialHost) { 529 if ((orbInitialHost.equals("0.0.0.0")) || (orbInitialHost.equals("::")) 530 || (orbInitialHost.equals("::ffff:0.0.0.0"))) { 531 535 try { 536 String localAddress = java.net.InetAddress.getLocalHost().getHostAddress(); 537 return localAddress; 538 } catch (java.net.UnknownHostException uhe) { 539 logger.log(Level.WARNING,"Unknown host exception - Setting host to localhost"); 540 return DEFAULT_ORB_INIT_HOST; 541 } 542 } else { 543 props.setProperty(SUN_ORB_SERVER_HOST_PROPERTY, orbInitialHost); 546 return orbInitialHost; 547 } 548 } 549 550 private static String checkORBInitialHost(Properties props) { 551 String orbInitialHost = System.getProperty(OMG_ORB_INIT_HOST_PROPERTY); 553 if ( orbInitialHost == null ) 554 orbInitialHost = props.getProperty(OMG_ORB_INIT_HOST_PROPERTY); 555 if ( orbInitialHost == null ) { 556 try { 557 orbInitialHost = iiopListenerBeans[0].getAddress(); 558 orbInitialHost = checkForAddrAny(props, orbInitialHost); 559 } catch (NullPointerException npe) { 560 logger.log(Level.FINE,"IIOP listener element is null. Ignoring and proceeding."); 562 } 563 } 564 if( orbInitialHost == null ) 565 orbInitialHost = DEFAULT_ORB_INIT_HOST; 566 567 props.setProperty(OMG_ORB_INIT_HOST_PROPERTY, orbInitialHost); 568 569 if ( debug ) { 570 if (logger.isLoggable(Level.FINE)) 571 logger.log(Level.FINE,"Setting orb initial host to " + orbInitialHost); 572 } 573 return orbInitialHost; 574 } 575 576 private static String checkORBInitialPort(Properties props) { 577 String initialPort = System.getProperty(OMG_ORB_INIT_PORT_PROPERTY); 579 if ( initialPort == null ) 580 initialPort = props.getProperty(OMG_ORB_INIT_PORT_PROPERTY); 581 582 if ( initialPort == null ) { 583 try { 584 initialPort = iiopListenerBeans[0].getPort(); 585 if (!iiopListenerBeans[0].isEnabled()) { 586 props.setProperty(ORB_DISABLED_PORTS_PROPERTY, initialPort); 587 } 588 if (!iiopListenerBeans[0].isEnabled()) { 599 props.setProperty(SUN_ORB_SERVER_PORT_PROPERTY, "-1"); 602 } else { 603 props.setProperty(SUN_ORB_SERVER_PORT_PROPERTY, initialPort); 604 } 605 } catch (NullPointerException npe) { 606 logger.log(Level.FINE,"IIOP listener element is null. Ignoring and proceeding."); 607 } 608 } 609 610 if( initialPort == null ) 611 initialPort = DEFAULT_ORB_INIT_PORT; 612 613 props.setProperty(OMG_ORB_INIT_PORT_PROPERTY, initialPort); 617 618 if (Switch.getSwitch().getContainerType() == Switch.EJBWEB_CONTAINER) { 622 props.setProperty(ORBConstants.PERSISTENT_SERVER_PORT_PROPERTY, 623 initialPort); 624 } 625 626 if ( debug ) { 627 if (logger.isLoggable(Level.FINE)) 628 logger.log(Level.FINE,"Setting orb initial port to " + initialPort); 629 } 630 631 orbInitialPort = new Integer (initialPort).intValue(); 632 633 return initialPort; 634 } 635 636 private static void checkAdditionalORBListeners(Properties props) { 637 if (iiopListenerBeans != null) { 639 StringBuffer listenSockets = new StringBuffer (""); 642 for (int i=0; i<iiopListenerBeans.length; i++) { 643 if ( i==0 && iiopListenerBeans[0].getSsl() == null ) { 644 continue; 647 } 648 649 if (iiopListenerBeans[i].isEnabled()) { 650 if (!iiopListenerBeans[i].isSecurityEnabled() || 651 iiopListenerBeans[i].getSsl() == null) { 652 653 checkForAddrAny(props, iiopListenerBeans[i].getAddress()); 654 listenSockets.append((listenSockets.length()>0 ? "," : "") 655 + IIOP_CLEAR_TEXT_CONNECTION 656 + ":" + iiopListenerBeans[i].getPort()); 657 } else { 658 Ssl sslBean = null; 659 sslBean = iiopListenerBeans[i].getSsl(); 660 assert sslBean != null; 661 662 String type; 664 boolean clientAuth = sslBean.isClientAuthEnabled(); 665 if (clientAuth) 666 type = SSL_MUTUALAUTH; 667 else 668 type = SSL; 669 670 listenSockets.append((listenSockets.length()>0 ? ",":"") 672 + type+":"+iiopListenerBeans[i].getPort()); 673 } 674 } 675 } 676 677 props.setProperty(ORB_LISTEN_SOCKET_PROPERTY, listenSockets.toString()); 679 } 680 681 return; 682 } 683 684 private static void checkConnectionSettings(Properties props) { 685 if (orbBean != null) { 686 String maxConnections; 687 688 try { 689 maxConnections = orbBean.getMaxConnections(); 690 691 Integer.parseInt(maxConnections); 693 } catch (NumberFormatException nfe) { 694 if(logger.isLoggable(Level.WARNING)) { 695 logger.log(Level.WARNING,"enterprise_util.excep_orbmgr_numfmt", nfe); 696 } 697 698 maxConnections = DEFAULT_MAX_CONNECTIONS; 699 } 700 701 props.setProperty(SUN_MAX_CONNECTIONS_PROPERTY, maxConnections); 702 } 703 return; 704 } 705 706 private static void checkMessageFragmentSize(Properties props) { 707 if (orbBean != null) { 708 String fragmentSize, bufferSize; 709 try { 710 int fsize = ((Integer.parseInt(orbBean.getMessageFragmentSize().trim()))/8) * 8; 711 if (fsize < 32) { 712 fragmentSize = "32"; 713 logger.log(Level.INFO,"Setting ORB Message Fragment size to " + fragmentSize); 714 } 715 else { 716 fragmentSize = String.valueOf(fsize); 717 } 718 bufferSize = fragmentSize; 719 } catch (NumberFormatException nfe) { 720 logger.log(Level.WARNING,"enterprise_util.excep_in_reading_fragment_size", nfe); 722 logger.log(Level.INFO,"Setting ORB Message Fragment size to Default " + 723 SUN_GIOP_DEFAULT_FRAGMENT_SIZE); 724 fragmentSize = SUN_GIOP_DEFAULT_FRAGMENT_SIZE; 725 bufferSize = SUN_GIOP_DEFAULT_BUFFER_SIZE; 726 } 727 props.setProperty(SUN_GIOP_FRAGMENT_SIZE_PROPERTY, fragmentSize); 728 props.setProperty(SUN_GIOP_BUFFER_SIZE_PROPERTY, bufferSize); 729 } 730 } 731 732 private static void checkServerSSLOutboundSettings(Properties props) { 733 if (iiopServiceBean != null) { 734 SslClientConfig sslClientConfigBean = iiopServiceBean.getSslClientConfig(); 735 if (sslClientConfigBean != null) { 736 Ssl ssl = sslClientConfigBean.getSsl(); 737 assert(ssl != null); 738 } 739 } 740 } 741 742 private static void checkForOrbPropertyValues(Properties props) { 743 if (orbBean != null) { 744 ElementProperty[] ep = orbBean.getElementProperty() ; 745 if (ep != null) { 746 for (int i = 0; i < ep.length; i++) { 747 props.setProperty(ep[i].getName(), ep[i].getValue()); 748 } 749 } 750 } 751 } 752 753 private static String [] getORBInitRef(String orbInitialHost, 754 String initialPort) 755 { 756 String [] newArgs = new String []{ 759 "-ORBInitRef", 760 "NameService=corbaloc:iiop:1.2@" 761 + orbInitialHost + ":" 762 + initialPort + "/NameService" 763 } ; 764 765 return newArgs; 766 } 767 } 768 | Popular Tags |