com.servicerocket.confluence.plugin.utility.library.EnvironmentProviderModuleDescriptorFactory Maven / Gradle / Ivy
The newest version!
package com.servicerocket.confluence.plugin.utility.library;
import com.atlassian.plugin.ModuleDescriptor;
import com.atlassian.plugin.hostcontainer.HostContainer;
import com.atlassian.plugin.module.ModuleFactory;
import com.atlassian.plugin.osgi.external.SingleModuleDescriptorFactory;
import com.servicerocket.confluence.randombits.support.core.env.EnvironmentProvider;
/**
* Constructs a new {@link EnvironmentProviderModuleDescriptor}s.
*/
public class EnvironmentProviderModuleDescriptorFactory extends SingleModuleDescriptorFactory {
private final ModuleFactory moduleFactory;
public EnvironmentProviderModuleDescriptorFactory(HostContainer hostContainer, ModuleFactory moduleFactory) {
super(hostContainer, "environment-provider", EnvironmentProviderModuleDescriptor.class);
this.moduleFactory = moduleFactory;
}
@Override
public ModuleDescriptor getModuleDescriptor(String type) {
return hasModuleDescriptor(type) ? new EnvironmentProviderModuleDescriptor(moduleFactory) : null;
}
}