
com.mycila.plugin.spi.PluginManager Maven / Gradle / Ivy
/**
* Copyright (C) 2008 Mathieu Carbou
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.mycila.plugin.spi;
import com.mycila.plugin.api.Plugin;
import com.mycila.plugin.api.PluginCache;
import com.mycila.plugin.api.PluginLoader;
import com.mycila.plugin.api.PluginResolver;
/**
* Defines a new plugin manager based on a plugin descriptor or
* memory based if you do not pass a descriptor (i.e. META-INF/plugins.properties)
*
* @author Mathieu Carbou ([email protected])
*/
public final class PluginManager {
private final PluginLoader loader;
private final PluginResolver resolver;
private final PluginCache cache;
public PluginManager(Class pluginType) {
loader = new DefaultPluginLoader(pluginType);
cache = new DefaultPluginCache(loader);
resolver = new DefaultPluginResolver(cache);
}
public PluginManager(Class pluginType, String pluginDescriptor) {
loader = new DefaultPluginLoader(pluginType, pluginDescriptor);
cache = new DefaultPluginCache(loader);
resolver = new DefaultPluginResolver(cache);
}
public PluginCache getCache() {
return cache;
}
public PluginLoader getLoader() {
return loader;
}
public PluginResolver getResolver() {
return resolver;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy