|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectFeatureListenerManager
public class FeatureListenerManager
This class is used by DataStore implementations to provide FeatureListener support for the FeatureSources they create.
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 Summary | |
---|---|
FeatureListenerManager()
|
Method Summary | |
---|---|
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. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FeatureListenerManager()
Method Detail |
---|
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)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |