Selaa lähdekoodia

Update README.md

tags/release-0.4
Decebal Suiu 11 vuotta sitten
vanhempi
commit
1fd679249d
1 muutettua tiedostoa jossa 9 lisäystä ja 7 poistoa
  1. 9
    7
      README.md

+ 9
- 7
README.md Näytä tiedosto

Plugin Framework for Java (PF4J) Plugin Framework for Java (PF4J)
===================== =====================

A plugin is a way for a third party to extend the functionality of an application. A plugin implements extension points A plugin is a way for a third party to extend the functionality of an application. A plugin implements extension points
declared by application or other plugins. Also a plugin can define extension points. declared by application or other plugins. Also a plugin can define extension points.


Components
Features/Benefits
------------------- -------------------
With PF4J you can easily transform a monolithic java application in a modular application.
PF4J is an open source (Apache license) tiny Java library (around 35KB), with minimal dependencies and very extensible (see PluginDescriptorFinder and ExtensionFinder).

No XML, only Java.


You can mark any interface or abstract class as an extension point (with marker interface ExtensionPoint) and you specified that an class is an extension with @Extension annotation.

Components
-------------------
- **Plugin** is the base class for all plugins types. Each plugin is loaded into a separate class loader to avoid conflicts. - **Plugin** is the base class for all plugins types. Each plugin is loaded into a separate class loader to avoid conflicts.
- **PluginManager** is used for all aspects of plugins management (loading, starting, stopping). - **PluginManager** is used for all aspects of plugins management (loading, starting, stopping).
- **ExtensionPoint** is a point in the application where custom code can be invoked. It's a java interface marker. - **ExtensionPoint** is a point in the application where custom code can be invoked. It's a java interface marker.


Artifacts Artifacts
------------------- -------------------

- PF4J `pf4j` (jar) - PF4J `pf4j` (jar)
- PF4J Demo `pf4j-demo` (executable jar) - PF4J Demo `pf4j-demo` (executable jar)


Using Maven Using Maven
------------------- -------------------

In your pom.xml you must define the dependencies to PF4J artifacts with: In your pom.xml you must define the dependencies to PF4J artifacts with:


```xml ```xml


How to use How to use
------------------- -------------------

It's very simple to add pf4j in your application: It's very simple to add pf4j in your application:


public static void main(String[] args) { public static void main(String[] args) {


Demo Demo
------------------- -------------------

I have a tiny demo application. The demo application is in demo folder. I have a tiny demo application. The demo application is in demo folder.
In demo/api folder I declared an extension point (_Greeting_). In demo/api folder I declared an extension point (_Greeting_).
In demo/plugin* I implemented two plugins: plugin1, plugin2 (each plugin adds an extension for _Greeting_). In demo/plugin* I implemented two plugins: plugin1, plugin2 (each plugin adds an extension for _Greeting_).


License License
-------------- --------------
Copyright 2012 Decebal Suiu Copyright 2012 Decebal Suiu
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with

Loading…
Peruuta
Tallenna