mil.dod.th.ose.remote/src/mil/dod/th/ose/remote/util/MetatypeInformationListener.java
@Activate
    public void activate(final BundleContext context)
    {
        //save the context
        m_Context = context;

        //create handlers
        m_MetaListener = new MetatypeHandler();
        m_MetaBundleListener = new MetatypeBundleHandler();

        //check existing bundles
        for (Bundle bundle : m_Context.getBundles())
        {
            final int state = bundle.getState();
            if (state > Bundle.INSTALLED)
            {
                m_MetaBundleListener.checkBundle(bundle.getBundleId());
            }
        }

        try
        {
            //check existing services that have already been registered
            for (ServiceReference<MetaTypeProvider> ref : m_Context.getServiceReferences(MetaTypeProvider.class, null))
            {
                final String pid = (String)ref.getProperty(EventConstants.SERVICE_PID);
                m_MetaListener.notifyService(ref, pid);
            }
        }
        catch (final InvalidSyntaxException ex)
        {
            m_Logging.error(ex, "Error retrieving MetaTypeProvider service references");
        }

        //register handlers
        m_MetaListener.registerForMetatypeEvents();
        m_MetaBundleListener.registerForMetatypeBundleEvents();
    }
/**
     * Activate this component and pass the context to the event handlers that 
     * listen to metatype events.
     * 
     * @param context
     *      context for this bundle
     */
Activate this component and pass the context to the event handlers that
listen to metatype events.

@param context
context for this bundle
Activate this component and pass the context to the event handlers that listen to metatype events . @param context context for this bundle
@Activate
    public void activate(final BundleContext context)
    {
        m_Context = context;
        m_MetaListener = new MetatypeHandler();
        m_MetaBundleListener = new MetatypeBundleHandler();
        for (Bundle bundle : m_Context.getBundles())
        {
            final int state = bundle.getState();
            if (state > Bundle.INSTALLED)
            {
                m_MetaBundleListener.checkBundle(bundle.getBundleId());
            }
        }
        try
        {
            for (ServiceReference<MetaTypeProvider> ref : m_Context.getServiceReferences(MetaTypeProvider.class, null))
            {
                final String pid = (String)ref.getProperty(EventConstants.SERVICE_PID);
                m_MetaListener.notifyService(ref, pid);
            }
        }
        catch (final InvalidSyntaxException ex)
        {
            m_Logging.error(ex, "Error retrieving MetaTypeProvider service references");
        }
        m_MetaListener.registerForMetatypeEvents();
        m_MetaBundleListener.registerForMetatypeBundleEvents();
    }
@ Activate public void activate ( final BundleContext context ) { m_Context = context ; m_MetaListener = new MetatypeHandler ( ) ; m_MetaBundleListener = new MetatypeBundleHandler ( ) ; for ( Bundle bundle : m_Context . getBundles ( ) ) { final int state = bundle . getState ( ) ; if ( state > Bundle . INSTALLED ) { m_MetaBundleListener . checkBundle ( bundle . getBundleId ( ) ) ; } } try { for ( ServiceReference < MetaTypeProvider > ref : m_Context . getServiceReferences ( MetaTypeProvider . class , null ) ) { final String pid = ( String ) ref . getProperty ( EventConstants . SERVICE_PID ) ; m_MetaListener . notifyService ( ref , pid ) ; } } catch ( final InvalidSyntaxException ex ) { m_Logging . error ( ex , "Error retrieving MetaTypeProvider service references" ) ; } m_MetaListener . registerForMetatypeEvents ( ) ; m_MetaBundleListener . registerForMetatypeBundleEvents ( ) ; }
Activate this component and pass the context to the event handlers that
 listen to metatype events.
Activate this component and pass the context to the event handlers that listen to metatype events .
//save the context //create handlers //check existing bundles //check existing services that have already been registered //register handlers