Пример #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);
  }
 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
  /** @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);
 }
 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);
 }