Examples of MetaTypeService


Examples of org.osgi.service.metatype.MetaTypeService

            }
        }
        // second check is using the meta type service
        if (providingBundle != null)
        {
            final MetaTypeService mts = this.getMetaTypeService();
            if (mts != null)
            {
                final MetaTypeInformation mti = mts.getMetaTypeInformation(providingBundle);
                if (mti != null)
                {
                    try {
                        return mti.getObjectClassDefinition(pid, null) != null;
                    } catch (IllegalArgumentException e) {
View Full Code Here

Examples of org.osgi.service.metatype.MetaTypeService

        // register the MetaTypeService now, that we are ready
        Dictionary props = new Hashtable();
        props.put( Constants.SERVICE_PID, "org.apache.felix.metatype.MetaTypeService" );
        props.put( Constants.SERVICE_DESCRIPTION, "MetaTypeService Specification 1.2 Implementation" );
        props.put( Constants.SERVICE_VENDOR, "Apache Software Foundation" );
        MetaTypeService metaTypeService = new MetaTypeServiceImpl( context );
        context.registerService( MetaTypeService.class.getName(), metaTypeService, props );
    }
View Full Code Here

Examples of org.osgi.service.metatype.MetaTypeService

    }


    public void testEmpty()
    {
        MetaTypeService mts = new MetaTypeServiceImpl( bundleContext );
        MetaTypeInformation mti = mts.getMetaTypeInformation( bundleContext.getBundle() );
        checkEmpty( mti );
    }
View Full Code Here

Examples of org.osgi.service.metatype.MetaTypeService

    }


    public void testAfterCretionManagedService()
    {
        MetaTypeService mts = new MetaTypeServiceImpl( bundleContext );
        MetaTypeInformation mti = mts.getMetaTypeInformation( bundleContext.getBundle() );

        // assert still empty
        checkEmpty( mti );

        // register a service with PID
View Full Code Here

Examples of org.osgi.service.metatype.MetaTypeService

    }


    public void testAfterCretionManagedServiceFactory()
    {
        MetaTypeService mts = new MetaTypeServiceImpl( bundleContext );
        MetaTypeInformation mti = mts.getMetaTypeInformation( bundleContext.getBundle() );

        // assert still empty
        checkEmpty( mti );

        // register a service with PID
View Full Code Here

Examples of org.osgi.service.metatype.MetaTypeService

     *      PID (or factory PID) to which they pertain
     */
    private Map getObjectClassDefinitions( final IdGetter idGetter, final String locale )
    {
        final Map objectClassesDefinitions = new HashMap();
        final MetaTypeService mts = this.getMetaTypeService();
        if ( mts != null )
        {
            final Bundle[] bundles = this.getBundleContext().getBundles();
            for ( int i = 0; i < bundles.length; i++ )
            {
                final MetaTypeInformation mti = mts.getMetaTypeInformation( bundles[i] );
                if ( mti != null )
                {
                    final String[] idList = idGetter.getIds( mti );
                    for ( int j = 0; idList != null && j < idList.length; j++ )
                    {
View Full Code Here

Examples of org.osgi.service.metatype.MetaTypeService

    ObjectClassDefinition getObjectClassDefinition( Bundle bundle, String pid, String locale )
    {
        if ( bundle != null )
        {
            MetaTypeService mts = this.getMetaTypeService();
            if ( mts != null )
            {
                MetaTypeInformation mti = mts.getMetaTypeInformation( bundle );
                if ( mti != null )
                {
                    // see #getObjectClasses( final IdGetter idGetter, final String locale )
                    try
                    {
View Full Code Here

Examples of org.osgi.service.metatype.MetaTypeService

    private MetaTypeInformation originalProvider;
  private String pid;

    protected void activate(ComponentContext ctxt) {
        this.bContext = ctxt.getBundleContext();;      
        MetaTypeService mts = (MetaTypeService)ctxt.locateService("MTS");
    this.pid = (String) ctxt.getServiceReference().getProperty(org.osgi.framework.Constants.SERVICE_PID);
    this.originalProvider = mts.getMetaTypeInformation(ctxt.getBundleContext().getBundle());
    }
View Full Code Here

Examples of org.osgi.service.metatype.MetaTypeService

  protected MetaTypeProvider getPossiblyMutatedMetaTypeProvider(
      String metatypePID, String pid, AlgorithmFactory factory,
      ServiceReference serviceRef)
      throws AlgorithmCreationFailedException {
    MetaTypeProvider provider = null;
    MetaTypeService metaTypeService = (MetaTypeService) Activator
        .getService(MetaTypeService.class.getName());
    if (metaTypeService != null) {
      provider = metaTypeService.getMetaTypeInformation(serviceRef
          .getBundle());
    }
    return provider;
  }
View Full Code Here

Examples of org.osgi.service.metatype.MetaTypeService

    protected void activate(ComponentContext ctxt) {
        bContext = ctxt.getBundleContext();
        algName = (String)ctxt.getProperties().get("Algorithm-Directory");
       
        try {
            MetaTypeService mts = (MetaTypeService) ctxt.locateService("MTS");
            provider = mts.getMetaTypeInformation(ctxt.getBundleContext().getBundle());
        } catch (Throwable e) {
            e.printStackTrace();
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.