Package org.apache.logging.log4j.core.config.plugins

Examples of org.apache.logging.log4j.core.config.plugins.PluginManager


    public static ConfigurationFactory getInstance() {
        String factoryClass = System.getProperty(CONFIGURATION_FACTORY_PROPERTY);
        if (factoryClass != null) {
            addFactory(factoryClass);
        }
        PluginManager manager = new PluginManager("ConfigurationFactory");
        manager.collectPlugins();
        Map<String, PluginType> plugins = manager.getPlugins();
        Set<WeightedFactory> ordered = new TreeSet<WeightedFactory>();
        for (PluginType type : plugins.values()) {
            try {
                Class<ConfigurationFactory> clazz = type.getPluginClass();
                Order o = clazz.getAnnotation(Order.class);
View Full Code Here


     * @param converterKey The key to lookup the converters.
     * @param expected The expected base Class of each Converter.
     */
    public PatternParser(Configuration config, String converterKey, Class expected) {
        this.config = config;
        PluginManager manager = new PluginManager(converterKey, expected);
        manager.collectPlugins();
        Map<String, PluginType> plugins = manager.getPlugins();
        Map<String, Class<PatternConverter>> converters = new HashMap<String, Class<PatternConverter>>();

        for (PluginType type : plugins.values()) {
            try {
                Class<PatternConverter> clazz = type.getPluginClass();
View Full Code Here

    private final StrLookup defaultLookup;

    public Interpolator(StrLookup defaultLookup) {
        this.defaultLookup = defaultLookup == null ? new MapLookup(new HashMap<String, String>()) : defaultLookup;
        PluginManager manager = new PluginManager("Lookup");
        manager.collectPlugins();
        Map<String, PluginType> plugins = manager.getPlugins();

        for (Map.Entry<String, PluginType> entry : plugins.entrySet()) {
            Class<StrLookup> clazz = entry.getValue().getPluginClass();
            try {
                lookups.put(entry.getKey(), clazz.newInstance());
View Full Code Here

    /**
     * Constructor.
     */
    protected BaseConfiguration() {
        pluginManager = new PluginManager("Core");
        rootNode = new Node();
    }
View Full Code Here

                        key = entry.getValue();
                        break;
                    }
                }
                if (key != null) {
                    final PluginManager manager = new PluginManager("KeyProvider", SecretKeyProvider.class);
                    manager.collectPlugins();
                    final Map<String, PluginType<?>> plugins = manager.getPlugins();
                    if (plugins != null) {
                        boolean found = false;
                        for (final Map.Entry<String, PluginType<?>> entry : plugins.entrySet()) {
                            if (entry.getKey().equalsIgnoreCase(key)) {
                                found = true;
View Full Code Here

                        key = entry.getValue();
                        break;
                    }
                }
                if (key != null) {
                    final PluginManager manager = new PluginManager("KeyProvider", SecretKeyProvider.class);
                    manager.collectPlugins();
                    final Map<String, PluginType<?>> plugins = manager.getPlugins();
                    if (plugins != null) {
                        boolean found = false;
                        for (final Map.Entry<String, PluginType<?>> entry : plugins.entrySet()) {
                            if (entry.getKey().equalsIgnoreCase(key)) {
                                found = true;
View Full Code Here

    /**
     * Constructor.
     */
    protected BaseConfiguration() {
        pluginManager = new PluginManager("Core");
        rootNode = new Node();
    }
View Full Code Here

    public static ConfigurationFactory getInstance() {
        final String factoryClass = PropertiesUtil.getProperties().getStringProperty(CONFIGURATION_FACTORY_PROPERTY);
        if (factoryClass != null) {
            addFactory(factoryClass);
        }
        final PluginManager manager = new PluginManager("ConfigurationFactory");
        manager.collectPlugins();
        final Map<String, PluginType> plugins = manager.getPlugins();
        final Set<WeightedFactory> ordered = new TreeSet<WeightedFactory>();
        for (final PluginType type : plugins.values()) {
            try {
                final Class<ConfigurationFactory> clazz = type.getPluginClass();
                final Order o = clazz.getAnnotation(Order.class);
View Full Code Here

    public static ConfigurationFactory getInstance() {
        String factoryClass = System.getProperty(CONFIGURATION_FACTORY_PROPERTY);
        if (factoryClass != null) {
            addFactory(factoryClass);
        }
        PluginManager manager = new PluginManager("ConfigurationFactory");
        manager.collectPlugins();
        Map<String, PluginType> plugins = manager.getPlugins();
        Set<WeightedFactory> ordered = new TreeSet<WeightedFactory>();
        for (PluginType type : plugins.values()) {
            try {
                Class<ConfigurationFactory> clazz = type.getPluginClass();
                Order o = clazz.getAnnotation(Order.class);
View Full Code Here

    private final StrLookup defaultLookup;

    public Interpolator(StrLookup defaultLookup) {
        this.defaultLookup = defaultLookup == null ? new MapLookup(new HashMap<String, String>()) : defaultLookup;
        PluginManager manager = new PluginManager("Lookup");
        manager.collectPlugins();
        Map<String, PluginType> plugins = manager.getPlugins();

        for (Map.Entry<String, PluginType> entry : plugins.entrySet()) {
            Class<StrLookup> clazz = entry.getValue().getPluginClass();
            try {
                lookups.put(entry.getKey(), clazz.newInstance());
View Full Code Here

TOP

Related Classes of org.apache.logging.log4j.core.config.plugins.PluginManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.