コード例 #1
0
  protected IManagedContainer createContainer() {
    IManagedContainer container = ContainerUtil.createContainer();
    Net4jUtil.prepareContainer(container);
    if (useJVMTransport()) {
      JVMUtil.prepareContainer(container);
    } else {
      if (useSSLTransport()) {
        SSLUtil.prepareContainer(container);
      } else {
        TCPUtil.prepareContainer(container);
      }
    }

    return container;
  }
コード例 #2
0
ファイル: BaseTest.java プロジェクト: dzonekl/netxstudio
  /**
   * Initializes the connection and creates a {@link CDOSessionConfiguration} which is stored in a
   * member of this class.
   */
  protected void initialize() {
    OMPlatform.INSTANCE.setDebugging(true);
    OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
    OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);

    // Prepare container
    final IManagedContainer container = ContainerUtil.createContainer();
    Net4jUtil.prepareContainer(container); // Register Net4j factories
    TCPUtil.prepareContainer(container); // Register TCP factories
    CDONet4jUtil.prepareContainer(container); // Register CDO factories

    // LifecycleUtil.activate(container);
    container.activate();

    // Create connector
    final IConnector connector = TCPUtil.getConnector(container, CONNECTION_ADDRESS);

    // Create configuration
    sessionConfiguration = CDONet4jUtil.createSessionConfiguration();
    sessionConfiguration.setConnector(connector);
    sessionConfiguration.setRepositoryName(REPO_NAME);
  }
コード例 #3
0
ファイル: JMSTest.java プロジェクト: merks/cdo
  private static Context init() throws Exception {
    OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
    OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
    OMPlatform.INSTANCE.setDebugging(true);

    IDBAdapter.REGISTRY.put(EmbeddedDerbyAdapter.NAME, new EmbeddedDerbyAdapter());
    IStore store = JDBCUtil.getStore();
    Server.INSTANCE.setStore(store);
    Server.INSTANCE.activate();

    IManagedContainer container = new ManagedContainer();
    Net4jUtil.prepareContainer(container);
    TCPUtil.prepareContainer(container);
    JMSServerUtil.prepareContainer(container);

    TCPUtil.getAcceptor(container, null);
    IConnector connector = TCPUtil.getConnector(container, "localhost"); // $NON-NLS-1$

    IJMSAdmin admin = JMSAdminUtil.createAdmin(connector);
    admin.createQueue("StockQueue"); // $NON-NLS-1$
    admin.createTopic("StockTopic"); // $NON-NLS-1$

    return new JMSInitialContext(container);
  }