import java.util.List;\r
import java.util.Set;\r
\r
-import org.apache.commons.lang.StringUtils;\r
+import org.apache.commons.lang3.StringUtils;\r
\r
import ro.fortsoft.pf4j.DefaultPluginManager;\r
import ro.fortsoft.pf4j.PluginManager;\r
// start (active/resolved) the plugins\r
pluginManager.startPlugins();\r
\r
+ System.out.println("Plugindirectory: ");\r
+ System.out.println("\t" + System.getProperty("pf4j.pluginsDir", "plugins") + "\n");\r
+\r
// retrieves the extensions for Greeting extension point\r
List<Greeting> greetings = pluginManager.getExtensions(Greeting.class);\r
System.out.println(String.format("Found %d extensions for extension point '%s'", greetings.size(), Greeting.class.getName()));\r
System.out.println(">>> " + greeting.getGreeting());\r
}\r
\r
- // print extensions from classpath (non plugin)\r
- System.out.println(String.format("Extensions added by classpath:"));\r
- Set<String> extensionClassNames = pluginManager.getExtensionClassNames(null);\r
- for (String extension : extensionClassNames) {\r
- System.out.println(" " + extension);\r
- }\r
+ // // print extensions from classpath (non plugin)\r
+ // System.out.println(String.format("Extensions added by classpath:"));\r
+ // Set<String> extensionClassNames = pluginManager.getExtensionClassNames(null);\r
+ // for (String extension : extensionClassNames) {\r
+ // System.out.println(" " + extension);\r
+ // }\r
\r
// print extensions for each started plugin\r
List<PluginWrapper> startedPlugins = pluginManager.getStartedPlugins();\r
for (PluginWrapper plugin : startedPlugins) {\r
String pluginId = plugin.getDescriptor().getPluginId();\r
System.out.println(String.format("Extensions added by plugin '%s':", pluginId));\r
- extensionClassNames = pluginManager.getExtensionClassNames(pluginId);\r
- for (String extension : extensionClassNames) {\r
- System.out.println(" " + extension);\r
- }\r
+ // extensionClassNames = pluginManager.getExtensionClassNames(pluginId);\r
+ // for (String extension : extensionClassNames) {\r
+ // System.out.println(" " + extension);\r
+ // }\r
}\r
\r
// stop the plugins\r
/*
* Copyright 2012 Decebal Suiu
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with
* the License. You may obtain a copy of the License in the LICENSE file, or at:
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package ro.fortsoft.pf4j.demo.welcome;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
import ro.fortsoft.pf4j.Extension;
import ro.fortsoft.pf4j.Plugin;
import ro.fortsoft.pf4j.PluginWrapper;
-import ro.fortsoft.pf4j.RuntimeMode;
import ro.fortsoft.pf4j.demo.api.Greeting;
/**
@Override
public void start() {
System.out.println("WelcomePlugin.start()");
- // for testing the development mode
- if (RuntimeMode.DEVELOPMENT.equals(wrapper.getRuntimeMode())) {
System.out.println(StringUtils.upperCase("WelcomePlugin"));
- }
}
@Override