Skip to main content
aboutsummaryrefslogblamecommitdiffstats
blob: 1b05a5b39a79898ecb3e221989bf0b8ca3c414fe (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13












                                                                                 
                                                                 





                                                                            
                                                             
 
                                    
                                                               

                                                         
 

                                                        
                                                      
                                                   
                                                               
                                                      

         

 
/*******************************************************************************
 * Copyright (c) 2008 Martin Lippert and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 *   Martin Lippert               initial implementation      
 *******************************************************************************/

package org.eclipse.equinox.weaving.hooks;

import org.eclipse.equinox.service.weaving.ISupplementerRegistry;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleEvent;
import org.osgi.framework.SynchronousBundleListener;

public class SupplementBundleListener implements SynchronousBundleListener {

    private final ISupplementerRegistry supplementerRegistry;

    public SupplementBundleListener(
            final ISupplementerRegistry supplementerRegistry) {
        this.supplementerRegistry = supplementerRegistry;
    }

    public void bundleChanged(final BundleEvent event) {
        final Bundle bundle = event.getBundle();
        if (event.getType() == BundleEvent.RESOLVED) {
            supplementerRegistry.addBundle(bundle);
        } else if (event.getType() == BundleEvent.UNRESOLVED) {
            supplementerRegistry.removeBundle(bundle);
        }
    }

}

Back to the top