|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.weld.context.beanstore.AttributeBeanStore
public abstract class AttributeBeanStore
A bound bean store backed by attributes. This bean store is "write-through" - if attached it will write any modifications to the backing store immediately. If detached modifications will not be written through. If the bean store is reattched, then any local modifications will be written to the underlying store.
This construct is not thread safe.
Constructor Summary | |
---|---|
AttributeBeanStore(NamingScheme namingScheme)
|
Method Summary | ||
---|---|---|
boolean |
attach()
Attach the bean store, any updates from now on will be written through to the underlying store. |
|
void |
clear()
Clears the store of contextual instances |
|
boolean |
contains(String id)
Check if the store contains an instance |
|
boolean |
detach()
Detach the bean store, causing updates to longer be written through to the underlying store. |
|
|
get(String id)
Gets an instance of a contextual from the store |
|
protected abstract Object |
getAttribute(String prefixedId)
Gets an attribute from the underlying storage |
|
protected abstract Collection<String> |
getAttributeNames()
Gets an enumeration of the attribute names present in the underlying storage |
|
protected abstract LockStore |
getLockStore()
|
|
protected NamingScheme |
getNamingScheme()
|
|
protected Collection<String> |
getPrefixedAttributeNames()
Gets an enumeration of the attribute names present in the underlying storage |
|
boolean |
isAttached()
Return true if the bean store is attached |
|
Iterator<String> |
iterator()
|
|
LockedBean |
lock(String id)
Gets a creation lock for the given bean id. |
|
|
put(String id,
org.jboss.weld.context.api.ContextualInstance<T> instance)
Adds a bean instance to the storage |
|
protected abstract void |
removeAttribute(String prefixedId)
Removes an attribute from the underlying storage |
|
protected abstract void |
setAttribute(String prefixedId,
Object instance)
Sets an instance under a key in the underlying storage |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AttributeBeanStore(NamingScheme namingScheme)
Method Detail |
---|
public boolean detach()
detach
in interface BoundBeanStore
public boolean attach()
Attach the bean store, any updates from now on will be written through to the underlying store.
When the bean store is attached, the detached state is assumed to be authoritative if there are any conflicts.
attach
in interface BoundBeanStore
public boolean isAttached()
BoundBeanStore
isAttached
in interface BoundBeanStore
public <T> org.jboss.weld.context.api.ContextualInstance<T> get(String id)
BeanStore
get
in interface BeanStore
id
- The id of the contextual to return
public <T> void put(String id, org.jboss.weld.context.api.ContextualInstance<T> instance)
BeanStore
put
in interface BeanStore
instance
- the contextual instancepublic void clear()
BeanStore
clear
in interface BeanStore
public boolean contains(String id)
BeanStore
contains
in interface BeanStore
id
- the id of the instance to check for
protected NamingScheme getNamingScheme()
public Iterator<String> iterator()
iterator
in interface Iterable<String>
iterator
in interface BeanStore
protected abstract Object getAttribute(String prefixedId)
prefixedId
- The (prefixed) id of the attribute
protected abstract void removeAttribute(String prefixedId)
prefixedId
- The (prefixed) id of the attribute to removeprotected abstract Collection<String> getAttributeNames()
protected Collection<String> getPrefixedAttributeNames()
protected abstract void setAttribute(String prefixedId, Object instance)
prefixedId
- The (prefixed) id of the attribute to setinstance
- The instancepublic LockedBean lock(String id)
BeanStore
lock
in interface BeanStore
id
- The bean id
protected abstract LockStore getLockStore()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |