コード例 #1
0
  protected void startTransport() throws Exception {
    if (container != null) {
      IAcceptor acceptor = getAcceptor();
      LifecycleUtil.activate(acceptor);

      IConnector connector = getConnector();
      LifecycleUtil.activate(connector);
    }
  }
コード例 #2
0
  @Override
  protected void doSetUp() throws Exception {
    super.doSetUp();
    // create container for JVM or TCP only.
    container = createContainer();
    LifecycleUtil.activate(container);

    if (!useJVMTransport() && useSSLTransport()) {
      // the SSL need separate container between client and server
      separateContainer = createContainer();
      LifecycleUtil.activate(separateContainer);
    }
  }
コード例 #3
0
  protected void restartContainer() throws Exception {
    msg("RESTARTING CONTAINER"); // $NON-NLS-1$
    stopTransport();

    LifecycleUtil.deactivate(container);
    container = createContainer();
    LifecycleUtil.activate(container);

    if (!useJVMTransport() && useSSLTransport()) {
      LifecycleUtil.deactivate(separateContainer);
      separateContainer = createContainer();
      LifecycleUtil.activate(separateContainer);
    }
    startTransport();
    msg("RESTARTING CONTAINER - FINISHED"); // $NON-NLS-1$
  }
コード例 #4
0
  public void testAcceptorDefOpensConnection() {
    JVMAcceptorDef jvmAcceptorDef = Net4jDefsFactory.eINSTANCE.createJVMAcceptorDef();
    jvmAcceptorDef.setBufferProvider(Net4jDefsFactory.eINSTANCE.createBufferPoolDef());
    jvmAcceptorDef.setExecutorService(Net4jUtilDefsFactory.eINSTANCE.createThreadPoolDef());
    jvmAcceptorDef.setName(NAME);

    IJVMAcceptor jvmAcceptor = (IJVMAcceptor) jvmAcceptorDef.getInstance();

    assertEquals(true, LifecycleUtil.isActive(jvmAcceptor));

    LifecycleUtil.activate(jvmConnector);
    jvmConnector.waitForConnection(DELAY + TIMEOUT);

    assertEquals(true, LifecycleUtil.isActive(jvmConnector));

    LifecycleUtil.deactivate(jvmAcceptor);
  }
コード例 #5
0
 public void activate(ComponentContext context) throws Exception {
   Object rn = context.getProperties().get(REPO_NAME_PROPERTY);
   Object componentName = context.getProperties().get("component.name");
   String repoName = rn instanceof String ? (String) rn : String.valueOf(componentName);
   repository =
       CDOServerUtil.createRepository(
           repoName, createStore(context), getRepositoryProperties(context));
   LifecycleUtil.activate(repository);
 }
コード例 #6
0
ファイル: ConfigTest.java プロジェクト: sthibaudeau/cdo
  /** @category Repository */
  public InternalRepository restartRepository(String name) {
    IRepositoryConfig repositoryConfig = getRepositoryConfig();

    try {
      repositoryConfig.setRestarting(true);
      InternalRepository repo = getRepository(name);
      LifecycleUtil.deactivate(repo);
      return getRepository(name);
    } finally {
      repositoryConfig.setRestarting(false);
    }
  }
コード例 #7
0
 @Override
 protected void doTearDown() throws Exception {
   try {
     sleep(20);
     LifecycleUtil.deactivate(container);
   } finally {
     connector = null;
     acceptor = null;
     container = null;
     if (!useJVMTransport() && useSSLTransport()) {
       separateContainer = null;
     }
     super.doTearDown();
   }
 }
コード例 #8
0
 private ExecutorService createThreadPool() {
   ExecutorService threadPool = Executors.newCachedThreadPool();
   LifecycleUtil.activate(threadPool);
   return threadPool;
 }
コード例 #9
0
 private IBufferPool createBufferPool() {
   IBufferPool bufferPool = Net4jUtil.createBufferPool();
   LifecycleUtil.activate(bufferPool);
   return bufferPool;
 }
コード例 #10
0
 @Override
 protected void doTearDown() throws Exception {
   LifecycleUtil.deactivate(jvmConnector);
 }
コード例 #11
0
 public void deactivate() {
   if (repository != null) {
     LifecycleUtil.deactivate(repository);
   }
 }
コード例 #12
0
 @Override
 protected void doActivate() throws Exception {
   super.doActivate();
   LifecycleUtil.activate(delegate);
 }
コード例 #13
0
 @Override
 protected void doDeactivate() throws Exception {
   LifecycleUtil.deactivate(delegate);
   super.doDeactivate();
 }
コード例 #14
0
 protected void deactivateRepository() {
   LifecycleUtil.deactivate(repository);
   repository = null;
 }
コード例 #15
0
 protected void activateRepository(IRepository repository) {
   LifecycleUtil.activate(repository);
 }