public abstract class AttributeBeanStore extends Object implements BoundBeanStore
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 reattached, then any local modifications will be written to the underlying store.
This construct is not thread safe.
Constructor and Description |
---|
AttributeBeanStore(NamingScheme namingScheme) |
Modifier and Type | Method and Description |
---|---|
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(org.jboss.weld.serialization.spi.BeanIdentifier 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.
|
<T> org.jboss.weld.context.api.ContextualInstance<T> |
get(org.jboss.weld.serialization.spi.BeanIdentifier 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<org.jboss.weld.serialization.spi.BeanIdentifier> |
iterator() |
LockedBean |
lock(org.jboss.weld.serialization.spi.BeanIdentifier id)
Gets a creation lock for the given bean id.
|
<T> void |
put(org.jboss.weld.serialization.spi.BeanIdentifier id,
org.jboss.weld.context.api.ContextualInstance<T> instance)
Adds a bean instance to the storage
|
<T> org.jboss.weld.context.api.ContextualInstance<T> |
remove(org.jboss.weld.serialization.spi.BeanIdentifier id)
Removes a bean instance identified by the given id.
|
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
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public AttributeBeanStore(NamingScheme namingScheme)
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(org.jboss.weld.serialization.spi.BeanIdentifier id)
BeanStore
public <T> void put(org.jboss.weld.serialization.spi.BeanIdentifier id, org.jboss.weld.context.api.ContextualInstance<T> instance)
BeanStore
public <T> org.jboss.weld.context.api.ContextualInstance<T> remove(org.jboss.weld.serialization.spi.BeanIdentifier id)
BeanStore
public void clear()
BeanStore
public boolean contains(org.jboss.weld.serialization.spi.BeanIdentifier id)
BeanStore
protected NamingScheme getNamingScheme()
public Iterator<org.jboss.weld.serialization.spi.BeanIdentifier> iterator()
protected abstract Object getAttribute(String prefixedId)
prefixedId
- The (prefixed) id of the attributeprotected 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(org.jboss.weld.serialization.spi.BeanIdentifier id)
BeanStore
protected abstract LockStore getLockStore()
Copyright © 2016. All rights reserved.