示例#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();
  }
示例#4
0
  /** The constructor. Connects to default repository and fetches the servers. */
  public ImRModel() {
    m_orb = (org.jacorb.orb.ORB) org.omg.CORBA.ORB.init(new String[0], null);
    configuration = m_orb.getConfiguration();
    logger = configuration.getLogger("org.jacorb.imr.model");

    try {
      m_admin = AdminHelper.narrow(m_orb.resolve_initial_references("ImplementationRepository"));
    } catch (org.omg.CORBA.ORBPackage.InvalidName in) {
      if (logger.isWarnEnabled()) logger.warn("Could not contact Impl. Repository!");
      return;
    }

    fetchImRInfo();

    m_top_node = new DefaultMutableTreeNode(m_imr_info);
    m_tree_model = new DefaultTreeModel(m_top_node, false);
    m_tree = new JTree(m_tree_model);

    m_server_model = new ImRServerTableModel(this);
    m_poa_model = new ImRPOATableModel();

    m_server_names = new Hashtable();

    m_server_nodes = new Vector();
    m_poa_nodes = new Vector();

    m_host_names = new Hashtable();
    m_host_selector_model = new DefaultComboBoxModel();
    m_host_selector = new JComboBox(m_host_selector_model);
    m_host_selector.setEditable(true);

    fetchServers();
    m_tree.expandRow(0);

    m_refresh_thread = new RefreshThread(m_current_refresh_interval);
  }