*/
@SuppressWarnings("unchecked")
protected synchronized boolean loadPlugins() {
final String pluginDir = getServletContext().getRealPath("/WEB-INF/plugins");
try {
PluginClassLoader pcl = new PluginClassLoader(pluginDir, new Class[] {WikiPlugin.class});
List<Class<?>> plugins = pcl.getClasses(WikiPlugin.class);
if (plugins != null) {
for (Class<?> clazz: plugins) {
WikiPlugin plugin;
try {
plugin = ((Class<WikiPlugin>) clazz).newInstance();