Package io.fabric8.api.jmx

Examples of io.fabric8.api.jmx.MetaTypeObjectDTO


  /* (non-Javadoc)
   * @see java.lang.Comparable#compareTo(java.lang.Object)
   */
  @Override
  public int compareTo(Version o) {
    return new VersionSequence(getId()).compareTo(new VersionSequence(o.getId()));
  }
View Full Code Here


            Fabric8JMXPlugin.getLogger().warning(ex);
          return null;
        }
        final Set<ObjectName> queryNames = connection.queryNames(fabricObjectName, null);
        for (ObjectName fabric8ObjectName : queryNames) {
          FabricManagerMBean fabricMBean = MBeanServerInvocationHandler.newProxyInstance(connection, fabric8ObjectName, FabricManagerMBean.class, true);
          return callback.doWithFabricManagerMBean(fabricMBean);
        }
        return null;
      }
    });
View Full Code Here

    }

    @Override
    public MetaTypeObjectDTO getPidMetaTypeObject(String pid, String locale) {
        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);
                    }
                }
            }
        }
        return answer;
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

        findMetadataForProfile(versionId, profileId, handler);
        return answer.get();
    }

    protected static MetaTypeObjectDTO createMetaTypeObjectDTO(Properties resources, OCD ocd) {
        MetaTypeObjectDTO answer = new MetaTypeObjectDTO();
        answer.setId(ocd.getID());
        answer.setName(localize(resources, ocd.getName()));
        answer.setDescription(localize(resources, ocd.getDescription()));

        List<MetaTypeAttributeDTO> attributeList = new ArrayList<>();

        Map<String, Object> attributes = ocd.getAttributeDefinitions();
        if (attributes != null) {
            Set<Map.Entry<String, Object>> entries = attributes.entrySet();
            for (Map.Entry<String, Object> entry : entries) {
                String name = entry.getKey();
                Object value = entry.getValue();
                if (value instanceof AD) {
                    AD ad = (AD) value;
                    MetaTypeAttributeDTO attributeDTO = createMetaTypeAttributeDTO(resources, ocd, name, ad);
                    if (attributeDTO != null) {
                        attributeList.add(attributeDTO);
                    }
                }
            }
        }
        answer.setAttributes(attributeList);
        return answer;
    }
View Full Code Here

public class CamelNodeProvider implements NodeProvider {

  @Override
  public void provide(final Root root) {
    if (root.containsDomain("org.apache.camel")) {
      CamelFacade facade = new JmxTemplateCamelFacade(new JmxPluginJmxTemplate(root.getConnection()));
      CamelContextsNode camel = new CamelContextsNode(root, facade);
      root.addChild(camel);
    }
  }
View Full Code Here

    if( parentElement instanceof IConnectionWrapper ) {
      IConnectionWrapper w = (IConnectionWrapper)parentElement;
      Root r = w.getRoot();
      if( r != null ) {
        if (r.containsDomain("org.apache.camel")) {
          CamelFacade facade = new JmxTemplateCamelFacade(new JmxPluginJmxTemplate(r.getConnection()));
          CamelContextsNode camel = new CamelContextsNode(r, facade);
          return new Object[]{camel};
        }
      }
    } else if (parentElement instanceof NodeSupport) {
View Full Code Here

public class CamelNodeProvider implements NodeProvider {

  @Override
  public void provide(final Root root) {
    if (root.containsDomain("org.apache.camel")) {
      CamelFacade facade = new JmxTemplateCamelFacade(new JmxPluginJmxTemplate(root.getConnection()));
      CamelContextsNode camel = new CamelContextsNode(root, facade);
      root.addChild(camel);
    }
  }
View Full Code Here

    if( parentElement instanceof IConnectionWrapper ) {
      IConnectionWrapper w = (IConnectionWrapper)parentElement;
      Root r = w.getRoot();
      if( r != null ) {
        if (r.containsDomain("org.apache.camel")) {
          CamelFacade facade = new JmxTemplateCamelFacade(new JmxPluginJmxTemplate(r.getConnection()));
          CamelContextsNode camel = new CamelContextsNode(r, facade);
          return new Object[]{camel};
        }
      }
    } else if (parentElement instanceof NodeSupport) {
View Full Code Here

  @Override
  public List<IExchange> browseExchanges() {
    List<IExchange> answer = new ArrayList<IExchange>();
    if (endpointMBean instanceof CamelBrowsableEndpointMBean) {
      CamelBrowsableEndpointMBean browsable = (CamelBrowsableEndpointMBean) endpointMBean;
      long size = browsable.queueSize();
      try {
        for (int i = 0; i < size; i++) {
          String xml = browsable.browseMessageAsXml(i, true);
          if (xml != null) {
            Exchange exchange = Exchanges.unmarshalNoNamespaceXmlString(xml);
            if (exchange != null) {
              IMessage in = exchange.getIn();
              if (in != null) {
View Full Code Here

TOP

Related Classes of io.fabric8.api.jmx.MetaTypeObjectDTO

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.