Examples of MetaTypeProvider


Examples of org.osgi.service.metatype.MetaTypeProvider

            synchronized ( this )
            {
                Set newLocales = new HashSet();
                for ( Iterator mi = this.metaTypeProviders.values().iterator(); mi.hasNext(); )
                {
                    MetaTypeProvider mtp = ( MetaTypeProvider ) mi.next();
                    this.addValues( newLocales, mtp.getLocales() );
                }
                this.locales = newLocales;
            }
        }
View Full Code Here

Examples of org.osgi.service.metatype.MetaTypeProvider

        if ( id == null || id.length() == 0 )
        {
            throw new IllegalArgumentException( "ObjectClassDefinition ID must not be null or empty" );
        }

        MetaTypeProvider mtp = ( MetaTypeProvider ) this.metaTypeProviders.get( id );
        if ( mtp == null )
        {
            throw new IllegalArgumentException( "No ObjectClassDefinition for id=" + id );
        }

        ObjectClassDefinition ocd = mtp.getObjectClassDefinition( id, locale );
        if ( ocd == null )
        {
            throw new IllegalArgumentException( "No localized ObjectClassDefinition for id=" + id );
        }
View Full Code Here

Examples of org.osgi.service.metatype.MetaTypeProvider

    }


    public Object addingService( ServiceReference reference )
    {
        final MetaTypeProvider provider = ( MetaTypeProvider ) this.context.getService( reference );
        final MetaTypeProviderHolder holder = new MetaTypeProviderHolder( reference, provider );
        mti.addService( holder );
        return holder;
    }
View Full Code Here

Examples of org.osgi.service.metatype.MetaTypeProvider

    this.currentParentItem = dataItem;
    refresh(dataItem);
    // Create algorithm parameters.
    String metatypePID = getMetaTypeID(serviceReference);
    // get the input parameters
    MetaTypeProvider provider = null;

    try {
      provider = getPossiblyMutatedMetaTypeProvider(metatypePID, pid,
          factory, serviceReference);
    } catch (AlgorithmCreationFailedException e) {
      String format = "An error occurred when creating the algorithm \"%s\" with the data you "
          + "provided.  (Reason: %s)";
      String logMessage = String.format(format,
          serviceReference.getProperty(AlgorithmProperty.LABEL),
          e.getMessage());

      return;
    } catch (Exception e) {
      return;
    }

    if (parameters == null || parameters.isEmpty())
      return;

    final GeneralTreeItem paramItem = new GeneralTreeItem("Parameters",
        Constant.Label, dataItem, Utils.getImage("parameters.png",
            brandPluginID));
    dataItem.addChild(paramItem);
    ObjectClassDefinition obj = provider.getObjectClassDefinition(
        metatypePID, null);
    if (obj != null) {
      AttributeDefinition[] attr = obj
          .getAttributeDefinitions(ObjectClassDefinition.ALL);
View Full Code Here

Examples of org.osgi.service.metatype.MetaTypeProvider

  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());
View Full Code Here

Examples of org.osgi.service.metatype.MetaTypeProvider

       
        String mtpID = "-1";
        if (factory != null && algReg != null && mtpReg != null && dmReg != null) {
            Data[] dm = dmReg.getDataModels(dataModelIDs);
           
            MetaTypeProvider mtp = getMetaTypeProvider(servicePID, dm);
            mtpID = mtpReg.registerMetaTypeProvider(mtp);
        }
       
        return mtpID;
    }
View Full Code Here

Examples of org.osgi.service.metatype.MetaTypeProvider

    /**
     * @see org.cishell.remoting.service.framework.MetaTypeProviderRegistry#getLocales(String)
     */
    public Vector getLocales(String providerID) {
        MetaTypeProvider provider = getMetaTypeProvider(providerID);
       
        if (provider != null) {
            return toVector(provider.getLocales());
        } else {
            return new Vector();
        }
    }
View Full Code Here

Examples of org.osgi.service.metatype.MetaTypeProvider

     * @see org.cishell.remoting.service.framework.MetaTypeProviderRegistry#getObjectClassDefinition(String, java.lang.String, java.lang.String)
     */
    public String getObjectClassDefinition(String providerID, String id,
            String locale) {
        String ocdID = "-1";
        MetaTypeProvider provider = getMetaTypeProvider(providerID);
        ObjectClassDefinitionRegistry ocdRegistry =
            (ObjectClassDefinitionRegistry) ocdReg.getService();
       
        if (provider != null && ocdRegistry != null) {
            ObjectClassDefinition ocd = provider.getObjectClassDefinition(id, locale);
           
            if (ocd != null) {
                ocdID = ocdRegistry.registerObjectClassDefinition(ocd);
            }
        }
View Full Code Here

Examples of org.osgi.service.metatype.MetaTypeProvider

      // Create algorithm parameters.
      String metatypePID = getMetaTypeID(this.serviceReference);

      // TODO: Refactor this.
      MetaTypeProvider provider = null;

      try {
        provider = getPossiblyMutatedMetaTypeProvider(metatypePID, pid, factory);
      } catch (AlgorithmCreationFailedException e) {
        String format =
View Full Code Here

Examples of org.osgi.service.metatype.MetaTypeProvider

  }

  protected MetaTypeProvider getPossiblyMutatedMetaTypeProvider(
      String metatypePID, String pid, AlgorithmFactory factory)
      throws AlgorithmCreationFailedException {
    MetaTypeProvider provider = null;
    MetaTypeService metaTypeService = (MetaTypeService) Activator
        .getService(MetaTypeService.class.getName());
    if (metaTypeService != null) {
      provider = metaTypeService
          .getMetaTypeInformation(this.serviceReference.getBundle());

    }

    if ((factory instanceof ParameterMutator) && (provider != null)) {
      try {
        ObjectClassDefinition objectClassDefinition = provider
            .getObjectClassDefinition(metatypePID, null);

        if (objectClassDefinition == null) {
          logNullOCDWarning(pid, metatypePID);
        }
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.