Package com._1c.g5.v8.dt.core.platform
Interface IBmModelManager
-
- All Superinterfaces:
IManagedService
public interface IBmModelManager extends IManagedService
The BM model manager allows clients to create or get instances of BM model from the given objects: projects, model objects, model objectURI
s.The manager configures BM model instances after creation with BM model providers, link providers, indexes, etc.
Clients are intended to
activate
manager before work anddeactivate
manager after all work is done and manager is no longer needed.- Restriction:
- This interface is not intended to be extended by clients.
- Restriction:
- This interface is not intended to be implemented by clients.
-
-
Field Summary
Fields Modifier and Type Field Description static Object
SAVE_JOB_FAMILY
Save job family.static String
SERVICE_NAME
Service name (using in recovery orchestrator)
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
activate()
Start up BM manager work.void
addAsyncEventListener(IBmNamespace namespace, IBmAsyncEventListener listener, BmEventFilter... filters)
Adds the specified asynchronous event listener.void
addLifecycleListener(IBmModel model, IBmLifecycleListener listener)
Deprecated.Use DT lifecycle listeners and lifecycle aware services instead.void
addSyncEventListener(IBmNamespace namespace, IBmSyncEventListener listener)
Adds the specified synchronous event listener.Object
beginBatchSession(Object handle)
Begins batch mode.IBmPlatformLocalEditingContext
createLocalEditingContext(String name)
Creates a local platform context.void
deactivate()
Shut down BM manager work.void
endBatchSession(Object handle)
Ends the batch session associated with the specified handle.<T> Future<T>
executeAsynchronously(IDtProject project, IBmSingleNamespaceTask<T> task)
Executes the given task in a separate thread (comparing to the calling thread).<T> Future<T>
executeAsynchronously(org.eclipse.core.resources.IProject project, IBmSingleNamespaceTask<T> task)
Executes the given task in a separate thread (comparing to the calling thread).<T> T
executeInBatchSession(Object handle, IBmPlatformTask<T> task)
Executes task in a batch session.<T> T
executeReadOnlyTask(IBmNamespace namespace, IBmSingleNamespaceTask<T> task)
Executes aIBmSingleNamespaceTask
which is bound to a single namespace in a read-only mode<T> T
executeReadOnlyTask(IBmPlatformTask<T> task)
Executes aIBmPlatformTask
in a read-only mode<T> T
executeReadOnlyTask(IDtProject dtProject, IBmSingleNamespaceTask<T> task)
Executes aIBmSingleNamespaceTask
which is bound to a single namespace in a read-only mode<T> T
executeReadOnlyTask(org.eclipse.core.resources.IProject project, IBmSingleNamespaceTask<T> task)
Executes aIBmSingleNamespaceTask
which is bound to a single namespace in a read-only mode<T> T
executeReadWriteTask(IBmNamespace namespace, IBmSingleNamespaceTask<T> task)
Executes aIBmSingleNamespaceTask
which is bound to a single namespace<T> T
executeReadWriteTask(IBmNamespace namespace, IBmSingleNamespaceTask<T> task, boolean disableEvents)
Executes aIBmSingleNamespaceTask
which is bound to a single namespace<T> T
executeReadWriteTask(IDtProject dtProject, IBmSingleNamespaceTask<T> task)
Executes aIBmSingleNamespaceTask
which is bound to a single namespace<T> T
executeReadWriteTask(Object taskId, Object serviceId, boolean disableEvents, IBmPlatformTask<T> task)
Executes a read-write task.<T> T
executeReadWriteTask(Object taskId, Object serviceId, IBmPlatformTask<T> task)
Executes a read-write task.<T> T
executeReadWriteTask(org.eclipse.core.resources.IProject project, IBmSingleNamespaceTask<T> task)
Executes aIBmSingleNamespaceTask
which is bound to a single namespaceboolean
forceExport(IDtProject project, String fqn)
Forces export of the object with the specified FQN.IBmNamespace
getBmNamespace(IDtProject project)
Gets the namespace storing the data of the specified project.IBmNamespace
getBmNamespace(org.eclipse.core.resources.IProject project)
Gets the namespace storing the data of the specified project.BmPlatform
getBmPlatform()
Gets the underlying BM platform.IDtProject
getDtProject(IBmModel bmModel)
ReturnsIDtProject
project associated with given BM instance.IDtProject
getDtProject(String engineId)
Returnsproject
associated with given BM engine.IBmPlatformGlobalEditingContext
getGlobalEditingContext()
Gets platform global editing context instanceIBmModel
getModel(IDtProject dtProject)
ReturnsIBmModel
instance by given project.IBmModel
getModel(org.eclipse.core.resources.IProject project)
ReturnsIBmModel
instance by given project.IBmModel
getModel(org.eclipse.emf.common.util.URI uri)
ReturnsIBmModel
which contains object with givenURI
.IBmModel
getModel(org.eclipse.emf.ecore.EObject object)
ReturnsIBmModel
which contains the given model object.Collection<org.eclipse.emf.ecore.EPackage>
getModelPackages()
Gets the collection of EMF packages supported by the model.org.eclipse.core.resources.IProject
getProject(IBmModel bmModel)
Returnsproject
associated with given BM instance.boolean
isLocked(org.eclipse.core.resources.IProject project)
Checks if the given project's BM model is locked at the moment.void
lockModel(org.eclipse.core.resources.IProject project)
Raises the lock on the given model.void
removeAsyncEventListener(IBmNamespace namespace, IBmAsyncEventListener listener)
Removes the specified asynchronous event listener.void
removeLifecycleListener(IBmModel model, IBmLifecycleListener listener)
Deprecated.Use DT lifecycle listeners and lifecycle aware services instead.void
removeSyncEventListener(IBmNamespace namespace, IBmSyncEventListener listener)
Removes the specified synchronous event listener.<T extends org.eclipse.emf.ecore.EObject>
Tresolve(T proxyOrObject, org.eclipse.emf.ecore.resource.Resource context, org.eclipse.emf.ecore.EObject objContext)
Deprecated.this method can be deleted soonvoid
unlockModel(org.eclipse.core.resources.IProject project)
Releases previously defined lock for the given project's modelvoid
waitAllEnqueuedEventsSent()
Waits till all the events enqueued prior to calling this method are sent.void
waitModelSynchronization(org.eclipse.core.resources.IProject project)
Waits for project BM synchronization jobs.
-
-
-
Field Detail
-
SERVICE_NAME
static final String SERVICE_NAME
Service name (using in recovery orchestrator)- See Also:
- Constant Field Values
-
SAVE_JOB_FAMILY
static final Object SAVE_JOB_FAMILY
Save job family.
-
-
Method Detail
-
activate
void activate()
Start up BM manager work. The manager configures itself and all associated infrastructure.Clients are intended to invoke
#shutdown()
when manager work is no longer needed.- Specified by:
activate
in interfaceIManagedService
-
deactivate
void deactivate()
Shut down BM manager work. The manager shutdowns itself and all associated infrastructure.- Specified by:
deactivate
in interfaceIManagedService
-
getBmPlatform
BmPlatform getBmPlatform()
Gets the underlying BM platform.- Returns:
- the underlying BM platform or
null
in case the model manager is not initialized yet.
-
getBmNamespace
IBmNamespace getBmNamespace(org.eclipse.core.resources.IProject project)
Gets the namespace storing the data of the specified project.- Parameters:
project
- The project. May not benull
.- Returns:
- the namespace or
null
if the project context is not started yet.
-
getBmNamespace
IBmNamespace getBmNamespace(IDtProject project)
Gets the namespace storing the data of the specified project.- Parameters:
project
- The project. May not benull
.- Returns:
- the namespace or
null
if the project context is not started yet.
-
getModel
IBmModel getModel(org.eclipse.core.resources.IProject project)
ReturnsIBmModel
instance by given project.
Can returnnull
if there is no BM instance, associated with the given project.- Parameters:
project
- the project (notnull
)- Returns:
IBmModel
instance ornull
if given project doesn't associated with any BM model and cannot create one
-
getModel
IBmModel getModel(IDtProject dtProject)
ReturnsIBmModel
instance by given project.
Can returnnull
if there is no BM instance, associated with the given project.- Parameters:
project
- the project (notnull
)- Returns:
IBmModel
instance ornull
if given project doesn't associated with any BM model and cannot create one
-
getModel
IBmModel getModel(org.eclipse.emf.common.util.URI uri)
ReturnsIBmModel
which contains object with givenURI
.
Can returnnull
if there is no BM instances, that handles the object with the givenURI
.
-
getModel
IBmModel getModel(org.eclipse.emf.ecore.EObject object)
ReturnsIBmModel
which contains the given model object.
Can returnnull
if there is no BM instances, that handles the given model object.
-
getProject
org.eclipse.core.resources.IProject getProject(IBmModel bmModel)
Returnsproject
associated with given BM instance.
Can returnnull
if there is no projects, associated with the given BM instance.- Parameters:
bmModel
- theIBmModel
instance (notnull
)- Returns:
project
associated with given big model instance
-
getDtProject
IDtProject getDtProject(String engineId)
Returnsproject
associated with given BM engine.
Can returnnull
if there is no projects, associated with the given BM engine.- Parameters:
engineId
- the identifier of the BM engine, (notnull
)- Returns:
project
associated with given engine
-
getDtProject
IDtProject getDtProject(IBmModel bmModel)
ReturnsIDtProject
project associated with given BM instance.
Can returnnull
if there is no projects, associated with the given BM instance.- Parameters:
bmModel
- theIBmModel
instance (notnull
)- Returns:
IDtProject
project associated with given big model instance
-
resolve
@Deprecated <T extends org.eclipse.emf.ecore.EObject> T resolve(T proxyOrObject, org.eclipse.emf.ecore.resource.Resource context, org.eclipse.emf.ecore.EObject objContext)
Deprecated.this method can be deleted soonResolves given proxy using the provide resource context for the resolving/starting point.
Aware of BM infrastructure and standalone resources.- Parameters:
proxyOrObject
- proxy to resolve.context
- the context resource.objContext
- the object context.- Returns:
- The resolved object (if referenced object already exists and reachable) or proxy of the source type.
-
waitModelSynchronization
void waitModelSynchronization(org.eclipse.core.resources.IProject project)
Waits for project BM synchronization jobs.
-
isLocked
boolean isLocked(org.eclipse.core.resources.IProject project)
Checks if the given project's BM model is locked at the moment.- Parameters:
project
- The project to check the locked state for. Cannot benull
- Returns:
- True if the corresponding BM is locked at the moment; false otherwise
-
unlockModel
void unlockModel(org.eclipse.core.resources.IProject project)
Releases previously defined lock for the given project's model- Parameters:
project
- The project to unlock the BM model for. Cannot benull
-
lockModel
void lockModel(org.eclipse.core.resources.IProject project)
Raises the lock on the given model. The lock indicates that all data critical clients should cease their requests and wait until the lock is released.- Parameters:
project
- The target project which BM should be locked. Cannot benull
-
addLifecycleListener
@Deprecated void addLifecycleListener(IBmModel model, IBmLifecycleListener listener)
Deprecated.Use DT lifecycle listeners and lifecycle aware services instead.Registers the given lifecycle listener.- Parameters:
listener
- The lifecycle listener. May not benull
.
-
removeLifecycleListener
@Deprecated void removeLifecycleListener(IBmModel model, IBmLifecycleListener listener)
Deprecated.Use DT lifecycle listeners and lifecycle aware services instead.Unregisters the given lifecycle listener.- Parameters:
listener
- The lifecycle listener. May not benull
.
-
getModelPackages
Collection<org.eclipse.emf.ecore.EPackage> getModelPackages()
Gets the collection of EMF packages supported by the model.- Returns:
- the collection of EMF packages supported by the model, never
null
.
-
executeReadOnlyTask
<T> T executeReadOnlyTask(IBmPlatformTask<T> task)
Executes aIBmPlatformTask
in a read-only mode- Type Parameters:
T
- The type of the task's return valu- Parameters:
task
- The task to run. May not benull
- Returns:
- The result of the task execution. May not be
null
-
executeReadOnlyTask
<T> T executeReadOnlyTask(IDtProject dtProject, IBmSingleNamespaceTask<T> task)
Executes aIBmSingleNamespaceTask
which is bound to a single namespace in a read-only mode- Type Parameters:
T
- The type of the task's return value- Parameters:
dtProject
- The targetIDtProject
. May not benull
task
- The task to run. May not benull
- Returns:
- The result of the task execution. May not be
null
-
executeReadOnlyTask
<T> T executeReadOnlyTask(org.eclipse.core.resources.IProject project, IBmSingleNamespaceTask<T> task)
Executes aIBmSingleNamespaceTask
which is bound to a single namespace in a read-only mode- Type Parameters:
T
- The type of the task's return value- Parameters:
project
- The targetIProject
. May not benull
task
- The task to run. May not benull
- Returns:
- The result of the task execution. May not be
null
-
executeReadOnlyTask
<T> T executeReadOnlyTask(IBmNamespace namespace, IBmSingleNamespaceTask<T> task)
Executes aIBmSingleNamespaceTask
which is bound to a single namespace in a read-only mode- Type Parameters:
T
- The type of the task's return value- Parameters:
namespace
- The targetIBmNamespace
. May not benull
task
- The task to run. May not benull
- Returns:
- The result of the task execution. May not be
null
-
executeReadWriteTask
<T> T executeReadWriteTask(Object taskId, Object serviceId, IBmPlatformTask<T> task)
Executes a read-write task.- Type Parameters:
T
- The type of the task's return value.- Parameters:
taskId
- The ID of the task. May benull
.serviceId
- The ID of the service that requested the task execution. May benull
.task
- The task to execute. May not benull
.- Returns:
- the result returned by
IBmPlatformTask.execute(IBmPlatformTransaction)
method.
-
executeReadWriteTask
<T> T executeReadWriteTask(Object taskId, Object serviceId, boolean disableEvents, IBmPlatformTask<T> task)
Executes a read-write task.- Type Parameters:
T
- The type of the task's return value.- Parameters:
taskId
- The ID of the task. May benull
.serviceId
- The ID of the service that requested the task execution. May benull
.disableEvents
- The flag that disables sending of BM data change eventstask
- The task to execute. May not benull
.- Returns:
- the result returned by
IBmPlatformTask.execute(IBmPlatformTransaction)
method.
-
executeReadWriteTask
<T> T executeReadWriteTask(IDtProject dtProject, IBmSingleNamespaceTask<T> task)
Executes aIBmSingleNamespaceTask
which is bound to a single namespace- Type Parameters:
T
- The type of the task's return value- Parameters:
dtProject
- The targetIDtProject
. May not benull
task
- The task to run. May not benull
- Returns:
- The result of the task execution. May not be
null
-
executeReadWriteTask
<T> T executeReadWriteTask(org.eclipse.core.resources.IProject project, IBmSingleNamespaceTask<T> task)
Executes aIBmSingleNamespaceTask
which is bound to a single namespace- Type Parameters:
T
- The type of the task's return value- Parameters:
task
- The task to run. May not benull
dtProject
- The targetIProject
. May not benull
- Returns:
- The result of the task execution. May not be
null
-
executeReadWriteTask
<T> T executeReadWriteTask(IBmNamespace namespace, IBmSingleNamespaceTask<T> task)
Executes aIBmSingleNamespaceTask
which is bound to a single namespace- Type Parameters:
T
- The type of the task's return value- Parameters:
namespace
- The targetIBmNamespace
. May not benull
task
- The task to run. May not benull
- Returns:
- The result of the task execution. May not be
null
-
executeReadWriteTask
<T> T executeReadWriteTask(IBmNamespace namespace, IBmSingleNamespaceTask<T> task, boolean disableEvents)
Executes aIBmSingleNamespaceTask
which is bound to a single namespace- Type Parameters:
T
- The type of the task's return value- Parameters:
namespace
- The targetIBmNamespace
. May not benull
task
- The task to run. May not benull
- Returns:
- The result of the task execution. May not be
null
-
createLocalEditingContext
IBmPlatformLocalEditingContext createLocalEditingContext(String name)
Creates a local platform context.- Parameters:
name
- The name of the context. May not benull
.- Returns:
- a newly created local context instance, never
null
.
-
getGlobalEditingContext
IBmPlatformGlobalEditingContext getGlobalEditingContext()
Gets platform global editing context instance- Returns:
- The global editing context of the platform. May not be
null
-
beginBatchSession
Object beginBatchSession(Object handle)
Begins batch mode.- Parameters:
The
- externally provided handle object. Can benull
. In case if the descendant of theIBatchSessionController
is supplied as a handle - enables managed batch mode.- Returns:
- the batch mode handle object, never
null
.
-
endBatchSession
void endBatchSession(Object handle)
Ends the batch session associated with the specified handle.- Parameters:
handle
- The batch session handle. May not benull
.- See Also:
#beginBatchMode()
-
executeInBatchSession
<T> T executeInBatchSession(Object handle, IBmPlatformTask<T> task)
Executes task in a batch session.- Type Parameters:
T
- The type of the task's return value.- Parameters:
handle
- The batch session handle. May not benull
.task
- The task to execute. May not benull
.- Returns:
- the result returned by
IBmPlatformTask.execute(IBmPlatformTransaction)
method.
-
executeAsynchronously
<T> Future<T> executeAsynchronously(org.eclipse.core.resources.IProject project, IBmSingleNamespaceTask<T> task)
Executes the given task in a separate thread (comparing to the calling thread). This method could be used to ensure the data modification will be performed independently of a BM transaction that may be started in the calling thread already. Please note that this operation is not a performance-effective one, so it should be used only in case if some process flow conflicts with other threadsIBmTransaction
locks and cannot be redesigned at the moment to a normal orchestrated form- Parameters:
project
- A target project. May not benull
task
- A task to run. May not benull
- Returns:
- A future that provides access to a result of an operation. Never
null
-
executeAsynchronously
<T> Future<T> executeAsynchronously(IDtProject project, IBmSingleNamespaceTask<T> task)
Executes the given task in a separate thread (comparing to the calling thread). This method could be used to ensure the data modification will be performed independently of a BM transaction that may be started in the calling thread already. Please note that this operation is not a performance-effective one, so it should be used only in case if some process flow conflicts with other threadsIBmTransaction
locks and cannot be redesigned at the moment to a normal orchestrated form- Parameters:
project
- A target DT project. May not benull
task
- A task to run. May not benull
- Returns:
- A future that provides access to a result of an operation. Never
null
-
addSyncEventListener
void addSyncEventListener(IBmNamespace namespace, IBmSyncEventListener listener)
Adds the specified synchronous event listener.- Parameters:
namespace
- The namespace to add the listener to. May not benull
.listener
- The listener to add. May not benull
.
-
removeSyncEventListener
void removeSyncEventListener(IBmNamespace namespace, IBmSyncEventListener listener)
Removes the specified synchronous event listener.- Parameters:
namespace
- The namespace to remove the listener from. May not benull
.listener
- The listener to remove. May not benull
.
-
addAsyncEventListener
void addAsyncEventListener(IBmNamespace namespace, IBmAsyncEventListener listener, BmEventFilter... filters)
Adds the specified asynchronous event listener. The listener is notified in case the event matches at least one of the specified filters or no filter is specified.- Parameters:
namespace
- The namespace to add the listener to. May not benull
.listener
- The listener to add. May not benull
.filters
- The filters. May benull
.
-
removeAsyncEventListener
void removeAsyncEventListener(IBmNamespace namespace, IBmAsyncEventListener listener)
Removes the specified asynchronous event listener.- Parameters:
namespace
- The namespace to remove the listener from. May not benull
.listener
- The listener to remove. May not benull
.
-
waitAllEnqueuedEventsSent
void waitAllEnqueuedEventsSent()
Waits till all the events enqueued prior to calling this method are sent.
-
forceExport
boolean forceExport(IDtProject project, String fqn)
Forces export of the object with the specified FQN. This method is supposed to be called within an exclusive workspace operation.- Parameters:
project
- The project the object belongs to. May not benull
.fqn
- The FQN of the object. May not benull
.- Returns:
true
in case export was performed,false
if there was nothing to export, i.e. there was nothing to export.
-
-