Package com._1c.g5.v8.derived.operations
Class WrappingOperation
- java.lang.Object
-
- com._1c.g5.v8.derived.operations.WrappingOperation
-
- All Implemented Interfaces:
Consumer<org.eclipse.core.runtime.IProgressMonitor>
public class WrappingOperation extends Object implements Consumer<org.eclipse.core.runtime.IProgressMonitor>
Special operation which allow to create inline operation boundaries in the code directly. The operation finish is controlled via the code itself.
-
-
Constructor Summary
Constructors Constructor Description WrappingOperation(Consumer<Object> operation, OperationType type, String name, boolean implicitDerivedDataWait, IDerivedDataManager derivedDataManager)
Constructs an operationWrappingOperation(Consumer<Object> operation, OperationType type, String name, IDerivedDataManager derivedDataManager)
Constructs an operation
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(org.eclipse.core.runtime.IProgressMonitor progressMonitor)
Runnable
finish()
Finishes the operation.Object
getHandle()
Gets the handle of the associated operationOperationType
getType()
Gets the type of the operationboolean
isFinished()
Checks if the operation is finihed alreadyboolean
isStarted()
Checks if the operation is already started by the enginevoid
setAsyncEventScheduler(Runnable asyncEventScheduler)
Sets the scheduler process of the async.void
setHandle(Object handle)
Sets the operation handle This method is called by the DD engine and shouldn't be called in the client codevoid
setImplicitWaitingContext(Collection<IObjectDerivedDataContext> waitingScope)
Sets the context of data being changed within this operation to wait in on the exit from the operation.String
toString()
-
-
-
Constructor Detail
-
WrappingOperation
public WrappingOperation(Consumer<Object> operation, OperationType type, String name, boolean implicitDerivedDataWait, IDerivedDataManager derivedDataManager)
Constructs an operation- Parameters:
operation
- The operation executable. It's called after the operation's start is confirmed by the system. May not benull
type
- the type of the operation. May not benull
name
- The name of the operation. May not benull
implicitDerivedDataWait
- Perform an implicit wait of thederivedDataManager
- The reference to the correspondingIDerivedDataManager
. May not benull
-
WrappingOperation
public WrappingOperation(Consumer<Object> operation, OperationType type, String name, IDerivedDataManager derivedDataManager)
Constructs an operation- Parameters:
operation
- The operation executable. It's called after the operation's start is confirmed by the system. May not benull
type
- The type of the operation. May not benull
name
- The name of the operation. May not benull
derivedDataManager
- The reference to the correspondingIDerivedDataManager
. May not benull
-
-
Method Detail
-
accept
public void accept(org.eclipse.core.runtime.IProgressMonitor progressMonitor)
-
finish
public Runnable finish()
Finishes the operation. If necessary - waits for an async. data that are related to BM task being executed inside the operation- Returns:
- Post-finish actions, may not be
null
-
getHandle
public Object getHandle()
Gets the handle of the associated operation- Returns:
- The handle of the operation. May be
null
if the operation isn't scheduled yet
-
getType
public OperationType getType()
Gets the type of the operation- Returns:
- The type of the operation. May not be
null
-
isFinished
public boolean isFinished()
Checks if the operation is finihed already- Returns:
- True if the operation is finished
-
isStarted
public boolean isStarted()
Checks if the operation is already started by the engine- Returns:
- True if the operation is started
-
setAsyncEventScheduler
public void setAsyncEventScheduler(Runnable asyncEventScheduler)
Sets the scheduler process of the async. event sending to the wrapping operation This method is called by the DD engine and shouldn't be called in the client code- Parameters:
asyncEventScheduler
- The async event sending sheduler. May not benull
-
setHandle
public void setHandle(Object handle)
Sets the operation handle This method is called by the DD engine and shouldn't be called in the client code- Parameters:
handle
- The handle to set. May not benull
-
setImplicitWaitingContext
public void setImplicitWaitingContext(Collection<IObjectDerivedDataContext> waitingScope)
Sets the context of data being changed within this operation to wait in on the exit from the operation. This method is called by the DD engine and shouldn't be called in the client code- Parameters:
waitingScope
- The scope to wait. May not benull
-
-