public class ActiveCollectionSource extends Object
Modifier and Type | Class and Description |
---|---|
class |
ActiveCollectionSource.Aggregator
This class implements the aggregation functionality triggered
at configured intervals.
|
static class |
ActiveCollectionSource.DerivedDefinition
This class provides the definition of a derived
active collection that will be associated with
the main collection from this source.
|
Constructor and Description |
---|
ActiveCollectionSource()
The default constructor.
|
ActiveCollectionSource(ActiveCollectionSource source)
The copy constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
aggregateEvent(Serializable event)
This method processes the supplied event to determine its group
for subsequent aggregation.
|
void |
close()
This method closes the active collection source.
|
List<AbstractActiveChangeListener> |
getActiveChangeListeners()
This method returns the list of active change listeners to be
automatically registered against the active collection associated
with this source..
|
ActiveCollection |
getActiveCollection()
This method returns the Active Collection associated with the
source.
|
long |
getAggregationDuration()
This method gets the aggregation duration.
|
String |
getAggregationScript()
This method gets the aggregation script.
|
List<ActiveCollectionSource.DerivedDefinition> |
getDerived()
This method returns the list of derived active collection
definitions.
|
List<ActiveCollection> |
getDerivedActiveCollections()
This method returns the derived Active Collections associated with the
source.
|
ActiveCollectionFactory |
getFactory()
This method returns the factory responsible for
creating the active collection.
|
String |
getGroupBy()
This method gets the 'group by' expression.
|
protected Map<Object,List<Object>> |
getGroupedEvents()
This method returns the list of map of grouped events by key.
|
int |
getHighWaterMark()
This method gets the high water mark, used to indicate
when a warning should be issued.
|
long |
getItemExpiration()
This method returns the item expiration duration.
|
boolean |
getLazy()
This method returns whether the active collection associated
with this source should be created lazily or upon registration.
|
String |
getMaintenanceScript()
This method gets the maintenance script.
|
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 associated
with this source.
|
Map<String,Object> |
getProperties()
This method returns the properties.
|
long |
getScheduledInterval()
This method gets the scheduled interval.
|
String |
getScheduledScript()
This method gets the scheduled script.
|
ActiveCollectionType |
getType()
This method returns the active collection type associated
with the source.
|
protected Map<String,Object> |
getVariables()
This method returns the interval variables that
can be used by scripts to cache information used
between invocations.
|
ActiveCollectionVisibility |
getVisibility()
This method returns the active collection visibility associated
with the source.
|
boolean |
hasActiveCollection()
This method determines whether the source has an associated
active collection.
|
void |
init(ActiveCollectionContext context)
This method initializes the active collection source.
|
void |
insert(Object key,
Object value)
This method adds the supplied object to the active collection.
|
void |
maintainEntry(Object key,
Object value)
This method is invoked to handle the supplied entry details.
|
protected void |
preInit()
This method pre-initializes the active collection source
in situations where it needs to be initialized before
registration with the manager.
|
protected void |
publishAggregateEvents()
This method publishes any aggregated events to the associated active
collection.
|
void |
remove(Object key,
Object value)
This method removes the supplied object from the active collection.
|
void |
setActiveChangeListeners(List<AbstractActiveChangeListener> listeners)
This method returns the list of active change listeners to be
automatically registered against the active collection associated
with this source..
|
void |
setActiveCollection(ActiveCollection ac)
This method sets the Active Collection associated with the
source.
|
void |
setAggregationDuration(long duration)
This method sets the aggregation duration.
|
void |
setAggregationScript(String script)
This method sets the aggregation script.
|
void |
setDerived(List<ActiveCollectionSource.DerivedDefinition> derived)
This method sets the list of derived active collection
definitions.
|
void |
setFactory(ActiveCollectionFactory factory)
This method sets the factory responsible for
creating the active collection.
|
void |
setGroupBy(String expr)
This method sets the 'group by' expression.
|
void |
setHighWaterMark(int highWaterMark)
This method sets the high water mark, used to indicate
when a warning should be issued.
|
void |
setItemExpiration(long expire)
This method sets the item expiration duration.
|
void |
setLazy(boolean lazy)
This method sets whether the active collection associated
with this source should be created lazily or upon registration.
|
void |
setMaintenanceScript(String script)
This method sets the maintenance script.
|
void |
setMaxItems(int max)
This method sets the maximum number of items
that will be in the active collection.
|
void |
setName(String name)
This method sets the name of the active collection that
this source represents.
|
void |
setProperties(Map<String,Object> props)
This method sets the properties.
|
void |
setScheduledInterval(long interval)
This method sets the scheduled interval.
|
void |
setScheduledScript(String script)
This method sets the scheduled script.
|
void |
setType(ActiveCollectionType type)
This method sets the active collection type.
|
void |
setVisibility(ActiveCollectionVisibility visibility)
This method sets the active collection visibility.
|
void |
update(Object key,
Object value)
This method updates the supplied value within the active collection,
based on the supplied key.
|
public ActiveCollectionSource()
public ActiveCollectionSource(ActiveCollectionSource source)
source
- The source to copypublic void setName(String name)
name
- The active collection namepublic String getName()
public ActiveCollectionType getType()
public void setType(ActiveCollectionType type)
type
- The typepublic ActiveCollectionVisibility getVisibility()
public void setVisibility(ActiveCollectionVisibility visibility)
visibility
- The visibilitypublic ActiveCollectionFactory getFactory()
public void setFactory(ActiveCollectionFactory factory)
factory
- The factorypublic boolean getLazy()
public void setLazy(boolean lazy)
lazy
- Whether to create active collection lazilypublic long getItemExpiration()
public void setItemExpiration(long expire)
expire
- The item expiration duration, or zero
for no expiration durationpublic int getMaxItems()
public void setMaxItems(int max)
max
- The maximum number of items, or zero
for no limitpublic int getHighWaterMark()
public void setHighWaterMark(int highWaterMark)
highWaterMark
- The high water markpublic List<ActiveCollectionSource.DerivedDefinition> getDerived()
public void setDerived(List<ActiveCollectionSource.DerivedDefinition> derived)
derived
- The derived active collection definitionspublic boolean hasActiveCollection()
public ActiveCollection getActiveCollection()
public void setActiveCollection(ActiveCollection ac)
ac
- The active collectionpublic List<ActiveCollection> getDerivedActiveCollections()
public List<AbstractActiveChangeListener> getActiveChangeListeners()
public void setActiveChangeListeners(List<AbstractActiveChangeListener> listeners)
listeners
- The list of active change listenerspublic void setMaintenanceScript(String script)
script
- The maintenance scriptpublic String getMaintenanceScript()
public void setScheduledScript(String script)
script
- The scheduled scriptpublic String getScheduledScript()
public void setScheduledInterval(long interval)
interval
- The scheduled intervalpublic long getScheduledInterval()
protected Map<String,Object> getVariables()
public Map<String,Object> getProperties()
public void setProperties(Map<String,Object> props)
props
- The propertiespublic void setAggregationDuration(long duration)
duration
- The aggregation durationpublic long getAggregationDuration()
public void setGroupBy(String expr)
expr
- The expressionpublic String getGroupBy()
public void setAggregationScript(String script)
script
- The aggregation scriptpublic String getAggregationScript()
protected void preInit() throws Exception
Exception
- Failed to pre-initializepublic void init(ActiveCollectionContext context) throws Exception
context
- The contextException
- Failed to initialize sourcepublic void maintainEntry(Object key, Object value)
key
- The keyvalue
- The valuepublic void insert(Object key, Object value)
key
- The optional keyvalue
- The valuepublic void update(Object key, Object value)
key
- The keyvalue
- The valuepublic void remove(Object key, Object value)
key
- The optional key, not required for listsvalue
- The valueprotected Map<Object,List<Object>> getGroupedEvents()
protected void aggregateEvent(Serializable event)
event
- The event to be processedprotected void publishAggregateEvents()
Copyright © 2013-2015 JBoss by Red Hat. All Rights Reserved.