Search in sources :

Example 26 with MavenResolver

use of io.fabric8.maven.MavenResolver in project fabric8 by jboss-fuse.

the class Activator method stop.

/**
 * Performs cleanup:<br/>
 * * Unregister handler;<br/>
 * * Unregister managed service;<br/>
 * * Release bundle context.
 *
 * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
 */
public void stop(final BundleContext bundleContext) {
    if (m_handlerReg != null) {
        m_handlerReg.unregister();
        m_handlerReg = null;
    }
    if (m_managedServiceReg != null) {
        m_managedServiceReg.unregister();
        m_managedServiceReg = null;
    }
    ServiceRegistration<MavenResolver> registration = m_resolverReg.getAndSet(null);
    if (registration != null) {
        registration.unregister();
    }
    MavenResolver resolver = m_resolver.getAndSet(null);
    if (resolver != null) {
        try {
            resolver.close();
        } catch (IOException e) {
        // Ignore
        }
    }
    m_bundleContext = null;
    LOG.debug("Handler for protocols " + PROTOCOL + " stopped");
}
Also used : MavenResolver(io.fabric8.maven.MavenResolver) IOException(java.io.IOException)

Aggregations

MavenResolver (io.fabric8.maven.MavenResolver)23 File (java.io.File)18 Test (org.junit.Test)11 IOException (java.io.IOException)9 Metadata (org.apache.maven.artifact.repository.metadata.Metadata)6 Hashtable (java.util.Hashtable)5 DownloadManager (io.fabric8.agent.download.DownloadManager)4 RuntimeProperties (io.fabric8.api.RuntimeProperties)4 AbstractRuntimeProperties (io.fabric8.api.scr.AbstractRuntimeProperties)4 MavenConfigurationImpl (io.fabric8.maven.util.MavenConfigurationImpl)4 HashMap (java.util.HashMap)4 HttpServletRequest (javax.servlet.http.HttpServletRequest)4 HttpServletResponse (javax.servlet.http.HttpServletResponse)4 ByteArrayOutputStream (java.io.ByteArrayOutputStream)3 Server (org.eclipse.jetty.server.Server)3 ServerConnector (org.eclipse.jetty.server.ServerConnector)3 DictionaryPropertyResolver (org.ops4j.util.property.DictionaryPropertyResolver)3 DownloadCallback (io.fabric8.agent.download.DownloadCallback)2 Downloader (io.fabric8.agent.download.Downloader)2 StreamProvider (io.fabric8.agent.download.StreamProvider)2