選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

WelcomePlugin.java 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 org.pf4j.demo.welcome;
  14. import org.pf4j.Extension;
  15. import org.pf4j.Plugin;
  16. import org.pf4j.PluginWrapper;
  17. import org.pf4j.demo.api.Greeting;
  18. /**
  19. * @author Decebal Suiu
  20. */
  21. public class WelcomePlugin extends Plugin {
  22. public WelcomePlugin(PluginWrapper wrapper) {
  23. super(wrapper);
  24. }
  25. public void start() {
  26. System.out.println("WelcomePlugin.start()");
  27. }
  28. public void stop() {
  29. System.out.println("WelcomePlugin.stop()");
  30. }
  31. @Extension
  32. public static class WelcomeGreeting implements Greeting {
  33. public String getGreeting() {
  34. return "Welcome";
  35. }
  36. }
  37. }