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.

DemoPluginManager.java 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Copyright (C) 2012-present the original author or authors.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package org.pf4j.demo;
  17. import org.pf4j.DefaultExtensionFinder;
  18. import org.pf4j.DefaultPluginFactory;
  19. import org.pf4j.DefaultPluginManager;
  20. import org.pf4j.ExtensionFinder;
  21. import org.pf4j.PluginFactory;
  22. class DemoPluginManager extends DefaultPluginManager {
  23. // Use below code if you want to enable ServiceProviderExtensionFinder
  24. /*
  25. @Override
  26. protected ExtensionFinder createExtensionFinder() {
  27. DefaultExtensionFinder extensionFinder = (DefaultExtensionFinder) super.createExtensionFinder();
  28. extensionFinder.addServiceProviderExtensionFinder(); // to activate "HowdyGreeting" extension
  29. return extensionFinder;
  30. }
  31. */
  32. @Override
  33. protected PluginFactory createPluginFactory() {
  34. return new DemoPluginFactory();
  35. }
  36. }