public abstract class ActiveCollection extends Object implements ActiveCollectionMBean, Iterable<Object>
Modifier and Type | Class and Description |
---|---|
class |
ActiveCollection.ActiveCollectionAdapter
This class provides a bridge between the parent and derived active
collections.
|
Modifier | Constructor and Description |
---|---|
|
ActiveCollection(ActiveCollectionSource acs)
This constructor initializes the active collection.
|
|
ActiveCollection(String name)
This constructor initializes the active collection.
|
protected |
ActiveCollection(String name,
ActiveCollection parent,
ActiveCollectionContext context,
Predicate predicate,
Map<String,Object> properties)
This constructor initializes the active collection as a derived
version of the supplied collection, that applies the supplied predicate.
|
Modifier and Type | Method and Description |
---|---|
void |
addActiveChangeListener(ActiveChangeListener l)
This method adds an Active Change Listener to listen
for notifications of change to the active collection.
|
protected abstract void |
cleanup()
This method performs any required cleanup, associated with
the active collection, related to the max items and item
expiration properties.
|
protected abstract ActiveCollection |
derive(String name,
ActiveCollectionContext context,
Predicate predicate,
Map<String,Object> properties)
This method derives a child active collection from this parent collection,
with the specified name, and filtered using the supplied predicate.
|
protected abstract void |
doInsert(Object key,
Object value)
This method adds the supplied object to the active collection.
|
protected abstract void |
doRemove(Object key,
Object value)
This method removes the supplied object from the active collection.
|
protected abstract void |
doUpdate(Object key,
Object value)
This method updates the supplied value within the active collection,
based on the supplied key.
|
protected void |
finalize() |
List<ActiveChangeListener> |
getActiveChangeListeners()
This method returns the list of active change listeners.
|
protected ActiveCollectionContext |
getContext()
This method returns the context.
|
int |
getHighWaterMark()
This method gets the high water mark, used to indicate
when a warning should be issued.
|
protected boolean |
getHighWaterMarkWarningIssued()
This method determines whether the high water mark
warning has been issued.
|
long |
getItemExpiration()
This method returns the item expiration duration.
|
int |
getMaxItems()
This method returns the maximum number of items that should be
contained within the active collection.
|
String |
getName()
This method returns the name of the active collection.
|
protected ActiveCollection |
getParent()
This method returns the parent active collection.
|
protected Predicate |
getPredicate()
This method returns the predicate.
|
protected Object |
getProperty(String name,
Object def)
This method returns the value of a name property.
|
abstract int |
getSize()
This method returns the size of the active collection.
|
ActiveCollectionVisibility |
getVisibility()
This method returns the visibility.
|
protected void |
inserted(Object key,
Object value)
This method notifies interested listeners that the entry with the
supplied key (which may be an index into a list) has been inserted
with the supplied value.
|
protected boolean |
isActive()
This property identifies whether the collection is active.
|
protected boolean |
isDerived()
This method determines whether this is a derived active collection.
|
abstract List<Object> |
query(QuerySpec qs)
This method queries the active collection, using the supplied spec.
|
void |
removeActiveChangeListener(ActiveChangeListener l)
This method removes an Active Change Listener.
|
protected void |
removed(Object key,
Object value)
This method notifies interested listeners that the entry with the
supplied key (which may be an index into a list) has been removed
having the supplied value.
|
protected void |
setHighWaterMark(int highWaterMark)
This method sets the high water mark, used to indicate
when a warning should be issued.
|
protected void |
setHighWaterMarkWarningIssued(boolean issued)
This method sets whether the high water mark
warning has been issued.
|
protected void |
setItemExpiration(long expire)
This method sets the item expiration duration.
|
protected void |
setMaxItems(int max)
This method sets the maximum number of items
that will be in the active collection.
|
protected void |
setVisibility(ActiveCollectionVisibility visibility)
This method sets the visibility.
|
protected void |
updated(Object key,
Object value)
This method notifies interested listeners that the entry with the
supplied key (which may be an index into a list) has been replaced
with the supplied value.
|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, iterator, spliterator
public ActiveCollection(String name)
name
- The namepublic ActiveCollection(ActiveCollectionSource acs)
acs
- The Active Collection sourceprotected ActiveCollection(String name, ActiveCollection parent, ActiveCollectionContext context, Predicate predicate, Map<String,Object> properties)
name
- The nameparent
- The parent collectioncontext
- The contextpredicate
- The predicateproperties
- The optional propertiespublic String getName()
getName
in interface ActiveCollectionMBean
protected ActiveCollection getParent()
protected Predicate getPredicate()
protected ActiveCollectionContext getContext()
public ActiveCollectionVisibility getVisibility()
protected void setVisibility(ActiveCollectionVisibility visibility)
visibility
- The visibilitypublic long getItemExpiration()
getItemExpiration
in interface ActiveCollectionMBean
protected void setItemExpiration(long expire)
expire
- The item expiration duration, or zero
for no expiration durationpublic int getMaxItems()
getMaxItems
in interface ActiveCollectionMBean
protected void setMaxItems(int max)
max
- The maximum number of items, or zero
for no limitpublic int getHighWaterMark()
getHighWaterMark
in interface ActiveCollectionMBean
protected void setHighWaterMark(int highWaterMark)
highWaterMark
- The high water markprotected boolean getHighWaterMarkWarningIssued()
protected void setHighWaterMarkWarningIssued(boolean issued)
issued
- Whether the high water mark has been issuedprotected Object getProperty(String name, Object def)
name
- The namedef
- The optional default value, if the property is not definedprotected boolean isDerived()
protected boolean isActive()
protected abstract void cleanup()
public void addActiveChangeListener(ActiveChangeListener l)
l
- The listenerpublic void removeActiveChangeListener(ActiveChangeListener l)
l
- The listenerpublic List<ActiveChangeListener> getActiveChangeListeners()
public abstract int getSize()
getSize
in interface ActiveCollectionMBean
protected abstract void doInsert(Object key, Object value)
key
- The optional keyvalue
- The valueprotected void inserted(Object key, Object value)
key
- The key, or list index, for the inserted valuevalue
- The inserted valueprotected abstract void doUpdate(Object key, Object value)
key
- The keyvalue
- The valueprotected void updated(Object key, Object value)
key
- The key, or list index, for the replaced valuevalue
- The replacement valueprotected abstract void doRemove(Object key, Object value)
key
- The optional keyvalue
- The valueprotected void removed(Object key, Object value)
key
- The key, or list index, for the removed valuevalue
- The removed valueprotected void finalize() throws Throwable
protected abstract ActiveCollection derive(String name, ActiveCollectionContext context, Predicate predicate, Map<String,Object> properties)
name
- The derived collection namecontext
- The contextpredicate
- The predicateproperties
- The optional propertiesCopyright © 2013-2015 JBoss by Red Hat. All Rights Reserved.