You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

HelloPlugin.java 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Copyright 2012 Decebal Suiu
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with
  5. * the License. You may obtain a copy of the License in the LICENSE file, or at:
  6. *
  7. * http://www.apache.org/licenses/LICENSE-2.0
  8. *
  9. * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
  10. * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
  11. * specific language governing permissions and limitations under the License.
  12. */
  13. package ro.fortsoft.pf4j.demo.hello;
  14. import ro.fortsoft.pf4j.Extension;
  15. import ro.fortsoft.pf4j.Plugin;
  16. import ro.fortsoft.pf4j.PluginWrapper;
  17. import ro.fortsoft.pf4j.demo.api.Greeting;
  18. /**
  19. * A very simple plugin.
  20. *
  21. * @author Decebal Suiu
  22. */
  23. public class HelloPlugin extends Plugin {
  24. public HelloPlugin(PluginWrapper wrapper) {
  25. super(wrapper);
  26. }
  27. @Override
  28. public void start() {
  29. System.out.println("HelloPlugin.start()");
  30. }
  31. @Override
  32. public void stop() {
  33. System.out.println("HelloPlugin.stop()");
  34. }
  35. @Extension(ordinal=1)
  36. public static class HelloGreeting implements Greeting {
  37. @Override
  38. public String getGreeting() {
  39. return "Hello";
  40. }
  41. }
  42. }