GriffonAddon.java
01 /*
02  * Copyright 2010-2012 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 griffon.core;
17 
18 import groovy.lang.Closure;
19 import groovy.util.FactoryBuilderSupport;
20 import org.slf4j.Logger;
21 
22 import java.util.List;
23 import java.util.Map;
24 
25 /**
26  * Identifies an Addon artifact.
27  *
28  @author Andres Almiray
29  @since 0.9.2
30  */
31 public interface GriffonAddon extends ApplicationHandler, ThreadingHandler, ResourceHandler {
32     /**
33      * Returns a Logger instance suitable for this addon.<p>
34      *
35      @return a Logger instance associated with this artifact.
36      */
37     Logger getLog();
38 
39     Object newInstance(Class klass, String type);
40 
41     void addonInit(GriffonApplication app);
42 
43     void addonPostInit(GriffonApplication app);
44 
45     void addonBuilderInit(GriffonApplication app, FactoryBuilderSupport builder);
46 
47     void addonBuilderPostInit(GriffonApplication app, FactoryBuilderSupport builder);
48 
49     Map<String, Object> getFactories();
50 
51     Map<String, Closure> getMethods();
52 
53     Map<String, Map<String, Closure>> getProps();
54 
55     Map<String, Closure> getEvents();
56 
57     Map<String, Map<String, Object>> getMvcGroups();
58 
59     List<Closure> getAttributeDelegates();
60 
61     List<Closure> getPreInstantiateDelegates();
62 
63     List<Closure> getPostInstantiateDelegates();
64 
65     List<Closure> getPostNodeCompletionDelegates();
66 }