Package org.jvnet.hk2.config
Class WriteableView
java.lang.Object
org.jvnet.hk2.config.WriteableView
- All Implemented Interfaces:
InvocationHandler,ConfigView,Transactor
A WriteableView is a view of a ConfigBean object that allow access to the
setters of the ConfigBean.
- Author:
- Jerome Dochez
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidabort(Transaction t) Aborts this Transaction, reverting the state<T extends ConfigBeanProxy>
TallocateProxy(Class<T> type) Allocate a new ConfigBean object as part of the Transaction associated with this configuration object.booleanReturns true of this Transaction can be committed on this objectCommit this Transaction.getProperty(String xmlName) getPropertyValue(String propertyName) <T extends ConfigBeanProxy>
T<T extends ConfigBeanProxy>
Class<T> getter(ConfigModel.Property property, Type t) booleanjoin(Transaction t) Enter a new Transaction, this method should return false if this object is already enlisted in another transaction, or cannot be enlisted with the passed transaction.voidsetMasterView(ConfigView view) voidsetter(ConfigModel.Property property, Object newValue, Type t) static Stringremove @ or invalid input: '<'> eg "@foo" => "foo" or "" => "foo"
-
Constructor Details
-
WriteableView
-
-
Method Details
-
getTransaction
-
invoke
- Specified by:
invokein interfaceInvocationHandler- Throws:
Throwable
-
getPropertyValue
-
getter
-
setter
-
getProperty
-
join
Enter a new Transaction, this method should return false if this object is already enlisted in another transaction, or cannot be enlisted with the passed transaction. If the object returns true, the object is enlisted in the passed transaction and cannot be enlisted in another transaction until either commit or abort has been issued.- Specified by:
joinin interfaceTransactor- Parameters:
t- the transaction to enlist with- Returns:
- true if the enlisting with the passed transaction was accepted, false otherwise
-
canCommit
Returns true of this Transaction can be committed on this object- Specified by:
canCommitin interfaceTransactor- Parameters:
t- is the transaction to commit, should be the same as the one passed during the join(Transaction t) call.- Returns:
- true if the trsaction commiting would be successful
- Throws:
TransactionFailure- if the changes cannot be validated
-
stripMarkers
remove @ or invalid input: '<'> eg "@foo" => "foo" or "" => "foo" -
commit
Commit this Transaction.- Specified by:
commitin interfaceTransactor- Parameters:
t- the transaction commiting.- Returns:
- list of applied property changes
- Throws:
TransactionFailure- if the transaction commit failed
-
abort
Aborts this Transaction, reverting the state- Specified by:
abortin interfaceTransactor- Parameters:
t- the aborting transaction
-
allocateProxy
Allocate a new ConfigBean object as part of the Transaction associated with this configuration object. This will eventually be moved to a factory.- Parameters:
type- the request configuration object type- Returns:
- the propertly constructed configuration object
- Throws:
TransactionFailure- if the allocation failed
-
getMasterView
- Specified by:
getMasterViewin interfaceConfigView
-
setMasterView
- Specified by:
setMasterViewin interfaceConfigView
-
getProxyType
- Specified by:
getProxyTypein interfaceConfigView
-
getProxy
- Specified by:
getProxyin interfaceConfigView
-