|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jvnet.hk2.config.provider.internal.ConfigTransactionImpl
@Service public class ConfigTransactionImpl
Implementation for ConfigTransaction.
Method Summary | ||
---|---|---|
void |
commit()
Locks changes, calls prepare (if not yet performed), followed by commit if no prepare errors. |
|
void |
commit(Map<Object,Object> beanReplacements)
Same basic behavior as ConfigTransaction.commit() with the added ability to substitute configuration
beans used in the prepare phase with the final bean object replacements that should be managed. |
|
void |
created(Object createdConfigBean,
String name,
MultiMap<String,String> metadata)
Add configuration beans to the transaction. |
|
void |
deleted(Collection<?> deletedConfigBeans)
|
|
void |
deleted(Object deleted)
Marks configuration beans as having been deleted. |
|
|
getValue(Object component,
Inhabitant<?> onBehalfOf,
AnnotatedElement annotated,
Type genericType,
Class<V> type)
override of InjectionResolverQuery to provide view of changes
scoped to this txn context. |
|
void |
prepare()
Locks changes, calls prepare. |
|
void |
rollback()
Cancels the transaction, locking it out from further changes. |
|
void |
updated(Collection<?> updatedConfigBeans)
|
|
void |
updated(Object updated,
PropertyChangeEvent event)
Mark configuration beans as having been updated (note that name and metadata cannot change here). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void prepare() throws ConfigTransactionException
ConfigTransaction
prepare
in interface ConfigTransaction
ConfigTransactionException
public void commit() throws ConfigTransactionException
ConfigTransaction
commit
in interface ConfigTransaction
ConfigTransactionException
public void commit(Map<Object,Object> beanReplacements) throws ConfigTransactionException
ConfigTransaction
ConfigTransaction.commit()
with the added ability to substitute configuration
beans used in the prepare phase with the final bean object replacements that should be managed.
This is an important variant when the configuration beans in the prepare phase are transient
in nature.
commit
in interface ConfigTransaction
beanReplacements
- mapping from the bean instance used in prepare, with the final version that should be managed
ConfigTransactionException
public void rollback()
ConfigTransaction
rollback
in interface ConfigTransaction
public void created(Object createdConfigBean, String name, MultiMap<String,String> metadata)
ConfigTransaction
created
in interface ConfigTransaction
createdConfigBean
- - the configuration bean instance being createdname
- - optionally the name for the configurationmetadata
- - name,value(s)public void deleted(Collection<?> deletedConfigBeans)
deleted
in interface ConfigTransaction
public void deleted(Object deleted)
ConfigTransaction
deleted
in interface ConfigTransaction
public void updated(Collection<?> updatedConfigBeans)
updated
in interface ConfigTransaction
public void updated(Object updated, PropertyChangeEvent event)
ConfigTransaction
updated
in interface ConfigTransaction
public <V> V getValue(Object component, Inhabitant<?> onBehalfOf, AnnotatedElement annotated, Type genericType, Class<V> type) throws ComponentException
InjectionResolverQuery
to provide view of changes
scoped to this txn context.
getValue
in interface InjectionResolverQuery
component
- injection target instanceonBehalfOf
- inhabitant doing the injection forannotated
- is the annotated java element Method
or Field
genericType
- the generic type of the expected returntype
- type of the expected return
ComponentException
- if the resource cannot be located.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |