Ejemplo n.º 1
0
  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);
    }
  }
Ejemplo n.º 2
0
  public Connection create_connection(ProtocolProperties props) {
    ClientIIOPConnection delegate = new ClientIIOPConnection();
    try {
      delegate.configure(configuration);
    } catch (ConfigurationException ce) {
      throw new org.omg.CORBA.INTERNAL("ConfigurationException: " + ce.getMessage());
    }

    return new WIOPConnection(delegate, tag);
  }
Ejemplo n.º 3
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());
    }
  }
Ejemplo n.º 4
0
  public Listener create_listener(ProtocolProperties props, int stacksize, short base_priority) {
    IIOPListener delegate =
        new IIOPListener() {
          @Override
          protected Connection createServerConnection(Socket socket, boolean is_ssl)
              throws IOException {
            return new WIOPConnection(super.createServerConnection(socket, is_ssl), tag);
          }
        };
    try {
      Iterator<ListenEndpoint> it =
          orb.getTransportManager().getListenEndpoints(Protocol.IIOP).iterator();
      delegate.setListenEndpoint(it.next());
      delegate.configure(configuration);
    } catch (ConfigurationException ce) {
      throw new org.omg.CORBA.INTERNAL("ConfigurationException: " + ce.getMessage());
    }

    return new WIOPListener(delegate, tag);
  }
Ejemplo n.º 5
0
  /**
   * 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;
  }