Package io.fabric8.agent

Examples of io.fabric8.agent.DeploymentBuilder


        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

        DownloadManager manager = new DownloadManager(mavenConfiguration, Executors.newFixedThreadPool(2));

        Map<URI, Repository> repositories = new HashMap<URI, Repository>();
        AgentUtils.addRepository(manager, repositories, URI.create("mvn:org.apache.karaf.assemblies.features/standard/" + System.getProperty("karaf-version") + "/xml/features"));

        DeploymentBuilder builder = new DeploymentBuilder(manager, null, repositories.values(), 0);

        builder.download(new HashSet<String>(Arrays.asList("karaf-framework", "ssh")),
                         Collections.<String>emptySet(),
                         Collections.<String>emptySet(),
                         Collections.<String>emptySet(),
                         Collections.<String>emptySet(),
                         Collections.<String>emptySet(),
                         Collections.<String, Map<VersionRange, Map<String, String>>>emptyMap(), null);

        properties = new Properties();
        properties.setProperty("org.osgi.framework.system.packages.extra", "org.apache.karaf.jaas.boot;version=\"2.4.0.SNAPSHOT\",org.apache.karaf.jaas.boot.principal;version=\"2.4.0.SNAPSHOT\",org.apache.karaf.management.boot;version=\"2.4.0.SNAPSHOT\"");
        properties.setProperty("org.osgi.framework.system.capabilities.extra",
                        "osgi.service;effective:=active;objectClass=org.osgi.service.packageadmin.PackageAdmin," +
                        "osgi.service;effective:=active;objectClass=org.osgi.service.startlevel.StartLevel," +
                        "osgi.service;effective:=active;objectClass=org.osgi.service.url.URLHandlers");
        Framework felix = new Felix(properties);
        Collection<Resource> resources = builder.resolve(felix.adapt(BundleRevision.class), false);

        for (Resource resource : resources) {
            System.out.println("Resource: " + getUri(resource));
        }
View Full Code Here

        try {
            properties.put("feature.totest", feature);

            boolean resolveOptionalImports = getResolveOptionalImports(properties);

            DeploymentBuilder builder = new DeploymentBuilder(
                    manager,
                    null,
                    repositories.values(),
                    -1 // Disable url handlers
            );
            Map<String, Resource> downloadedResources = builder.download(
                    getPrefixedProperties(properties, "feature."),
                    getPrefixedProperties(properties, "bundle."),
                    getPrefixedProperties(properties, "fab."),
                    getPrefixedProperties(properties, "req."),
                    getPrefixedProperties(properties, "override."),
                    getPrefixedProperties(properties, "optional."),
                    getMetadata(properties, "metadata#"), null
            );

            for (String uri : getPrefixedProperties(properties, "resources.")) {
                builder.addResourceRepository(new MetadataRepository(new HttpMetadataProvider(uri)));
            }

            Resource systemBundle = getSystemBundleResource(getMetadata(properties, "metadata#"));

            try {
                Collection<Resource> resources = builder.resolve(systemBundle, resolveOptionalImports);
                // TODO: find unused resources ?
            } catch (Exception e) {
                throw new MojoExecutionException("Feature resolution failed for " + feature
                        + "\nMessage: " + e.getMessage() + (e.getCause() != null ? "\n" + e.getCause().getMessage() : "")
                        + "\nRepositories: " + toString(new TreeSet<>(repositories.keySet()))
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

      public void run() {
        ContainersNode containersNode = fabric.getContainersNode();
        if (containersNode != null) {
          List<Container> selectedContainers = getSelectedContainers();
          if (!selectedContainers.isEmpty()) {
            Container container = selectedContainers.get(0);
            ContainerNode containerNode = containersNode.getContainerNode(container.getId());
            if (containerNode != null) {
              Selections.setSingleSelection(
                  fabric.getRefreshableUI(), containerNode);
            }
          }
View Full Code Here

    IStructuredSelection selection = getSelection();
    if (selection != null) {
      boolean changed = false;
      Iterator iterator = selection.iterator();
      while (iterator.hasNext()) {
        Container container = ContainerNode.toContainer(iterator.next());
        if (container != null) {
          containers.add(container);
        }
      }
    }
View Full Code Here

TOP

Related Classes of io.fabric8.agent.DeploymentBuilder

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.