View Javadoc

1   /*
2    * Copyright 2002-2004 the original author or authors.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5    * use this file except in compliance with the License. You may obtain a copy of
6    * the License at
7    * 
8    * http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13   * License for the specific language governing permissions and limitations under
14   * the License.
15   */
16  package org.springframework.richclient.command;
17  
18  /**
19   * Implementations of this interface can be assigned to an action command to
20   * intercept command execution.
21   * 
22   * @author Keith Donald, Mathias Broekelmann
23   */
24  public interface ActionCommandInterceptor {
25  
26  	/**
27  	 * Will be called before the action command is executed.
28  	 * 
29  	 * @param command
30  	 *            the action command which gets executed
31  	 * @return If false the action command and any subsequent action command
32  	 *         interceptor will not get executed. If true the action command
33  	 *         will be executed.
34  	 */
35  	public boolean preExecution(ActionCommand command);
36  
37  	/**
38  	 * Will be called after successfull execution of an action command.
39  	 * 
40  	 * @param command
41  	 *            the action command which was executed.
42  	 */
43  	public void postExecution(ActionCommand command);
44  }