org.eclipse.emf.cdo.common.model

## Class CDOPackageRegistryPopulator

- java.lang.Object
- - org.eclipse.net4j.util.event.Notifier
  - - org.eclipse.net4j.util.lifecycle.Lifecycle
    - - org.eclipse.net4j.util.concurrent.Worker
      - - org.eclipse.emf.cdo.common.model.CDOPackageRegistryPopulator

- All Implemented Interfaces:
    INotifier, IDeactivateable, ILifecycle, ILifecycle.DeferrableActivation

      public class CDOPackageRegistryPopulator
      extends Worker

  Populates a `target` package registry by asynchronously polling a `source` package registry for new `EPackage` registrations.
  Since:
    2.0
  Author:
    Eike Stepper
  Apiviz
    `CDOPackageRegistryPopulator.Descriptor` - - creates, `CDOPackageRegistry` - - populates, `EPackage.Registry` - - polls

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `CDOPackageRegistryPopulator.Descriptor` A package `descriptor` that resolves `packages` from a `source` package registry.

    - ### Nested classes/interfaces inherited from class org.eclipse.net4j.util.concurrent.Worker

      `Worker.WorkContext`

    - ### Nested classes/interfaces inherited from interface org.eclipse.net4j.util.lifecycle.ILifecycle

      `ILifecycle.DeferrableActivation`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `DEFAULT_SOURCE_POLL_INTERVAL`

    - ### Fields inherited from class org.eclipse.net4j.util.concurrent.Worker

      `DEFAULT_ERROR_HANDLER, DEFAULT_TIMEOUT`

    - ### Fields inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle

      `USE_LABEL`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CDOPackageRegistryPopulator(CDOPackageRegistry target)`
    `CDOPackageRegistryPopulator(EPackage.Registry source, CDOPackageRegistry target)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `doActivate()`
    `protected void` | `doWork()`
    `EPackage.Registry` | `getSource()`
    `long` | `getSourcePollInterval()`
    `CDOPackageRegistry` | `getTarget()`
    `protected String` | `getThreadName()`
    `static boolean` | `populate(CDOPackageRegistry target)`
    `static boolean` | `populate(EPackage.Registry source, CDOPackageRegistry target)`
    `void` | `setSourcePollInterval(long sourcePollInterval)`
    `protected void` | `work(Worker.WorkContext context)`

    - ### Methods inherited from class org.eclipse.net4j.util.concurrent.Worker

      `doDeactivate, getActivationTimeout, getDeactivationTimeout, getGlobalErrorHandler, getWorkerThread, handleError, isDaemon, setActivationTimeout, setDaemon, setDeactivationTimeout, setGlobalErrorHandler`

    - ### Methods inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle

      `activate, checkActive, checkArg, checkArg, checkInactive, checkNull, checkState, checkState, deactivate, deferredActivate, doAfterActivate, doBeforeActivate, doBeforeDeactivate, dump, getLifecycleState, isActive, isDeferredActivation, toString`

    - ### Methods inherited from class org.eclipse.net4j.util.event.Notifier

      `addListener, fireEvent, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListeners, lastListenerRemoved, removeListener`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.eclipse.net4j.util.event.INotifier

      `addListener, getListeners, hasListeners, removeListener`

- - ### Field Detail

    - #### DEFAULT_SOURCE_POLL_INTERVAL

          public static final int DEFAULT_SOURCE_POLL_INTERVAL

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### CDOPackageRegistryPopulator

          public CDOPackageRegistryPopulator(CDOPackageRegistry target)

    - #### CDOPackageRegistryPopulator

          public CDOPackageRegistryPopulator(EPackage.Registry source,
                                             CDOPackageRegistry target)

  - ### Method Detail

    - #### getSource

          public EPackage.Registry getSource()

    - #### getTarget

          public CDOPackageRegistry getTarget()

    - #### getSourcePollInterval

          public long getSourcePollInterval()

    - #### setSourcePollInterval

          public void setSourcePollInterval(long sourcePollInterval)

    - #### work

          protected void work(Worker.WorkContext context)
                       throws Exception

      Specified by:
        `work` in class `Worker`
      Throws:
        `Exception`

    - #### doWork

          protected void doWork()

    - #### doActivate

          protected void doActivate()
                             throws Exception

      Overrides:
        `doActivate` in class `Worker`
      Throws:
        `Exception`

    - #### getThreadName

          protected String getThreadName()

      Overrides:
        `getThreadName` in class `Worker`

    - #### populate

          public static boolean populate(CDOPackageRegistry target)

    - #### populate

          public static boolean populate(EPackage.Registry source,
                                         CDOPackageRegistry target)

Copyright (c) 2014 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