站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc 5.0.0

MDRPreChangeListener (NetBeans MDR API) - NetBeans API Javadoc 5.0.0

 

org.netbeans.api.mdr.events
Interface MDRPreChangeListener

All Superinterfaces:
EventListener, MDRChangeListener

public interface MDRPreChangeListener
extends MDRChangeListener

Listener interface containing methods that allow clients to keep track of planned changes in the metadata before they are performed. Both methods defined in this interface should be called synchronously. It is forbidden to use these methods to make changes in the repository - code in these methods should have only read access to the MDR. Implementors of these methods should keep in mind that the longer the code in their implementation of these methods performs, the longer the whole repository is blocked by the source operation that fired these events.

It is not guaranteed that operations of this listener interface will see the intermediate state of any complex operation (like addAll). This behavior is implementation specific so the pre-change listeners should not rely on it.

Note: Adding a listener to any of the MDR event sources is not considered as a write operation.


Method Summary
 void changeCancelled(MDRChangeEvent e)
          This method gets called if a planned change (which was already announced by calling plannedChange(org.netbeans.api.mdr.events.MDRChangeEvent) was cancelled (e.g.
 void plannedChange(MDRChangeEvent e)
          This method gets called when a repository change is planned to occur.
 
Methods inherited from interface org.netbeans.api.mdr.events.MDRChangeListener
change
 

Method Detail

plannedChange

public void plannedChange(MDRChangeEvent e)
                   throws VetoChangeException
This method gets called when a repository change is planned to occur. Any operation that performs a change in MDR has to fire this notification synchronously on each registered pre-change listener before the change is performed.

Any run-time exception thrown by the implementation of this method should not affect the events dispatching (i.e. it should be ignored by the event source).

Parameters:
e - Object describing the planned change.
Throws:
VetoChangeException

changeCancelled

public void changeCancelled(MDRChangeEvent e)
This method gets called if a planned change (which was already announced by calling plannedChange(org.netbeans.api.mdr.events.MDRChangeEvent) was cancelled (e.g. the operation that was going to perform the change failed). This method is called synchronously by the operation that tried to perform the change.

Any run-time exception thrown by the implementation of this method should not affect the events dispatching (i.e. it should be ignored by the event source).

Parameters:
e - Object describing the cancelled change (has to be the same instance as passed to the plannedChange(org.netbeans.api.mdr.events.MDRChangeEvent) method).

 

Built on May 3 2007.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.