diff options
author | Mário Franco <mario.ffranco@gmail.com> | 2015-06-05 15:21:32 +0100 |
---|---|---|
committer | Mário Franco <mario.ffranco@gmail.com> | 2015-06-05 15:21:32 +0100 |
commit | 86a38894c252308188c65892d65ca558df666225 (patch) | |
tree | 5cfa677f8b30c8abfba8a566b3ca3955f7f8b812 /demo | |
parent | 7711e42392c41f4e04f3fdbef01a71923658bdbc (diff) | |
download | pf4j-86a38894c252308188c65892d65ca558df666225.tar.gz pf4j-86a38894c252308188c65892d65ca558df666225.zip |
Editor config style applied
Diffstat (limited to 'demo')
-rw-r--r-- | demo/api/pom.xml | 6 | ||||
-rw-r--r-- | demo/api/src/main/java/ro/fortsoft/pf4j/demo/api/Greeting.java | 6 | ||||
-rw-r--r-- | demo/app/src/main/assembly/assembly.xml | 2 | ||||
-rw-r--r-- | demo/app/src/main/java/ro/fortsoft/pf4j/demo/Boot.java | 186 | ||||
-rw-r--r-- | demo/plugins/disabled.txt | 2 | ||||
-rw-r--r-- | demo/plugins/enabled.txt | 2 | ||||
-rw-r--r-- | demo/plugins/plugin1/pom.xml | 12 | ||||
-rw-r--r-- | demo/plugins/plugin1/src/main/assembly/assembly.xml | 2 | ||||
-rw-r--r-- | demo/plugins/plugin1/src/main/java/ro/fortsoft/pf4j/demo/welcome/WelcomePlugin.java | 6 | ||||
-rw-r--r-- | demo/plugins/plugin2/pom.xml | 10 | ||||
-rw-r--r-- | demo/plugins/plugin2/src/main/assembly/assembly.xml | 2 | ||||
-rw-r--r-- | demo/plugins/plugin2/src/main/java/ro/fortsoft/pf4j/demo/hello/HelloPlugin.java | 6 | ||||
-rw-r--r-- | demo/plugins/pom.xml | 8 | ||||
-rw-r--r-- | demo/pom.xml | 2 |
14 files changed, 126 insertions, 126 deletions
diff --git a/demo/api/pom.xml b/demo/api/pom.xml index 9d748b9..b379fbe 100644 --- a/demo/api/pom.xml +++ b/demo/api/pom.xml @@ -1,6 +1,6 @@ <?xml version="1.0"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - + <parent> <groupId>ro.fortsoft.pf4j.demo</groupId> <artifactId>pf4j-demo-parent</artifactId> @@ -23,7 +23,7 @@ </plugin> </plugins> </build> - + <dependencies> <dependency> <groupId>ro.fortsoft.pf4j</groupId> @@ -32,5 +32,5 @@ <scope>provided</scope> </dependency> </dependencies> - + </project> diff --git a/demo/api/src/main/java/ro/fortsoft/pf4j/demo/api/Greeting.java b/demo/api/src/main/java/ro/fortsoft/pf4j/demo/api/Greeting.java index 9a700c2..ddf3538 100644 --- a/demo/api/src/main/java/ro/fortsoft/pf4j/demo/api/Greeting.java +++ b/demo/api/src/main/java/ro/fortsoft/pf4j/demo/api/Greeting.java @@ -1,11 +1,11 @@ /* * 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. diff --git a/demo/app/src/main/assembly/assembly.xml b/demo/app/src/main/assembly/assembly.xml index ef8515d..77c66b4 100644 --- a/demo/app/src/main/assembly/assembly.xml +++ b/demo/app/src/main/assembly/assembly.xml @@ -1,6 +1,6 @@ <!-- Describes the dist - + @author Decebal Suiu @version 1.0 --> diff --git a/demo/app/src/main/java/ro/fortsoft/pf4j/demo/Boot.java b/demo/app/src/main/java/ro/fortsoft/pf4j/demo/Boot.java index 2619531..4ba1422 100644 --- a/demo/app/src/main/java/ro/fortsoft/pf4j/demo/Boot.java +++ b/demo/app/src/main/java/ro/fortsoft/pf4j/demo/Boot.java @@ -1,93 +1,93 @@ -/*
- * 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;
-
-import java.util.List;
-import java.util.Set;
-
-import org.apache.commons.lang.StringUtils;
-
-import ro.fortsoft.pf4j.DefaultPluginManager;
-import ro.fortsoft.pf4j.PluginManager;
-import ro.fortsoft.pf4j.PluginWrapper;
-import ro.fortsoft.pf4j.demo.api.Greeting;
-
-/**
- * A boot class that start the demo.
- *
- * @author Decebal Suiu
- */
-public class Boot {
-
- public static void main(String[] args) {
- // print logo
- printLogo();
-
- // create the plugin manager
- final PluginManager pluginManager = new DefaultPluginManager();
-
- // load the plugins
- pluginManager.loadPlugins();
-
- // enable a disabled plugin
-// pluginManager.enablePlugin("welcome-plugin");
-
- // start (active/resolved) the plugins
- pluginManager.startPlugins();
-
- // retrieves the extensions for Greeting extension point
- List<Greeting> greetings = pluginManager.getExtensions(Greeting.class);
- System.out.println(String.format("Found %d extensions for extension point '%s'", greetings.size(), Greeting.class.getName()));
- for (Greeting greeting : greetings) {
- System.out.println(">>> " + greeting.getGreeting());
- }
-
- // print extensions from classpath (non plugin)
- System.out.println(String.format("Extensions added by classpath:"));
- Set<String> extensionClassNames = pluginManager.getExtensionClassNames(null);
- for (String extension : extensionClassNames) {
- System.out.println(" " + extension);
- }
-
- // print extensions for each started plugin
- List<PluginWrapper> startedPlugins = pluginManager.getStartedPlugins();
- for (PluginWrapper plugin : startedPlugins) {
- String pluginId = plugin.getDescriptor().getPluginId();
- System.out.println(String.format("Extensions added by plugin '%s':", pluginId));
- extensionClassNames = pluginManager.getExtensionClassNames(pluginId);
- for (String extension : extensionClassNames) {
- System.out.println(" " + extension);
- }
- }
-
- // stop the plugins
- pluginManager.stopPlugins();
- /*
- Runtime.getRuntime().addShutdownHook(new Thread() {
-
- @Override
- public void run() {
- pluginManager.stopPlugins();
- }
-
- });
- */
- }
-
- private static void printLogo() {
- System.out.println(StringUtils.repeat("#", 40));
- System.out.println(StringUtils.center("PF4J-DEMO", 40));
- System.out.println(StringUtils.repeat("#", 40));
- }
-
-}
+/* + * 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; + +import java.util.List; +import java.util.Set; + +import org.apache.commons.lang.StringUtils; + +import ro.fortsoft.pf4j.DefaultPluginManager; +import ro.fortsoft.pf4j.PluginManager; +import ro.fortsoft.pf4j.PluginWrapper; +import ro.fortsoft.pf4j.demo.api.Greeting; + +/** + * A boot class that start the demo. + * + * @author Decebal Suiu + */ +public class Boot { + + public static void main(String[] args) { + // print logo + printLogo(); + + // create the plugin manager + final PluginManager pluginManager = new DefaultPluginManager(); + + // load the plugins + pluginManager.loadPlugins(); + + // enable a disabled plugin +// pluginManager.enablePlugin("welcome-plugin"); + + // start (active/resolved) the plugins + pluginManager.startPlugins(); + + // retrieves the extensions for Greeting extension point + List<Greeting> greetings = pluginManager.getExtensions(Greeting.class); + System.out.println(String.format("Found %d extensions for extension point '%s'", greetings.size(), Greeting.class.getName())); + for (Greeting greeting : greetings) { + System.out.println(">>> " + greeting.getGreeting()); + } + + // print extensions from classpath (non plugin) + System.out.println(String.format("Extensions added by classpath:")); + Set<String> extensionClassNames = pluginManager.getExtensionClassNames(null); + for (String extension : extensionClassNames) { + System.out.println(" " + extension); + } + + // print extensions for each started plugin + List<PluginWrapper> startedPlugins = pluginManager.getStartedPlugins(); + for (PluginWrapper plugin : startedPlugins) { + String pluginId = plugin.getDescriptor().getPluginId(); + System.out.println(String.format("Extensions added by plugin '%s':", pluginId)); + extensionClassNames = pluginManager.getExtensionClassNames(pluginId); + for (String extension : extensionClassNames) { + System.out.println(" " + extension); + } + } + + // stop the plugins + pluginManager.stopPlugins(); + /* + Runtime.getRuntime().addShutdownHook(new Thread() { + + @Override + public void run() { + pluginManager.stopPlugins(); + } + + }); + */ + } + + private static void printLogo() { + System.out.println(StringUtils.repeat("#", 40)); + System.out.println(StringUtils.center("PF4J-DEMO", 40)); + System.out.println(StringUtils.repeat("#", 40)); + } + +} diff --git a/demo/plugins/disabled.txt b/demo/plugins/disabled.txt index fcaef50..45f1801 100644 --- a/demo/plugins/disabled.txt +++ b/demo/plugins/disabled.txt @@ -3,4 +3,4 @@ # - add one plugin id on each line # - put this file in plugins folder ######################################## -#welcome-plugin
\ No newline at end of file +#welcome-plugin diff --git a/demo/plugins/enabled.txt b/demo/plugins/enabled.txt index 5594017..3d76b2f 100644 --- a/demo/plugins/enabled.txt +++ b/demo/plugins/enabled.txt @@ -3,4 +3,4 @@ # - add one plugin id on each line # - put this file in plugins folder ######################################## -#welcome-plugin
\ No newline at end of file +#welcome-plugin diff --git a/demo/plugins/plugin1/pom.xml b/demo/plugins/plugin1/pom.xml index 10e16f7..844d217 100644 --- a/demo/plugins/plugin1/pom.xml +++ b/demo/plugins/plugin1/pom.xml @@ -1,6 +1,6 @@ <?xml version="1.0"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - + <parent> <groupId>ro.fortsoft.pf4j.demo</groupId> <artifactId>pf4j-demo-plugins</artifactId> @@ -19,7 +19,7 @@ <plugin.version>0.0.1</plugin.version> <plugin.provider>Decebal Suiu</plugin.provider> <plugin.dependencies /> - </properties> + </properties> <build> <plugins> @@ -43,7 +43,7 @@ </executions> </plugin> --> - + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> @@ -63,7 +63,7 @@ </execution> </executions> </plugin> - + <plugin> <artifactId>maven-assembly-plugin</artifactId> <version>2.3</version> @@ -110,7 +110,7 @@ </configuration> </plugin> </plugins> - </build> + </build> <dependencies> <dependency> @@ -119,5 +119,5 @@ <version>2.6</version> </dependency> </dependencies> - + </project> diff --git a/demo/plugins/plugin1/src/main/assembly/assembly.xml b/demo/plugins/plugin1/src/main/assembly/assembly.xml index 3fdc464..ce2e92c 100644 --- a/demo/plugins/plugin1/src/main/assembly/assembly.xml +++ b/demo/plugins/plugin1/src/main/assembly/assembly.xml @@ -1,6 +1,6 @@ <!-- Describes the plugin archive - + @author Decebal Suiu @version 1.0 --> diff --git a/demo/plugins/plugin1/src/main/java/ro/fortsoft/pf4j/demo/welcome/WelcomePlugin.java b/demo/plugins/plugin1/src/main/java/ro/fortsoft/pf4j/demo/welcome/WelcomePlugin.java index 1c35259..6021fbf 100644 --- a/demo/plugins/plugin1/src/main/java/ro/fortsoft/pf4j/demo/welcome/WelcomePlugin.java +++ b/demo/plugins/plugin1/src/main/java/ro/fortsoft/pf4j/demo/welcome/WelcomePlugin.java @@ -1,11 +1,11 @@ /* * 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. diff --git a/demo/plugins/plugin2/pom.xml b/demo/plugins/plugin2/pom.xml index c2e5413..7852d4f 100644 --- a/demo/plugins/plugin2/pom.xml +++ b/demo/plugins/plugin2/pom.xml @@ -1,6 +1,6 @@ <?xml version="1.0"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - + <parent> <groupId>ro.fortsoft.pf4j.demo</groupId> <artifactId>pf4j-demo-plugins</artifactId> @@ -19,7 +19,7 @@ <plugin.version>0.0.1</plugin.version> <plugin.provider>Decebal Suiu</plugin.provider> <plugin.dependencies /> - </properties> + </properties> <build> <plugins> @@ -43,7 +43,7 @@ </executions> </plugin> --> - + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> @@ -63,7 +63,7 @@ </execution> </executions> </plugin> - + <plugin> <artifactId>maven-assembly-plugin</artifactId> <version>2.3</version> @@ -110,6 +110,6 @@ </configuration> </plugin> </plugins> - </build> + </build> </project> diff --git a/demo/plugins/plugin2/src/main/assembly/assembly.xml b/demo/plugins/plugin2/src/main/assembly/assembly.xml index 5cefe0d..4eacbe3 100644 --- a/demo/plugins/plugin2/src/main/assembly/assembly.xml +++ b/demo/plugins/plugin2/src/main/assembly/assembly.xml @@ -1,6 +1,6 @@ <!-- Describes the plugin archive - + @author Decebal Suiu @version 1.0 --> diff --git a/demo/plugins/plugin2/src/main/java/ro/fortsoft/pf4j/demo/hello/HelloPlugin.java b/demo/plugins/plugin2/src/main/java/ro/fortsoft/pf4j/demo/hello/HelloPlugin.java index 7072e3d..4502126 100644 --- a/demo/plugins/plugin2/src/main/java/ro/fortsoft/pf4j/demo/hello/HelloPlugin.java +++ b/demo/plugins/plugin2/src/main/java/ro/fortsoft/pf4j/demo/hello/HelloPlugin.java @@ -1,11 +1,11 @@ /* * 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. diff --git a/demo/plugins/pom.xml b/demo/plugins/pom.xml index 3f717c3..3044f1d 100644 --- a/demo/plugins/pom.xml +++ b/demo/plugins/pom.xml @@ -1,6 +1,6 @@ <?xml version="1.0"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - + <parent> <groupId>ro.fortsoft.pf4j.demo</groupId> <artifactId>pf4j-demo-parent</artifactId> @@ -27,7 +27,7 @@ <directory>src/main/resources</directory> </resource> </resources> - + <plugins> <plugin> <artifactId>maven-dependency-plugin</artifactId> @@ -93,7 +93,7 @@ <artifactId>pf4j</artifactId> <version>${project.version}</version> <scope>provided</scope> - </dependency> + </dependency> <dependency> <groupId>ro.fortsoft.pf4j.demo</groupId> @@ -102,5 +102,5 @@ <scope>provided</scope> </dependency> </dependencies> - + </project> diff --git a/demo/pom.xml b/demo/pom.xml index fe55184..087e22f 100644 --- a/demo/pom.xml +++ b/demo/pom.xml @@ -1,6 +1,6 @@ <?xml version="1.0"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - + <parent> <groupId>ro.fortsoft.pf4j</groupId> <artifactId>pf4j-parent</artifactId> |