Class FolderContextManager

java.lang.Object
org.eclipse.net4j.util.event.Notifier
org.eclipse.net4j.util.lifecycle.Lifecycle
org.eclipse.emf.cdo.server.db.evolution.phased.FolderContextManager
All Implemented Interfaces:
Context.Manager, org.eclipse.net4j.util.event.INotifier, org.eclipse.net4j.util.event.INotifier.INotifier2, org.eclipse.net4j.util.lifecycle.IDeactivateable, org.eclipse.net4j.util.lifecycle.ILifecycle, org.eclipse.net4j.util.lifecycle.ILifecycle.DeferrableActivation

public class FolderContextManager extends org.eclipse.net4j.util.lifecycle.Lifecycle implements Context.Manager
A context manager that saves and loads the evolution contexts to and from a folder on disk.

The folder is determined by PhasedModelEvolutionSupport.getEvolutionFolder().

Each model is saved as an individual .ecore file. The file name is derived from the model ID by encoding it to a safe file name using IOUtil.encodeFileName(String). Additionally, an evolution.properties file is created to map the model file names to their original types and timestamps.

If the saveNewModels property is set to true, the new models are also saved to disk during evolution. The new model files have the same name as the original model files, but with a _new suffix before the .ecore extension. These extra files can be useful for debugging and verification purposes.

Since:
4.14
Author:
Eike Stepper
No Implement
This package is currently considered provisional.
No Extend
This package is currently considered provisional.
No Reference
This package is currently considered provisional.
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.eclipse.net4j.util.event.Notifier

    org.eclipse.net4j.util.event.Notifier.Cancelation

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

    org.eclipse.net4j.util.lifecycle.ILifecycle.DeferrableActivation

    Nested classes/interfaces inherited from interface org.eclipse.net4j.util.event.INotifier

    org.eclipse.net4j.util.event.INotifier.INotifier2
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The factory type of the folder context manager implementation.

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

    USE_LABEL

    Fields inherited from interface org.eclipse.emf.cdo.server.db.evolution.phased.Context.Manager

    PRODUCT_GROUP
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new folder context manager.
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates a new context by loading the models from the database.
    Returns the model evolution support.
    boolean
    Returns whether to save the new models to disk during evolution.
    Loads the context from disk.
    protected List<Context.Model>
    Loads the models from the database.
    protected List<Context.Model>
    Loads the models from disk.
    void
    Saves the context to disk.
    protected void
    Saves the models to disk.
    void
    setSaveNewModels(boolean saveNewModels)
    Sets whether to save the new models to disk during evolution.
    void
    Sets the model evolution support.

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

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

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

    addListener, addUniqueListener, fireEvent, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListener, hasListeners, lastListenerRemoved, listenerAdded, listenerRemoved, 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