/** Gets an array of of all registered ConstantMetaClassListener instances. */ public MetaClassRegistryChangeEventListener[] getMetaClassRegistryChangeEventListeners() { synchronized (changeListenerList) { return (MetaClassRegistryChangeEventListener[]) changeListenerList.toArray( new MetaClassRegistryChangeEventListener[changeListenerList.size()]); } }
/** * Removes a constant meta class listener. * * @param listener the listener */ public void removeMetaClassRegistryChangeEventListener( MetaClassRegistryChangeEventListener listener) { synchronized (changeListenerList) { Object first = changeListenerList.getFirst(); changeListenerList.remove(listener); // we want to keep the first entry! if (changeListenerList.size() == 0) changeListenerList.addFirst(first); } }
/** * Adds a listener for constant meta classes. * * @param listener the listener */ public void addMetaClassRegistryChangeEventListener( MetaClassRegistryChangeEventListener listener) { synchronized (changeListenerList) { changeListenerList.add(listener); } }