public class FeatureListenerManager extends Object
FeatureWriters created by the DataStore will need to make use of this class to provide the required FeatureEvents. This class has been updated to store listeners using weak references in order to cut down on memory leaks.
Constructor and Description |
---|
FeatureListenerManager() |
Modifier and Type | Method and Description |
---|---|
void |
addFeatureListener(FeatureSource<? extends FeatureType,? extends Feature> featureSource,
FeatureListener featureListener)
Used by FeaureSource implementations to provide listener support.
|
void |
cleanListenerList(FeatureSource<? extends FeatureType,? extends Feature> featureSource) |
void |
fireChanged(String typeName,
Transaction transaction,
boolean commit)
Notify all listeners that have registered interest for notification on this event type.
|
void |
fireEvent(String typeName,
Transaction transaction,
FeatureEvent event)
Provided event will be used as a template for notifying all FeatureSources for the provided
typeName.
|
void |
fireFeaturesAdded(String typeName,
Transaction transaction,
ReferencedEnvelope bounds,
boolean commit)
Notify all listeners that have registered interest for notification on this event type.
|
void |
fireFeaturesChanged(String typeName,
Transaction transaction,
ReferencedEnvelope bounds,
boolean commit)
Notify all listeners that have registered interest for notification on this event type.
|
void |
fireFeaturesRemoved(String typeName,
Transaction transaction,
ReferencedEnvelope bounds,
boolean commit)
Notify all listeners that have registered interest for notification on this event type.
|
void |
removeFeatureListener(FeatureSource<? extends FeatureType,? extends Feature> featureSource,
FeatureListener featureListener)
Used by SimpleFeatureSource implementations to provide listener support.
|
public void addFeatureListener(FeatureSource<? extends FeatureType,? extends Feature> featureSource, FeatureListener featureListener)
featureSource
- featureListener
- public void removeFeatureListener(FeatureSource<? extends FeatureType,? extends Feature> featureSource, FeatureListener featureListener)
featureSource
- featureListener
- public void cleanListenerList(FeatureSource<? extends FeatureType,? extends Feature> featureSource)
public void fireFeaturesAdded(String typeName, Transaction transaction, ReferencedEnvelope bounds, boolean commit)
This method is called by:
NOTE requiring to fire this event at FeatureWriter.next() is quite a gap inherited
from an old API when FeatureWriter.write()
didn't exist yet. It's a good idea though
to fire the event at FeatureWriter.write() instead of FeatureWriter.next() so there are
actually changes to notify for.
typeName
- typeName being modifiedtransaction
- Transaction used for changebounds
- BoundingBox of changes (may be null
if unknown)commit
- true ifpublic void fireEvent(String typeName, Transaction transaction, FeatureEvent event)
typeName
- transaction
- event
- public void fireFeaturesChanged(String typeName, Transaction transaction, ReferencedEnvelope bounds, boolean commit)
This method is called by:
NOTE requiring to fire this event at FeatureWriter.next() is quite a gap inherited
from an old API when FeatureWriter.write()
didn't exist yet. It's a good idea though
to fire the event at FeatureWriter.write() instead of FeatureWriter.next() so there are
actually changes to notify for.
typeName
- typeName being modifiedtransaction
- Transaction used for changebounds
- BoundingBox of changes (may be null
if unknown)public void fireChanged(String typeName, Transaction transaction, boolean commit)
This method is called by:
typeName
- typeName being modifiedtransaction
- Transaction used for changecommit
- true
for commit
, false
for
rollback
public void fireFeaturesRemoved(String typeName, Transaction transaction, ReferencedEnvelope bounds, boolean commit)
This method is called by:
typeName
- typeName being modifiedtransaction
- Transaction used for changebounds
- BoundingBox of changes (may be null
if unknown)Copyright © 1996–2019 Geotools. All rights reserved.