Package org.jboss.forge.furnace.addons

Examples of org.jboss.forge.furnace.addons.AddonId


      AddonRepository right = furnace.addRepository(AddonRepositoryMode.MUTABLE, repodir2);

      AddonDependencyResolver resolver = new MavenAddonDependencyResolver();
      AddonManager manager = new AddonManagerImpl(furnace, resolver);

      AddonId no_dep = AddonId.from("test:no_dep", "1.0.0.Final");
      AddonId one_dep = AddonId.from("test:one_dep", "1.0.0.Final");
      AddonId one_dep_a = AddonId.from("test:one_dep_a", "1.0.0.Final");

      Assert.assertFalse(left.isDeployed(one_dep_a));
      Assert.assertFalse(left.isDeployed(no_dep));
      Assert.assertFalse(left.isDeployed(one_dep));
      Assert.assertFalse(right.isDeployed(one_dep_a));
View Full Code Here


   private static final Map<AddonId, Set<Method>> annotationMethods = new ConcurrentHashMap<>();

   public <T> void observeAnnotationMethods(@Observes ProcessAnnotatedType<T> bean, final BeanManager beanManager)
   {
      AnnotatedType<T> annotatedType = bean.getAnnotatedType();
      AddonId addonId = AddonId.fromCoordinates(Thread.currentThread().getName());
      for (AnnotatedMethod<? super T> annotatedMethod : annotatedType.getMethods())
      {
         if (annotatedMethod.isAnnotationPresent(Command.class))
         {
            Set<Method> set = annotationMethods.get(addonId);
View Full Code Here

   private AddonActionRequest createRequest(final AddonInfo requestedAddonInfo, final AddonInfo addonInfo,
            final MutableAddonRepository repository,
            final Map<AddonId, AddonRepository> installedAddons)
   {
      final AddonActionRequest request;
      AddonId addon = addonInfo.getAddon();
      if (installedAddons.containsKey(addon))
      {
         // Already contains the installed addon. Update ONLY if the version is SNAPSHOT and if it is the requested
         // addon
         if (Versions.isSnapshot(addonInfo.getAddon().getVersion()) && addonInfo.equals(requestedAddonInfo))
         {
            AddonRepository addonRepository = installedAddons.get(addon);
            if (repository.equals(addonRepository))
            {
               request = createUpdateRequest(addonInfo, addonInfo, repository, furnace);
            }
            else
            {
               request = createDeployRequest(addonInfo, repository, furnace);
            }
         }
         else
         {
            request = null;
         }
      }
      else
      {
         Entry<AddonId, AddonRepository> differentVersionEntry = null;
         for (Entry<AddonId, AddonRepository> addonEntry : installedAddons.entrySet())
         {
            AddonId addonId = addonEntry.getKey();
            if (addonId.getName().equals(addon.getName()))
            {
               differentVersionEntry = addonEntry;
               break;
            }
         }
View Full Code Here

      catch (BuildException e)
      {
         return Results.fail("Unable to execute project build", e);
      }
      progressMonitor.worked(1);
      AddonId id = null;
      try
      {
         if (coordinate.hasValue())
         {
            try
View Full Code Here

      AddonManager addonManager = new AddonManagerImpl(forge, new MavenDependencyResolver(
               new FileResourceFactory(), new MavenContainer()));

      for (String addonId : addonIds)
      {
         AddonId id = AddonId.fromCoordinates(addonId);
         addonManager.install(id).perform();
      }
   }
View Full Code Here

   @Override
   public ProtocolMetaData deploy(final Archive<?> archive) throws DeploymentException
   {

      Deployment deployment = deploymentInstance.get();
      final AddonId addonToDeploy = getAddonEntry(deployment);

      if (undeploying)
      {
         undeploying = false;
         cleanup();
View Full Code Here

   private AddonId getAddonEntry(Deployment deployment)
   {
      if (!deployedAddons.containsKey(deployment))
      {
         String[] coordinates = deployment.getDescription().getName().split(",");
         AddonId entry;
         if (coordinates.length == 3)
            entry = AddonId.from(coordinates[0], coordinates[1], coordinates[2]);
         else if (coordinates.length == 2)
            entry = AddonId.from(coordinates[0], coordinates[1]);
         else if (coordinates.length == 1)
View Full Code Here

   @Override
   public void undeploy(Archive<?> archive) throws DeploymentException
   {
      undeploying = true;
      AddonId addonToUndeploy = getAddonEntry(deploymentInstance.get());
      AddonRegistry registry = runnable.getForge().getAddonRegistry();
      System.out.println("Undeploying [" + addonToUndeploy + "] ... ");

      try
      {
View Full Code Here

   @Test
   public void testServiceWithExpectedObjectsDifferentClassLoaders() throws Exception
   {
      AddonRegistry addonRegistry = SimpleContainer.getFurnace(this.getClass().getClassLoader()).getAddonRegistry();

      AddonId depOneId = AddonId.from("test:dep1", "1");
      AddonId depTwoId = AddonId.from("test:dep2", "2");

      Addon depOne = addonRegistry.getAddon(depOneId);
      Addon depTwo = addonRegistry.getAddon(depTwoId);

      ServiceRegistry depOneServiceRegistry = depOne.getServiceRegistry();
View Full Code Here

   @Test
   public void testServiceWithExpectedObjectsDifferentClassLoaders() throws Exception
   {
      AddonRegistry addonRegistry = SimpleContainer.getFurnace(this.getClass().getClassLoader()).getAddonRegistry();

      AddonId depOneId = AddonId.from("test:dep1", "1");
      AddonId depTwoId = AddonId.from("test:dep2", "2");

      Addon depOne = addonRegistry.getAddon(depOneId);
      Addon depTwo = addonRegistry.getAddon(depTwoId);

      ServiceRegistry depOneServiceRegistry = depOne.getServiceRegistry();
View Full Code Here

TOP

Related Classes of org.jboss.forge.furnace.addons.AddonId

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.