Exemple #1
0
/**
 * The <em>Operations & Maintenance</em> class of this bundle.
 *
 * @author Eike Stepper
 */
public abstract class OM {
  public static final String BUNDLE_ID = "org.eclipse.emf.cdo.common"; // $NON-NLS-1$

  public static final OMBundle BUNDLE = OMPlatform.INSTANCE.bundle(BUNDLE_ID, OM.class);

  public static final OMTracer DEBUG = BUNDLE.tracer("debug"); // $NON-NLS-1$

  public static final OMTracer DEBUG_PROTOCOL = DEBUG.tracer("protocol"); // $NON-NLS-1$

  public static final OMTracer DEBUG_ID = DEBUG.tracer("id"); // $NON-NLS-1$

  public static final OMTracer DEBUG_REVISION = DEBUG.tracer("revision"); // $NON-NLS-1$

  public static final OMTracer PERF = BUNDLE.tracer("perf"); // $NON-NLS-1$

  public static final OMTracer PERF_REVISION = PERF.tracer("revision"); // $NON-NLS-1$

  public static final OMTracer PERF_REVISION_READING =
      PERF_REVISION.tracer("reading"); // $NON-NLS-1$

  public static final OMTracer PERF_REVISION_WRITING =
      PERF_REVISION.tracer("writing"); // $NON-NLS-1$

  public static final OMLogger LOG = BUNDLE.logger();

  /** @author Eike Stepper */
  public static final class Activator extends OSGiActivator {
    public Activator() {
      super(BUNDLE);
    }
  }
}
Exemple #2
0
  /**
   * 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);
  }
Exemple #3
0
  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);
  }
Exemple #4
0
/**
 * The <em>Operations & Maintenance</em> class of this bundle.
 *
 * @author Eike Stepper
 */
public abstract class OM {
  public static final String BUNDLE_ID = "org.eclipse.emf.cdo.examples"; // $NON-NLS-1$

  public static final OMBundle BUNDLE = OMPlatform.INSTANCE.bundle(BUNDLE_ID, OM.class);

  public static final OMTracer DEBUG = BUNDLE.tracer("debug"); // $NON-NLS-1$

  public static final OMLogger LOG = BUNDLE.logger();

  /** @author Eike Stepper */
  public static final class Activator extends OSGiActivator {
    public Activator() {
      super(BUNDLE);
    }
  }
}
Exemple #5
0
/**
 * The <em>Operations & Maintenance</em> class of this bundle.
 *
 * @author Victor Roldan Betancort
 */
public abstract class OM {
  public static final String BUNDLE_ID = "org.eclipse.emf.cdo.server.db4o"; // $NON-NLS-1$

  public static final OMBundle BUNDLE = OMPlatform.INSTANCE.bundle(BUNDLE_ID, OM.class);

  public static final OMTracer DEBUG = BUNDLE.tracer("debug"); // $NON-NLS-1$

  public static final OMLogger LOG = BUNDLE.logger();

  /** @author Victor Roldan Betancort */
  public static final class Activator extends OSGiActivator {
    public Activator() {
      super(BUNDLE);
    }
  }
}
 @Override
 public void disableConsole() {
   OMPlatform.INSTANCE.setDebugging(false);
   OMPlatform.INSTANCE.removeTraceHandler(PrintTraceHandler.CONSOLE);
   // OMPlatform.INSTANCE.removeLogHandler(PrintLogHandler.CONSOLE);
 }
 @Override
 protected void doSetUp() throws Exception {
   OMPlatform.INSTANCE.setDebugging(false);
   super.doSetUp();
   populateRepository();
 }