Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: f8819804b7578138f260a1311a923710313f4565 (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
44
45
46
47
48
49
50
51
52
53
/*
 * Copyright (c) 2011, 2012 Eike Stepper (Berlin, 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.examples.server.offline;

import org.eclipse.emf.cdo.net4j.CDONet4jUtil;
import org.eclipse.emf.cdo.server.CDOServerBrowser;
import org.eclipse.emf.cdo.server.db.CDODBUtil;
import org.eclipse.emf.cdo.server.net4j.CDONet4jServerUtil;

import org.eclipse.net4j.Net4jUtil;
import org.eclipse.net4j.tcp.TCPUtil;
import org.eclipse.net4j.util.container.ContainerUtil;
import org.eclipse.net4j.util.container.IManagedContainer;

/**
 * @author Martin Fluegge
 * @since 4.0
 */
public class OfflineExampleUtil
{
  public static final String MASTER_NAME = "repo1";

  public static final int MASTER_PORT = 2036;

  public static final String CLONE_NAME = "clone";

  public static final int CLONE_PORT = 2037;

  public static IManagedContainer createContainer()
  {
    IManagedContainer container = ContainerUtil.createContainer();

    Net4jUtil.prepareContainer(container); // Register Net4j factories
    TCPUtil.prepareContainer(container); // Register TCP factories

    CDONet4jUtil.prepareContainer(container); // Register CDO client factories
    CDONet4jServerUtil.prepareContainer(container); // Register CDO server factories

    container.registerFactory(new CDOServerBrowser.ContainerBased.Factory(container));
    CDODBUtil.prepareContainer(container); // Register DBBrowserPage.Factory

    container.activate();
    return container;
  }
}

Back to the top