Package org.osgi.service.metatype

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


        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

    }

    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

                if (factory) {
                    summary.getFactoryPidBundleIds().add(bundleId);
                } else {
                    summary.getPidBundleIds().add(bundleId);
                }
                ObjectClassDefinition objectClassDefinition = MetaTypeSummaryDTO.tryGetObjectClassDefinition(info, pid, locale);
                if (objectClassDefinition != null) {
                    summary.appendObjectDefinition(objectClassDefinition);
                }
            }
        }
View Full Code Here

    /**
     * Attempts to get the object definition ignoring any failures of missing declarations
     */
    public static ObjectClassDefinition tryGetObjectClassDefinition(MetaTypeInformation info, String pid, String locale) {
        ObjectClassDefinition object = null;
        try {
            object = info.getObjectClassDefinition(pid, locale);
        } catch (Exception e) {
            // ignore missing definition
        }
View Full Code Here

TOP

Related Classes of org.osgi.service.metatype.ObjectClassDefinition

Copyright © 2018 www.massapicom. 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.