コード例 #1
0
ファイル: WIOPFactories.java プロジェクト: kjniemi/JacORB
  public Profile demarshal_profile(
      TaggedProfileHolder tagged_profile, TaggedComponentSeqHolder components) {
    if (tagged_profile.value.tag != this.tag) {
      throw new org.omg.CORBA.BAD_PARAM(
          "wrong profile for WIOP transport, tag: " + tagged_profile.value.tag);
    } else {
      IIOPProfile result = new IIOPProfile(tagged_profile.value.profile_data);

      try {
        result.configure(configuration);
      } catch (ConfigurationException e) {
        throw new org.omg.CORBA.INTERNAL("ConfigurationException: " + e.toString());
      }

      try {
        result.configure(configuration);
      } catch (ConfigurationException e) {
        throw new org.omg.CORBA.INTERNAL("ConfigurationException: " + e.toString());
      }

      components.value = result.getComponents().asArray();

      return new WIOPProfile(result, this.tag);
    }
  }
コード例 #2
0
ファイル: ORBSingleton.java プロジェクト: kjniemi/JacORB
  /**
   * 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
ファイル: IIOPListener.java プロジェクト: SteveOss/JacORB
  /**
   * Template method to create a server-side ETF Connection. This can be overridden by subclasses to
   * pass a different kind of Connection up to the ORB.
   */
  protected Connection createServerConnection(Socket socket, boolean is_ssl) throws IOException {
    final TCPConnectionListener tcpListener = socketFactoryManager.getTCPListener();
    ServerIIOPConnection result = new ServerIIOPConnection(socket, is_ssl, tcpListener);

    if (tcpListener.isListenerEnabled()) {
      tcpListener.connectionOpened(
          new TCPConnectionEvent(
              result,
              socket.getInetAddress().getHostAddress(),
              socket.getPort(),
              socket.getLocalPort(),
              getLocalhost()));
    }

    try {
      result.configure(configuration);
    } catch (ConfigurationException ce) {
      throw new org.omg.CORBA.INTERNAL("ConfigurationException: " + ce.toString());
    }
    return result;
  }