@Documented
@Retention(value=RUNTIME)
@Target(value=METHOD)
public @interface StoreParams
This annotation will wrap the decorated method to ensure thread isolation.
You can store method parameters.
A method such as this:
@Store(parameters = "customers") protected Customer addCustomer(Map<String, Customer> customers, CustomerSave customerSave) { String id = UUID.randomUUID().toString(); Customer customer = new Customer(id, customerSave.getFirstName(), customerSave.getLastName()); customers.put(id, customer); return customer; }
Becomes
protected Customer addCustomer(Map<String, Customer> customers, CustomerSave customerSave) { return XThreads.executeSynchronized(() -> { String id = UUID.randomUUID().toString(); Customer customer = new Customer(id, customerSave.getFirstName(), customerSave.getLastName()); customers.put(id, customer); embeddedStorageManager.store(customers); return customer; }); }
Modifier and Type | Required Element and Description |
---|---|
java.lang.String[] |
value
parameters which should be stored in the associated Store Manager.
|
Modifier and Type | Optional Element and Description |
---|---|
java.lang.String |
name
The optional name qualifier of the Store Manager to use.
|
StoringStrategy |
strategy
The Storing strategy.
|
public abstract java.lang.String[] value
@AliasFor(member="value") public abstract java.lang.String name
public abstract StoringStrategy strategy