Package io.fabric8.api.jmx

Examples of io.fabric8.api.jmx.MQBrokerStatusDTO


  /* (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

            for (MQBrokerConfigDTO configDTO : list) {
                ProfileRequirements profileRequirements = requirements.findProfileRequirements(profile.getId());
                int count = 0;
                for (Container container : containers) {
                    if (Containers.containerHasProfile(container, profile)) {
                        MQBrokerStatusDTO status = createStatusDTO(profile, configDTO, profileRequirements, container);
                        count++;
                        answer.add(status);
                    }
                }
                // if there are no containers yet, lets create a record anyway
                if (count == 0) {
                    MQBrokerStatusDTO status = createStatusDTO(profile, configDTO, profileRequirements, null);
                    answer.add(status);
                }
            }
        }
        addMasterSlaveStatus(answer);
View Full Code Here

                        Map<String, Object> map = mapper.readValue(data, HashMap.class);
                        String id = stringValue(map, "id", "container");
                        if (id != null) {
                            String container = stringValue(map, "container", "agent");
                            String statusPath = String.format("%s/%s", container, id);
                            MQBrokerStatusDTO containerStatus = containerMap.get(statusPath);
                            if (containerStatus != null) {
                                Boolean master = null;
                                List services = listValue(map, "services");
                                if (services != null) {
                                    if (!services.isEmpty()) {
                                        List<String> serviceTexts = new ArrayList<String>();
                                        for (Object service : services) {
                                            String serviceText = getSubstitutedData(curator, service.toString());
                                            if (Strings.isNotBlank(serviceText)) {
                                                serviceTexts.add(serviceText);
                                            }
                                            containerStatus.setServices(serviceTexts);
                                        }
                                        master = Boolean.TRUE;
                                    } else {
                                        master = Boolean.FALSE;
                                    }
                                } else {
                                    master = Boolean.FALSE;
                                }
                                containerStatus.setMaster(master);
                            }
                        }
                    }
                }
            }
View Full Code Here

        }
        return null;
    }

    protected MQBrokerStatusDTO createStatusDTO(Profile profile, MQBrokerConfigDTO configDTO, ProfileRequirements profileRequirements, Container container) {
        MQBrokerStatusDTO answer = new MQBrokerStatusDTO(configDTO);
        if (container != null) {
            answer.setContainer(container.getId());
            answer.setAlive(container.isAlive());
            answer.setProvisionResult(container.getProvisionResult());
            answer.setProvisionStatus(container.getProvisionStatus());
            answer.setJolokiaUrl(container.getJolokiaUrl());
        }
        if (profileRequirements != null) {
            Integer minimumInstances = profileRequirements.getMinimumInstances();
            if (minimumInstances != null) {
                answer.setMinimumInstances(minimumInstances);
            }
        }
        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.MQBrokerStatusDTO

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.