AbstractActionHandler.java
01 /*
02  * Copyright 2008-2017 the original author or authors.
03  *
04  * Licensed under the Apache License, Version 2.0 (the "License");
05  * you may not use this file except in compliance with the License.
06  * You may obtain a copy of the License at
07  *
08  *     http://www.apache.org/licenses/LICENSE-2.0
09  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package org.codehaus.griffon.runtime.core.controller;
17 
18 import griffon.core.controller.AbortActionExecution;
19 import griffon.core.controller.Action;
20 import griffon.core.controller.ActionExecutionStatus;
21 import griffon.core.controller.ActionHandler;
22 
23 import javax.annotation.Nonnull;
24 import javax.annotation.Nullable;
25 import java.lang.reflect.Method;
26 
27 /**
28  @author Andres Almiray
29  @since 2.1.0
30  */
31 public class AbstractActionHandler implements ActionHandler {
32     @Override
33     public void update(@Nonnull Action action) {
34 
35     }
36 
37     @Override
38     public void configure(@Nonnull Action action, @Nonnull Method method) {
39     }
40 
41     @Nonnull
42     @Override
43     public Object[] before(@Nonnull Action action, @Nonnull Object[] args) {
44         return args;
45     }
46 
47     @Nullable
48     @Override
49     public Object after(@Nonnull ActionExecutionStatus status, @Nonnull Action action, @Nonnull Object[] args, @Nullable Object result) {
50         return result;
51     }
52 
53     @Override
54     public boolean exception(@Nonnull Exception exception, @Nonnull Action action, @Nonnull Object[] args) {
55         return false;
56     }
57 
58     @Nonnull
59     protected AbortActionExecution abortActionExecution() throws AbortActionExecution {
60         throw new AbortActionExecution();
61     }
62 }