Examples of ObjectClassDefinition


Examples of org.osgi.service.metatype.ObjectClassDefinition

  protected Map setupIdToLabelMap(String metatype_pid,
      MetaTypeProvider provider) {
    Map idToLabelMap = new HashMap();
    if (provider != null) {
      ObjectClassDefinition ocd = null;
      try {
        ocd = provider.getObjectClassDefinition(metatype_pid, null);

        if (ocd != null) {
          AttributeDefinition[] attr = ocd
              .getAttributeDefinitions(ObjectClassDefinition.ALL);

          for (int i = 0; i < attr.length; i++) {
            String id = attr[i].getID();
            String label = attr[i].getName();
View Full Code Here

Examples of org.osgi.service.metatype.ObjectClassDefinition

        boolean doSimpleMerge = true;
        final MetaTypeServiceSupport mtss = getMetaTypeSupport();
        if ( mtss != null )
        {
            ObjectClassDefinition ocd = null;
            if ( config != null )
            {
                ocd = mtss.getObjectClassDefinition( config, locale );
            }
            if ( ocd == null )
View Full Code Here

Examples of org.osgi.service.metatype.ObjectClassDefinition

                // insert and entry for the PID
                if ( mtss != null )
                {
                    try
                    {
                        ObjectClassDefinition ocd = mtss.getObjectClassDefinition( cfgs[i], locale );
                        if ( ocd != null )
                        {
                            optionsPlain.put( pid, ocd.getName() );
                            continue;
                        }
                    }
                    catch ( IllegalArgumentException t )
                    {
View Full Code Here

Examples of org.osgi.service.metatype.ObjectClassDefinition

                String name = pid;
                boolean haveOcd = !ocdRequired;
                final MetaTypeServiceSupport mtss = getMetaTypeSupport();
                if ( mtss != null )
                {
                    final ObjectClassDefinition ocd = mtss.getObjectClassDefinition( refs[i].getBundle(), pid, locale );
                    if ( ocd != null )
                    {
                        name = ocd.getName();
                        haveOcd = true;
                    }
                }

                if ( haveOcd )
View Full Code Here

Examples of org.osgi.service.metatype.ObjectClassDefinition

        for ( Iterator ei = ocdCollection.entrySet().iterator(); ei.hasNext(); )
        {
            Entry ociEntry = ( Entry ) ei.next();
            final String pid = ( String ) ociEntry.getKey();
            final ObjectClassDefinition ocd = ( ObjectClassDefinition ) ociEntry.getValue();
            if ( filter == null )
            {
                pidMap.put( pid, ocd.getName() );
            }
            else
            {
                final Dictionary props = new Hashtable();
                props.put( type, pid );
                if ( filter.match( props ) )
                {
                    pidMap.put( pid, ocd.getName() );
                }
            }
        }
    }
View Full Code Here

Examples of org.osgi.service.metatype.ObjectClassDefinition

                "How long a lock is held before releasing due to suspected deadlock",
                AttributeDefinition.LONG,
                new String[] { String.valueOf(this.getScrConfiguration().lockTimeout())},
                0, null, null) );

        return new ObjectClassDefinition()
        {

            private final AttributeDefinition[] attrs = adList
                .toArray(new AttributeDefinition[adList.size()]);
View Full Code Here

Examples of org.osgi.service.metatype.ObjectClassDefinition

            if (ocdRef == null || "".equals(ocdRef)) {
                throw new ResourceProcessorException(ResourceProcessorException.CODE_OTHER_ERROR, "Object ocdRef attribute missing or invalid");
            }

            // determine OCD
            ObjectClassDefinition ocd = null;
            OCD localOcd = (OCD) localOcds.get(ocdRef);
            // ask meta type service for matching OCD if no local OCD has been defined
            ocd = (localOcd != null) ? new ObjectClassDefinitionImpl(localOcd) : getMetaTypeOCD(data, designate);
            if (ocd == null) {
                throw new ResourceProcessorException(ResourceProcessorException.CODE_OTHER_ERROR, "No Object Class Definition found with id=" + ocdRef);
View Full Code Here

Examples of org.osgi.service.metatype.ObjectClassDefinition

     * @param designate The designate whose object class definition should be determined.
     * @return
     * @throws ResourceProcessorException
     */
    private ObjectClassDefinition getMetaTypeOCD(MetaData data, Designate designate) throws ResourceProcessorException {
      ObjectClassDefinition ocd = null;
      String ocdRef = designate.getObject().getOcdRef();
      Bundle bundle = getBundle(designate.getBundleLocation(), isFactoryConfig(designate));
      if (bundle != null) {
        MetaTypeInformation mti = m_metaService.getMetaTypeInformation(bundle);
        if (mti != null) {
          String pid = isFactoryConfig(designate) ? pid = designate.getFactoryPid() : designate.getPid();
          try {
            ObjectClassDefinition tempOcd = mti.getObjectClassDefinition(pid, null);
            // tempOcd will always have a value, if pid was not known IAE will be thrown
            if (ocdRef.equals(tempOcd.getID())) {
              ocd = tempOcd;
            }
          }
          catch (IllegalArgumentException iae) {
            // let null be returned
View Full Code Here

Examples of org.osgi.service.metatype.ObjectClassDefinition

        Bundle[] bundles = bundleContext.getBundles();
        MetaTypeObjectDTO answer = null;
        for (Bundle bundle : bundles) {
            MetaTypeInformation info = getMetaTypeInformation(bundle);
            if (info != null) {
                ObjectClassDefinition object = MetaTypeSummaryDTO.tryGetObjectClassDefinition(info, pid, locale);
                if (object != null) {
                    if (answer == null) {
                        answer = new MetaTypeObjectDTO(object);
                    } else {
                        answer.appendObjectDefinition(object);
View Full Code Here

Examples of org.osgi.service.metatype.ObjectClassDefinition

    }

    protected MetaTypeObjectDTO getMetaTypeObject(Bundle bundle, String pid, String locale) {
        MetaTypeInformation info = getMetaTypeInformation(bundle);
        if (info != null) {
            ObjectClassDefinition objectClassDefinition = info.getObjectClassDefinition(pid, locale);
            if (objectClassDefinition != null) {
                return new MetaTypeObjectDTO(objectClassDefinition);
            }
        }
        return null;
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.