01 /*
02 * Copyright 2008-2015 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.addon;
17
18 import griffon.core.GriffonApplication;
19 import griffon.core.addon.GriffonAddon;
20 import org.slf4j.Logger;
21 import org.slf4j.LoggerFactory;
22
23 import javax.annotation.Nonnull;
24 import javax.inject.Inject;
25 import java.util.Collections;
26 import java.util.List;
27 import java.util.Map;
28
29 /**
30 * @author Andres Almiray
31 * @since 2.0.0
32 */
33 public class AbstractGriffonAddon implements GriffonAddon {
34 private final Logger log;
35
36 @Inject
37 public AbstractGriffonAddon() {
38 log = LoggerFactory.getLogger("griffon.addon." + getClass().getSimpleName());
39 }
40
41 @Nonnull
42 @Override
43 public Logger getLog() {
44 return log;
45 }
46
47 @Override
48 public void init(@Nonnull GriffonApplication application) {
49 // empty
50 }
51
52 @Nonnull
53 @Override
54 public Map<String, Map<String, Object>> getMvcGroups() {
55 return Collections.emptyMap();
56 }
57
58 @Nonnull
59 @Override
60 public List<String> getStartupGroups() {
61 return Collections.emptyList();
62 }
63
64 @Override
65 public boolean canShutdown(@Nonnull GriffonApplication application) {
66 return true;
67 }
68
69 @Override
70 public void onShutdown(@Nonnull GriffonApplication application) {
71 // empty
72 }
73 }
|