it.uniroma2.art.coda.standalone.impl.StandaloneComponentProvider Maven / Gradle / Ivy
package it.uniroma2.art.coda.standalone.impl;
import java.util.Properties;
import it.uniroma2.art.coda.osgi.OSGiAwareAbstractComponentProvider;
import it.uniroma2.art.coda.provisioning.ComponentProvider;
import it.uniroma2.art.coda.provisioning.ComponentProvisioningException;
import org.apache.felix.bundlerepository.RepositoryAdmin;
import org.apache.felix.bundlerepository.impl.RepositoryAdminImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
//import it.uniroma2.art.owlart.sesame2impl.factory.ARTModelFactorySesame2Impl;
//import it.uniroma2.art.owlart.sesame2impl.models.conf.Sesame2ModelConfiguration;
public class StandaloneComponentProvider extends OSGiAwareAbstractComponentProvider {
private static final Logger logger = LoggerFactory.getLogger(ComponentProvider.class);
private RepositoryAdmin repoAdmin;
private CODAOSGiManger osgiManager;
public StandaloneComponentProvider(CODAOSGiManger osgiManager, Properties provisioningProperties) throws Exception {
super(osgiManager.getFramework().getBundleContext(), provisioningProperties);
this.osgiManager = osgiManager;
this.repoAdmin = new RepositoryAdminImpl(osgiManager.getFramework().getBundleContext(),
new org.apache.felix.utils.log.Logger(osgiManager.getFramework().getBundleContext()));
}
public StandaloneComponentProvider(CODAOSGiManger osgiManager) throws Exception {
this(osgiManager, new Properties());
}
@Override
public void close() {
try {
super.close();
} finally {
this.osgiManager.stop();
}
}
@Override
protected RepositoryAdmin getRepositoryAdmin() throws ComponentProvisioningException {
return repoAdmin;
}
}