Package io.fabric8.agent.resolver

Examples of io.fabric8.agent.resolver.RequirementImpl


        root.getConnection().run(new IJMXRunnable() {
         
          @Override
          public void run(MBeanServerConnection connection) throws JMXException {
            // TODO REPLACE WITH BETTER JmxTemplateImpl...
            BrokerFacade facade = new RemoteBrokerFacade(connection);
            BrokerNode broker = new BrokerNode(root, facade, "Broker");
            root.addChild(broker);
          }
        });
      } catch (CoreException e) {
View Full Code Here


    if( parentElement instanceof IConnectionWrapper ) {
      IConnectionWrapper w = (IConnectionWrapper)parentElement;
      Root r = w.getRoot();
      if( r != null ) {
        if (r.containsDomain("org.apache.activemq")) {
          BrokerFacade facade = new JmxTemplateBrokerFacade(new JmxPluginJmxTemplate(r.getConnection()));
          String brokerName = null;
          try {
            brokerName = facade.getBrokerName();
          } catch (Exception e) {
            ActiveMQJMXPlugin.getLogger().warning("Could not find Broker name: " + e, e);
          }
          if (brokerName == null) {
            brokerName = "Broker";
View Full Code Here

    if( parentElement instanceof IConnectionWrapper ) {
      IConnectionWrapper w = (IConnectionWrapper)parentElement;
      Root r = w.getRoot();
      if( r != null ) {
        if (r.containsDomain("org.apache.activemq")) {
          BrokerFacade facade = new JmxTemplateBrokerFacade(new JmxPluginJmxTemplate(r.getConnection()));
          String brokerName = null;
          try {
            brokerName = facade.getBrokerName();
          } catch (Exception e) {
            ActiveMQJMXPlugin.getLogger().warning("Could not find Broker name: " + e, e);
          }
          if (brokerName == null) {
            brokerName = "Broker";
View Full Code Here

        root.getConnection().run(new IJMXRunnable() {
         
          @Override
          public void run(MBeanServerConnection connection) throws JMXException {
            // TODO REPLACE WITH BETTER JmxTemplateImpl...
            BrokerFacade facade = new RemoteBrokerFacade(connection);
            BrokerNode broker = new BrokerNode(root, facade, "Broker");
            root.addChild(broker);
          }
        });
      } catch (CoreException e) {
View Full Code Here

    }
    return result;
  }

    private boolean isSatisfied(Requirement requirement, Capability capability) {
        RequirementImpl br;
        if (requirement instanceof RequirementImpl) {
            br = (RequirementImpl) requirement;
        } else {
            String filter = requirement.getDirectives().get(Constants.FILTER_DIRECTIVE);
            SimpleFilter sf = (filter != null)
                    ? SimpleFilter.parse(filter)
                    : new SimpleFilter(null, null, SimpleFilter.MATCH_ALL);
            br = new RequirementImpl(null, requirement.getNamespace(), requirement.getDirectives(), requirement.getAttributes(), sf);
        }
        return br.matches(capability);
    }
View Full Code Here

        Map<String, Object> attrs = new HashMap<String, Object>();
        attrs.put(IdentityNamespace.IDENTITY_NAMESPACE, name);
        attrs.put(IdentityNamespace.CAPABILITY_TYPE_ATTRIBUTE, FeatureNamespace.TYPE_FEATURE);
        attrs.put(IdentityNamespace.CAPABILITY_VERSION_ATTRIBUTE, range);
        resource.addRequirement(
                new RequirementImpl(resource, IdentityNamespace.IDENTITY_NAMESPACE,
                        dirs, attrs));
    }
View Full Code Here

        Map<String, Object> attrs = new HashMap<String, Object>();
        attrs.put(IdentityNamespace.IDENTITY_NAMESPACE, cap.getAttributes().get(IdentityNamespace.IDENTITY_NAMESPACE));
        attrs.put(IdentityNamespace.CAPABILITY_TYPE_ATTRIBUTE, cap.getAttributes().get(IdentityNamespace.CAPABILITY_TYPE_ATTRIBUTE));
        attrs.put(IdentityNamespace.CAPABILITY_VERSION_ATTRIBUTE, new VersionRange((Version) cap.getAttributes().get(IdentityNamespace.CAPABILITY_VERSION_ATTRIBUTE), true));
        requirements.addRequirement(
                new RequirementImpl(requirements, IdentityNamespace.IDENTITY_NAMESPACE,
                        Collections.<String, String>emptyMap(), attrs));

    }
View Full Code Here

                attrs.put(CAPABILITY_TYPE_ATTRIBUTE, attributes.get(CAPABILITY_TYPE_ATTRIBUTE));
                Version version = (Version) attributes.get(CAPABILITY_VERSION_ATTRIBUTE);
                if (version != null) {
                    attrs.put(CAPABILITY_VERSION_ATTRIBUTE, new VersionRange(version, true));
                }
                resource.addRequirement(new RequirementImpl(resource, IDENTITY_NAMESPACE, dirs, attrs));
            }
        }
    }
View Full Code Here

  @Override
  public void update(ViewerCell cell) {
    Object element = cell.getElement();
    ContainerViewBean bean = ContainerViewBean.toContainerViewBean(element);
    if (bean != null) {
      Container container = bean.container();
      boolean managed = container.isManaged();
      String image = "yellow-dot.png";
      String status = bean.getStatus();
      Fabric8JMXPlugin.getLogger().debug(
          "Container: " + container.getId() + " alive: "
              + container.isAlive() + " managed: "
              + container.isManaged() + " pending: "
              + container.isProvisioningPending() + " complete: "
              + container.isProvisioningComplete() + " status: "
              + container.getProvisionStatus());
      if (!bean.isAlive()) {
        image = "gray-dot.png";
      }
      if (container.isProvisioningPending()) {
        // image = "pending.gif";
        image = "yellow-dot.png";
        managed = true;
      } else if (status != null) {
        String lowerStatus = status.toLowerCase();
View Full Code Here

            .getImageDescriptor("terminal_view.gif")) {
      @Override
      public void run() {
        List<Container> selectedContainers = getSelectedContainers();
        if (selectedContainers.size() > 0) {
          Container container = selectedContainers.get(0);
          if (container != null) {
            System.err.println("TODO: open terminal");
//            ContainerNode.openTerminal(getFabric(), container, null);
          }
        }
View Full Code Here

TOP

Related Classes of io.fabric8.agent.resolver.RequirementImpl

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.