View Javadoc

1   package net.sourceforge.blogentis.plugins;
2   
3   //-----------------------------------------------------------------------
4   //Blogentis - a blog publishing platform.
5   //Copyright (C) 2004 Tassos Bassoukos <abassouk@gmail.com>
6   //
7   //This library is free software; you can redistribute it and/or
8   //modify it under the terms of the GNU Lesser General Public
9   //License as published by the Free Software Foundation; either
10  //version 2.1 of the License, or (at your option) any later version.
11  //
12  //This library is distributed in the hope that it will be useful,
13  //but WITHOUT ANY WARRANTY; without even the implied warranty of
14  //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  //Lesser General Public License for more details.
16  //
17  //You should have received a copy of the GNU Lesser General Public
18  //License along with this library; if not, write to the Free Software
19  //Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20  //-----------------------------------------------------------------------
21  //
22  //$Id: IPluginService.java,v 1.1 2004/10/22 17:34:14 tassos Exp $
23  //
24  
25  import java.util.Iterator;
26  
27  import net.sourceforge.blogentis.om.Blog;
28  
29  /***
30   * The PluginService instance will implement this interface.
31   * 
32   * @author abas
33   */
34  public interface IPluginService {
35      public static final String SERVICE_NAME = "BlogPluginService";
36  
37      /***
38       * List the plugins in the order of their definition.
39       * 
40       * @return an iterator that returns IPlugin
41       */
42      public Iterator getPlugins();
43  
44      /***
45       * Register a global extension point.
46       * 
47       * @param point
48       *            the global extension point to register.
49       */
50      public void registerExtensionPoint(IExtensionPoint point);
51  
52      /***
53       * Remove a global extension point.
54       * 
55       * @param point
56       *            the extension point to remove.
57       */
58      public void deregisterExtensionPoint(IExtensionPoint point);
59  
60      /***
61       * Register a blog-specific extension point.
62       * 
63       * @param blog
64       *            the blog that the extension point will apply.
65       * @param point
66       *            the extension point that will be registered.
67       */
68      public void registerExtensionPoint(Blog blog, IBlogExtensionPoint point);
69  
70      /***
71       * Remove a blog-specific extension point
72       * 
73       * @param blog
74       *            the blog that should contain the extension point.
75       * @param point
76       *            the extension point to remove.
77       */
78      public void deregisterExtensionPoint(Blog blog, IBlogExtensionPoint point);
79  
80      /***
81       * Locate the specified extension point in the global extension point list
82       * 
83       * @param name
84       *            the class of the extension point
85       * @return the global extension point, or null if not found.
86       */
87      public IExtensionPoint locateExtensionPoint(Class name);
88  
89      /***
90       * Locate the first extension point that has the specified class in the
91       * extension point list of the blog.
92       * 
93       * @param blog
94       *            the blog that will be searched for the extension point.
95       * @param name
96       *            the class of the extension point.
97       * @return the extension point if found, null otherwise.
98       */
99      public IBlogExtensionPoint locateExtensionPoint(Blog blog, Class name);
100 
101     /***
102      * Get an Iterator over the extension points active for a blog.
103      * 
104      * @param blog
105      * @return
106      */
107     public Iterator getExtensionPoints(Blog blog);
108 
109     /***
110      * Causes the active plugins, extensions points and extensions for a blog to
111      * be recomputed.
112      * 
113      * @param blog
114      *            the blog to reload the plugins.
115      */
116     public void reloadExtensionPointsForBlog(Blog blog);
117 
118     /***
119      * Get the preferences object.
120      * 
121      * @param blog
122      *            the blog to search for.
123      * @param extensionClass
124      *            the extension or extension point
125      * @return the preferences object for that class.
126      */
127     public IPrefs getPreferencesFor(Blog blog, Class extensionClass);
128 }