Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: a58af3100e22dd1bf90df14db3901e580019aa9b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
 * Copyright (c) 2009-2012 Eike Stepper (Loehne, Germany) and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    Eike Stepper - initial API and implementation
 */
package org.eclipse.emf.cdo.server.net4j;

import org.eclipse.emf.cdo.common.CDOCommonSession;
import org.eclipse.emf.cdo.server.IRepositoryProvider;
import org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerProtocolFactory;
import org.eclipse.emf.cdo.spi.server.ContainerRepositoryProvider;

import org.eclipse.net4j.util.container.IManagedContainer;

/**
 * Various static methods that may help with the server-side setup to support Net4j-specific CDO {@link CDOCommonSession sessions}.
 *
 * @author Eike Stepper
 */
public final class CDONet4jServerUtil
{
  private CDONet4jServerUtil()
  {
  }

  public static void prepareContainer(IManagedContainer container, IRepositoryProvider repositoryProvider)
  {
    container.registerFactory(new CDOServerProtocolFactory(repositoryProvider));
    container.registerFactory(new FailoverMonitor.Factory());
    container.registerFactory(new FailoverMonitor.AgentProtocol.Factory(container));
    container.registerFactory(new FailoverMonitor.ClientProtocol.Factory(container));
  }

  public static void prepareContainer(IManagedContainer container)
  {
    prepareContainer(container, new ContainerRepositoryProvider(container));
  }
}

Back to the top