public class DsContextImpl extends java.lang.Object implements DsContextImplementation
DsContextImplementation.LazyTask
DsContext.AfterCommitListener, DsContext.BeforeCommitListener, DsContext.CommitListener, DsContext.CommitListenerAdapter
Constructor and Description |
---|
DsContextImpl(DataSupplier dataservice) |
Modifier and Type | Method and Description |
---|---|
void |
addAfterCommitListener(DsContext.AfterCommitListener listener) |
void |
addBeforeCommitListener(DsContext.BeforeCommitListener listener) |
void |
addLazyTask(DsContextImplementation.LazyTask lazyTask) |
void |
addListener(DsContext.CommitListener listener)
Add commit events listener.
|
boolean |
commit()
Commit all changed datasources.
|
void |
executeLazyTasks() |
void |
fireAfterCommit(CommitContext context,
java.util.Set<Entity> committedEntities) |
void |
fireBeforeCommit(CommitContext context) |
Datasource |
get(java.lang.String id)
Get datasource by name.
|
java.util.Collection<Datasource> |
getAll() |
java.util.List<DsContext> |
getChildren() |
DataSupplier |
getDataSupplier() |
FrameContext |
getFrameContext() |
Datasource |
getNN(java.lang.String name)
Get datasource by name.
|
DsContext |
getParent() |
boolean |
isDiscardCommitted()
Indicates that the DsContext will be discarded right after commit hence it doesn't need committed instances.
|
boolean |
isModified() |
void |
refresh()
Refresh all datasources.
|
void |
register(Datasource datasource) |
void |
registerDependency(Datasource datasource,
Datasource dependFrom,
java.lang.String propertyName)
Register dependency between datasources.
|
void |
registerListener(ParameterInfo item,
Datasource datasource) |
void |
removeAfterCommitListener(DsContext.AfterCommitListener listener) |
void |
removeBeforeCommitListener(DsContext.BeforeCommitListener listener) |
void |
removeListener(DsContext.CommitListener listener)
Remove commit events listener.
|
void |
resumeSuspended() |
void |
setDiscardCommitted(boolean discardCommitted)
Set to true if the DsContext will be discarded right after commit hence it doesn't need committed instances.
|
void |
setFrameContext(FrameContext windowContext) |
void |
setParent(DsContext parent) |
void |
unregister(Datasource datasource) |
public DsContextImpl(DataSupplier dataservice)
public void addLazyTask(DsContextImplementation.LazyTask lazyTask)
addLazyTask
in interface DsContextImplementation
public void executeLazyTasks()
executeLazyTasks
in interface DsContextImplementation
public void resumeSuspended()
resumeSuspended
in interface DsContextImplementation
public FrameContext getFrameContext()
getFrameContext
in interface DsContext
Window
, its WindowContext
is returned.public void setFrameContext(FrameContext windowContext)
setFrameContext
in interface DsContext
public boolean commit()
DsContext
public boolean isDiscardCommitted()
DsContext
isDiscardCommitted
in interface DsContext
public void setDiscardCommitted(boolean discardCommitted)
DsContext
setDiscardCommitted
in interface DsContext
public void fireBeforeCommit(CommitContext context)
fireBeforeCommit
in interface DsContextImplementation
public void fireAfterCommit(CommitContext context, java.util.Set<Entity> committedEntities)
fireAfterCommit
in interface DsContextImplementation
public void registerDependency(Datasource datasource, Datasource dependFrom, java.lang.String propertyName)
DsContext
registerDependency
in interface DsContext
datasource
- dependent datasourcedependFrom
- master datasourcepropertyName
- property of master datasource. If specified, the dependent datasource will be refreshed
also on this property value changepublic void addListener(DsContext.CommitListener listener)
DsContext
addListener
in interface DsContext
public void removeListener(DsContext.CommitListener listener)
DsContext
removeListener
in interface DsContext
public void addBeforeCommitListener(DsContext.BeforeCommitListener listener)
addBeforeCommitListener
in interface DsContext
public void removeBeforeCommitListener(DsContext.BeforeCommitListener listener)
removeBeforeCommitListener
in interface DsContext
public void addAfterCommitListener(DsContext.AfterCommitListener listener)
addAfterCommitListener
in interface DsContext
public void removeAfterCommitListener(DsContext.AfterCommitListener listener)
removeAfterCommitListener
in interface DsContext
public DataSupplier getDataSupplier()
getDataSupplier
in interface DsContext
public Datasource get(java.lang.String id)
DsContext
someFrameId.someDatasourceId
public Datasource getNN(java.lang.String name)
DsContext
someFrameId.someDatasourceId
.
Never returns null.
public java.util.Collection<Datasource> getAll()
public boolean isModified()
isModified
in interface DsContext
public void refresh()
DsContext
public void register(Datasource datasource)
register
in interface DsContextImplementation
public void unregister(Datasource datasource)
unregister
in interface DsContextImplementation
public void registerListener(ParameterInfo item, Datasource datasource)
registerListener
in interface DsContextImplementation
public DsContext getParent()
public void setParent(DsContext parent)
setParent
in interface DsContextImplementation
public java.util.List<DsContext> getChildren()
getChildren
in interface DsContext