import java.util.TreeSet; | import java.util.TreeSet; | ||||
/** | /** | ||||
* Processes {@link Extension} annotations and generates an {@link ExtensionStorage}. | |||||
* You can specify the concrete {@link ExtensionStorage} via processor's environment options | |||||
* ({@link ProcessingEnvironment#getOptions()}) or system property. | |||||
* In both variants the option/property name is {@code pf4j.storageClassName}. | |||||
* | |||||
* @author Decebal Suiu | * @author Decebal Suiu | ||||
*/ | */ | ||||
public class ExtensionAnnotationProcessor extends AbstractProcessor { | public class ExtensionAnnotationProcessor extends AbstractProcessor { | ||||
return storage; | return storage; | ||||
} | } | ||||
} | } |
import java.util.Set; | import java.util.Set; | ||||
/** | /** | ||||
* It's a storage (database) that persists {@link org.pf4j.Extension}s. | |||||
* The standard operations supported by storage are {@link #read} and {@link #write}. | |||||
* The storage is populated by {@link ExtensionAnnotationProcessor}. | |||||
* | |||||
* @author Decebal Suiu | * @author Decebal Suiu | ||||
*/ | */ | ||||
public abstract class ExtensionStorage { | public abstract class ExtensionStorage { |
import java.util.regex.Pattern; | import java.util.regex.Pattern; | ||||
/** | /** | ||||
* Stores {@link org.pf4j.Extension}s in {@code META-INF/extensions.idx}. | |||||
* | |||||
* @author Decebal Suiu | * @author Decebal Suiu | ||||
*/ | */ | ||||
public class LegacyExtensionStorage extends ExtensionStorage { | public class LegacyExtensionStorage extends ExtensionStorage { |
import java.util.regex.Pattern; | import java.util.regex.Pattern; | ||||
/** | /** | ||||
* Stores {@link org.pf4j.Extension}s in {@code META-INF/services}. | |||||
* | |||||
* @author Decebal Suiu | * @author Decebal Suiu | ||||
*/ | */ | ||||
public class ServiceProviderExtensionStorage extends ExtensionStorage { | public class ServiceProviderExtensionStorage extends ExtensionStorage { |