public void changed(FeatureEvent featureEvent) { FeatureEvent retyped = new FeatureEvent(source, featureEvent.getEventType(), featureEvent.getBounds()); listener.changed(retyped); } }
/** * Called by a ContentState to let others transactions know of a modification. * * <p>Transaction.AUTO_COMMIT state will call this method for everything; others mostly use this * to broadcast the BatchFeatureEvents issued during commit and rollback. */ void notifiyFeatureEvent(ContentState source, FeatureEvent notification) { for (ContentState entry : state.values()) { if (entry == source) { continue; // no notificaiton required } for (FeatureListener listener : entry.listeners) { try { listener.changed(notification); } catch (Throwable t) { // problem issuing notification to an interested party dataStore.LOGGER.log( Level.WARNING, "Problem issuing feature event " + notification, t); } } } }
public void changed(FeatureEvent featureEvent) { FeatureListener listener = reference.get(); if (listener == null) { removeFeatureListener(this); } else { listener.changed(featureEvent); } } }
/** * Fire notifications out to those listing on this transaction. * * @param typeName * @param transaction * @param type * @param bounds */ private void fireEvent( String typeName, Transaction transaction, int type, ReferencedEnvelope bounds) { FeatureSource<? extends FeatureType, ? extends Feature> featureSource; FeatureListener[] listeners; FeatureEvent event; Map<SimpleFeatureSource, FeatureListener[]> map = getListeners(typeName, transaction); for (Map.Entry entry : map.entrySet()) { featureSource = (FeatureSource) entry.getKey(); listeners = (FeatureListener[]) entry.getValue(); event = new FeatureEvent(featureSource, type, bounds); for (int l = 0; l < listeners.length; l++) { listeners[l].changed(event); } } } /**
/** * Fire notifications out to everyone. * * @param typeName * @param transaction */ private void fireCommit( String typeName, Transaction transaction, int type, ReferencedEnvelope bounds) { FeatureSource<? extends FeatureType, ? extends Feature> featureSource; FeatureListener[] listeners; FeatureEvent event; Map<SimpleFeatureSource, FeatureListener[]> map = getListeners(typeName, Transaction.AUTO_COMMIT); for (Map.Entry entry : map.entrySet()) { featureSource = (FeatureSource<? extends FeatureType, ? extends Feature>) entry.getKey(); listeners = (FeatureListener[]) entry.getValue(); if (hasTransaction(featureSource) && (getTransaction(featureSource) == transaction)) { continue; // skip notify members of the same transaction } event = new FeatureEvent(featureSource, type, bounds); for (int l = 0; l < listeners.length; l++) { listeners[l].changed(event); } } } /**
/** * Notifies all waiting listeners that a commit has been issued; this notification is also sent * to our */ public final void fireBatchFeatureEvent(boolean isCommit) { if (batchFeatureEvent == null) { return; } if (isCommit) { batchFeatureEvent.setType(Type.COMMIT); // This state already knows about the changes, let others know a modifications was made this.entry.notifiyFeatureEvent(this, batchFeatureEvent); } else { batchFeatureEvent.setType(Type.ROLLBACK); // Notify this state about the rollback, other transactions see no change for (FeatureListener listener : listeners) { try { listener.changed(batchFeatureEvent); } catch (Throwable t) { this.entry.dataStore.LOGGER.log( Level.WARNING, "Problem issuing batch feature event " + batchFeatureEvent, t); } } } batchFeatureEvent = null; }
listener.changed(event); } catch (Throwable t) { this.entry.dataStore.LOGGER.log(
public void changed( FeatureEvent featureEvent ) { FeatureListener listener = reference.get(); if(listener==null){ removeFeatureListener( this ); } else { listener.changed(featureEvent); } } }
/** * Called by a ContentState to let others transactions know of a modification. * <p> * Transaction.AUTO_COMMIT state will call this method for everything; others * mostly use this to broadcast the BatchFeatureEvents issued during commit * and rollback. */ void notifiyFeatureEvent( ContentState source, FeatureEvent notification){ for(ContentState entry : state.values() ){ if( entry == source ) { continue; // no notificaiton required } for( FeatureListener listener : source.listeners ){ try { listener.changed( notification ); } catch (Throwable t ){ // problem issuing notification to an interested party dataStore.LOGGER.log( Level.WARNING, "Problem issuing feature event "+notification, t ); } } } }
private void fireEvent( String typeName, Transaction transaction, int type, Envelope bounds) { Map.Entry entry; FeatureSource featureSource; FeatureListener[] listeners; FeatureEvent event; Map map = getListeners(typeName, transaction); for (Iterator i = map.entrySet().iterator(); i.hasNext();) { entry = (Map.Entry) i.next(); featureSource = (FeatureSource) entry.getKey(); listeners = (FeatureListener[]) entry.getValue(); event = new FeatureEvent(featureSource, type, bounds); for (int l = 0; l < listeners.length; l++) { listeners[l].changed(event); } } } /**
/** * Fire notifications out to those listing on this transaction. * @param typeName * @param transaction * @param type * @param bounds */ private void fireEvent( String typeName, Transaction transaction, int type, ReferencedEnvelope bounds) { FeatureSource<? extends FeatureType, ? extends Feature> featureSource; FeatureListener[] listeners; FeatureEvent event; Map<SimpleFeatureSource,FeatureListener[]> map = getListeners(typeName, transaction); for (Map.Entry entry : map.entrySet()) { featureSource = (FeatureSource) entry.getKey(); listeners = (FeatureListener[]) entry.getValue(); event = new FeatureEvent(featureSource,type, bounds); for (int l = 0; l < listeners.length; l++) { listeners[l].changed(event); } } } /**
/** * TODO summary sentence for fireEvent ... * * @param typeName * @param transaction */ private void fireCommit( String typeName, Transaction transaction, int type, Envelope bounds) { Map.Entry entry; FeatureSource featureSource; FeatureListener[] listeners; FeatureEvent event; Map map = getListeners(typeName, Transaction.AUTO_COMMIT); for (Iterator i = map.entrySet().iterator(); i.hasNext();) { entry = (Map.Entry) i.next(); featureSource = (FeatureSource) entry.getKey(); listeners = (FeatureListener[]) entry.getValue(); if (hasTransaction(featureSource) && (getTransaction(featureSource) == transaction)) { continue; // skip notify members of the same transaction } event = new FeatureEvent(featureSource, type, bounds); for (int l = 0; l < listeners.length; l++) { listeners[l].changed(event); } } }
/** * Fire notifications out to everyone. * * @param typeName * @param transaction */ private void fireCommit( String typeName, Transaction transaction, int type, ReferencedEnvelope bounds) { FeatureSource<? extends FeatureType, ? extends Feature> featureSource; FeatureListener[] listeners; FeatureEvent event; Map<SimpleFeatureSource,FeatureListener[]> map = getListeners(typeName, Transaction.AUTO_COMMIT); for (Map.Entry entry : map.entrySet()) { featureSource = (FeatureSource<? extends FeatureType, ? extends Feature>) entry.getKey(); listeners = (FeatureListener[]) entry.getValue(); if (hasTransaction(featureSource) && (getTransaction(featureSource) == transaction)) { continue; // skip notify members of the same transaction } event = new FeatureEvent(featureSource, type, bounds); for (int l = 0; l < listeners.length; l++) { listeners[l].changed(event); } } } /**
/** * Notifies all waiting listeners that a commit has been issued; this notification is also sent * to our */ public final void fireBatchFeatureEvent(boolean isCommit) { if (batchFeatureEvent == null) { return; } if (listeners.isEmpty()) { return; } if (isCommit) { batchFeatureEvent.setType(Type.COMMIT); } else { batchFeatureEvent.setType(Type.ROLLBACK); } for (FeatureListener listener : listeners) { try { listener.changed(batchFeatureEvent); } catch (Throwable t) { this.entry.dataStore.LOGGER.log(Level.WARNING, "Problem issuing batch feature event " + batchFeatureEvent, t); } } // Let others know a modifications was made this.entry.notifiyFeatureEvent(this, batchFeatureEvent); batchFeatureEvent = null; }
listener.changed(event); } catch (Throwable t) { this.entry.dataStore.LOGGER.log(Level.WARNING,