Package org.jboss.deployers.spi.attachments

Examples of org.jboss.deployers.spi.attachments.MutableAttachments


      AbstractBeanMetaData md1 = new AbstractBeanMetaData("PUD", PUDeployment.class.getName());
      AbstractConstructorMetaData acmd = new AbstractConstructorMetaData();
      acmd.setValueObject(bean);
      md1.setConstructor(acmd);
      deployment.setBeanFactories(Arrays.asList((BeanMetaDataFactory)md1));
      MutableAttachments attachments = (MutableAttachments) context.getPredeterminedManagedObjects();
      attachments.addAttachment("KernelDeployerTest4", deployment);

      assertDeploy(context);
      try
      {
         ControllerContext pud = controller.getContext("PUD", null);
View Full Code Here


   }

   public void testCustomBeanMetaData() throws Throwable
   {
      Deployment context = createSimpleDeployment(getClass().getName());
      MutableAttachments attachments = (MutableAttachments)context.getPredeterminedManagedObjects();
      attachments.addAttachment(CustomBMDF.class, new CustomBMDF("Test"));

      assertDeploy(context);

      ControllerContext testCC = controller.getInstalledContext("Test");
      assertNotNull(testCC);
View Full Code Here

      TestRealDeployer1 realDeployer1 = new TestRealDeployer1();
      TestRealDeployer2 realDeployer2 = new TestRealDeployer2();
      DeployerClient main = createMainDeployer(componentDeployer1, componentDeployer2, realDeployer1, realDeployer2);
     
      Deployment deployment = createSimpleDeployment("deploy");
      MutableAttachments attachments = (MutableAttachments) deployment.getPredeterminedManagedObjects();

      TestDeployment1 deployment1 = new TestDeployment1();
      TestMetaData1 component1 = new TestMetaData1("TestBean1");
      deployment1.addBean(component1);
      attachments.addAttachment(TestDeployment1.class, deployment1);

      TestDeployment2 deployment2 = new TestDeployment2();
      TestMetaData2 component2 = new TestMetaData2("TestBean2");
      deployment2.addBean(component2);
      attachments.addAttachment(TestDeployment2.class, deployment2);

      main.addDeployment(deployment);
      main.process();

      assertEquals(Collections.singletonList(component1), realDeployer1.deployed);
View Full Code Here

      }
   }
  
   protected static void addMetaData(PredeterminedManagedObjectAttachments attachments, TestComponentMetaDataContainer md)
   {
      MutableAttachments mutable = (MutableAttachments) attachments.getPredeterminedManagedObjects();
      mutable.addAttachment(TestComponentMetaDataContainer.class, md);
   }
View Full Code Here

     
      // Add the deployment attachments as PredeterminedManagedObjects
      Map<String, Object> attachments = deployment.getAttachments();
      if(attachments != null && attachments.isEmpty() == false)
      {
         MutableAttachments predetermined = AttachmentsFactory.createMutableAttachments();
         for(String name : attachments.keySet())
            predetermined.addAttachment(name, attachments.get(name));
         mcDeployment.setPredeterminedManagedObjects(predetermined);
      }
      return mcDeployment;
   }
View Full Code Here

            parentContext = StructureMetaDataFactory.createContextInfo(relativePath, recognised.getClassPath());
         else
            parentContext = StructureMetaDataFactory.createContextInfo(relativePath, metaDataPath, recognised.getClassPath());
        
         structureMetaData.addContext(parentContext);
         MutableAttachments attachments = (MutableAttachments) parentContext.getPredeterminedManagedObjects();
         attachments.addAttachment(StructureMetaData.class, structure);
      }
      return result;
   }
View Full Code Here

   protected static StructureMetaData assureStructure(PredeterminedManagedObjectAttachments context)
   {
      if (context == null)
         throw new IllegalArgumentException("Null context");

      MutableAttachments mutable;
     
      Attachments attachments = context.getPredeterminedManagedObjects();

      // Nothing predetermined yet
      if (attachments == null)
      {
         mutable = AttachmentsFactory.createMutableAttachments();
         context.setPredeterminedManagedObjects(mutable);
      }
      // Some predetermined but needs to be made mutable
      else if (attachments instanceof MutableAttachments == false)
      {
         mutable = AttachmentsFactory.createMutableAttachments();
         Map<String, Object> map = attachments.getAttachments();
         if (map != null)
            mutable.setAttachments(map);
         context.setPredeterminedManagedObjects(mutable);
      }
      else
      {
         mutable = (MutableAttachments) attachments;
      }
     
      StructureMetaData structure = mutable.getAttachment(StructureMetaData.class);
      // No previous structure
      if (structure == null)
      {
         structure = StructureMetaDataFactory.createStructureMetaData();
         mutable.addAttachment(StructureMetaData.class, structure);
      }
      return structure;
   }
View Full Code Here

            parentContext = StructureMetaDataFactory.createContextInfo(relativePath, metaDataPath, recognised.getClassPath());

         // copy the modification type information
         parentContext.setModificationType(recognised.getModificationType());
         structureMetaData.addContext(parentContext);
         MutableAttachments attachments = (MutableAttachments) parentContext.getPredeterminedManagedObjects();
         attachments.addAttachment(StructureMetaData.class, structure);
      }
      return result;
   }
View Full Code Here

         // copy the modification type information
         parentContextInfo.setModificationType(recognised.getModificationType());
         StructureMetaData structureMetaData = parentContext.getMetaData();
         structureMetaData.addContext(parentContextInfo);
         MutableAttachments attachments = (MutableAttachments) parentContextInfo.getPredeterminedManagedObjects();
         attachments.addAttachment(StructureMetaData.class, structure);
      }
      return result;
   }
View Full Code Here

/* 154 */         parentContext = StructureMetaDataFactory.createContextInfo(relativePath, recognised.getClassPath());
/*     */       else {
/* 156 */         parentContext = StructureMetaDataFactory.createContextInfo(relativePath, metaDataPath, recognised.getClassPath());
/*     */       }
/* 158 */       structureMetaData.addContext(parentContext);
/* 159 */       MutableAttachments attachments = (MutableAttachments)parentContext.getPredeterminedManagedObjects();
/* 160 */       attachments.addAttachment(StructureMetaData.class, structure);
/*     */     }
/* 162 */     return result;
/*     */   }
View Full Code Here

TOP

Related Classes of org.jboss.deployers.spi.attachments.MutableAttachments

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.