Пример #1
0
  public void configure(Configuration config) throws ConfigurationException {
    configuration = (org.jacorb.config.Configuration) config;
    orb = configuration.getORB();

    logger = configuration.getLogger(configuration.getLoggerName(getClass()));

    if (configuration.getAttributeAsBoolean("jacorb.debug.dump_outgoing_messages", false)) {
      b_out = new ByteArrayOutputStream();
    }

    finalTimeout =
        configuration.getAttributeAsInteger(
            "jacorb.connection.timeout_after_closeconnection", 20000);
  }
Пример #2
0
  /**
   * in case a singleton orb is created the c'tor will access the JacORB configuration to configure
   * the orb. otherwise configure needs to be called to properly set up the created instance.
   *
   * @param isSingleton determine if a singleton orb is created.
   */
  protected ORBSingleton(boolean isSingleton) {
    super();

    try {
      if (isSingleton) {
        configuration = JacORBConfiguration.getConfiguration(null, null, null, false);

        // Don't call configure method as if this has been called from ORB::ctor
        // class construction order can cause issues.
        logger = configuration.getLogger("org.jacorb.orb.singleton");

        doStrictCheckOnTypecodeCreation =
            configuration.getAttributeAsBoolean("jacorb.interop.strict_check_on_tc_creation", true);

        final BufferManagerFactory bufferManagerFactory = newBufferManagerFactory(configuration);
        bufferManager = bufferManagerFactory.newSingletonBufferManager(configuration);

        typeCodeCache = NullTypeCodeCache.getInstance();
        typeCodeCompactor = NullTypeCodeCompactor.getInstance();

        configureCodeset();

        if (logger.isDebugEnabled()) {
          logger.debug("BufferManagerFactory: " + bufferManagerFactory);
          logger.debug("BufferManager: " + bufferManager);
          logger.debug(
              "jacorb.interop.strict_check_on_tc_creation set to "
                  + doStrictCheckOnTypecodeCreation);
          ClassLoader omgcl = org.omg.CORBA.ORB.class.getClassLoader();
          ClassLoader thiscl = this.getClass().getClassLoader();

          if (omgcl != thiscl) {
            logger.debug(
                "OMG.ORB classloader ("
                    + omgcl
                    + ") does not match JacORB ORBSingleton classloader ("
                    + thiscl
                    + "). This may cause problems; see the ProgrammingGuide for further details");
          }
        }
      }
    } catch (ConfigurationException e) {
      throw new INTERNAL(e.toString());
    }
  }
Пример #3
0
  protected void configure(Configuration config) throws ConfigurationException {
    configuration = config;

    logger = configuration.getLogger("org.jacorb.orb");

    doStrictCheckOnTypecodeCreation =
        configuration.getAttributeAsBoolean("jacorb.interop.strict_check_on_tc_creation", true);

    BufferManagerFactory bufferManagerFactory = newBufferManagerFactory(configuration);

    bufferManager =
        bufferManagerFactory.newBufferManager(
            ((ORBSingleton) org.omg.CORBA.ORBSingleton.init()).getBufferManager(), configuration);

    if (logger.isDebugEnabled()) {
      logger.debug("BufferManagerFactory: " + bufferManagerFactory);
      logger.debug("BufferManager: " + bufferManager);
      logger.debug(
          "jacorb.interop.strict_check_on_tc_creation set to " + doStrictCheckOnTypecodeCreation);
    }

    configureCodeset();
  }