Package org.jboss.deployers.spi.attachments

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


   }
  
   protected StructureMetaData assertStructureMetaData(PredeterminedManagedObjectAttachments attachments)
   {
      assertNotNull(attachments);
      Attachments x = attachments.getPredeterminedManagedObjects();
      assertNotNull(x);
      StructureMetaData structure = x.getAttachment(StructureMetaData.class);
      assertNotNull(structure);
      return structure;
   }
View Full Code Here


      return result;
   }
  
   public void testGetAttachmentErrors() throws Exception
   {
      Attachments attachments = getAttachments();
     
      try
      {
         attachments.getAttachment((String) null);
         fail("Should not be here!");
      }
      catch (Throwable t)
      {
         checkThrowable(IllegalArgumentException.class, t);
      }
     
      try
      {
         attachments.getAttachment(null, String.class);
         fail("Should not be here!");
      }
      catch (Throwable t)
      {
         checkThrowable(IllegalArgumentException.class, t);
      }
     
      try
      {
         attachments.getAttachment("name", null);
         fail("Should not be here!");
      }
      catch (Throwable t)
      {
         checkThrowable(IllegalArgumentException.class, t);
      }
     
      try
      {
         attachments.getAttachment((Class<String>) null);
         fail("Should not be here!");
      }
      catch (Throwable t)
      {
         checkThrowable(IllegalArgumentException.class, t);
View Full Code Here

      }
   }
  
   public void testIsAttachmentPresentErrors() throws Exception
   {
      Attachments attachments = getAttachments();
     
      try
      {
         attachments.isAttachmentPresent((String) null);
         fail("Should not be here!");
      }
      catch (Throwable t)
      {
         checkThrowable(IllegalArgumentException.class, t);
      }
     
      try
      {
         attachments.isAttachmentPresent(null, String.class);
         fail("Should not be here!");
      }
      catch (Throwable t)
      {
         checkThrowable(IllegalArgumentException.class, t);
      }
     
      try
      {
         attachments.isAttachmentPresent("name", null);
         fail("Should not be here!");
      }
      catch (Throwable t)
      {
         checkThrowable(IllegalArgumentException.class, t);
      }
     
      try
      {
         attachments.isAttachmentPresent((Class<String>) null);
         fail("Should not be here!");
      }
      catch (Throwable t)
      {
         checkThrowable(IllegalArgumentException.class, t);
View Full Code Here

      }
   }
  
   public void testSerialization() throws Exception
   {
      Attachments attachments = getAttachments();
      serializeDeserialize(attachments, Attachments.class);

      MutableAttachments mutable = getMutable();
      serializeDeserialize(mutable, MutableAttachments.class);
     
View Full Code Here

      DeployerClient main = getMainDeployer();

      Deployment parent = createSimpleDeployment("Parent");

      ContextInfo ci1 = factory.addContext(parent, "C1");
      Attachments attachments1 = ci1.getPredeterminedManagedObjects();
      MutableAttachments ma1 = (MutableAttachments) attachments1;
      ma1.addAttachment("1.1", "1", String.class);
      ma1.addAttachment("1.2", "2", String.class);

      ContextInfo ci2 = factory.addContext(parent, "C2");
      Attachments attachments2 = ci2.getPredeterminedManagedObjects();
      MutableAttachments ma2 = (MutableAttachments) attachments2;
      ma2.addAttachment("2.1", "3", String.class);
      ma2.addAttachment("2.2", "4", String.class);

      main.addDeployment(parent);
View Full Code Here

      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
View Full Code Here

      if (builder == null)
         throw new IllegalStateException("No structure builder has been configured");
     
      Throwable problem = null;

      Attachments attachments = deployment.getPredeterminedManagedObjects();
      StructureMetaData structureMetaData = attachments.getAttachment(StructureMetaData.class);
      if (structureMetaData == null)
      {
         structureMetaData = StructureMetaDataFactory.createStructureMetaData();
         try
         {
View Full Code Here

/*    */   {
/* 66 */     StructureBuilder builder = getStructureBuilder();
/* 67 */     if (builder == null) {
/* 68 */       throw new IllegalStateException("No structure builder has been configured");
/*    */     }
/* 70 */     Attachments attachments = deployment.getPredeterminedManagedObjects();
/* 71 */     StructureMetaData structureMetaData = (StructureMetaData)attachments.getAttachment(StructureMetaData.class);
/* 72 */     if (structureMetaData == null)
/*    */     {
/* 74 */       structureMetaData = StructureMetaDataFactory.createStructureMetaData();
/*    */       try
/*    */       {
View Full Code Here

/* 127 */           context.addChild(childContext);
/* 128 */           childContext.setParent(context);
/*     */
/* 130 */           applyContextInfo(childContext, child);
/*     */
/* 132 */           Attachments attachments = child.getPredeterminedManagedObjects();
/* 133 */           if (attachments != null)
/*     */           {
/* 135 */             StructureMetaData childStructure = (StructureMetaData)attachments.getAttachment(StructureMetaData.class);
/* 136 */             if (childStructure != null)
/* 137 */               populateContext(childContext, childStructure);
/*     */           }
/*     */         }
/*     */       }
View Full Code Here

/*     */   }
/*     */
/*     */   protected void applyContextInfo(DeploymentContext context, ContextInfo contextInfo)
/*     */     throws Exception
/*     */   {
/* 158 */     Attachments attachments = contextInfo.getPredeterminedManagedObjects();
/* 159 */     if (attachments != null) {
/* 160 */       context.setPredeterminedManagedObjects(attachments);
/*     */     }
/* 162 */     context.setRelativeOrder(contextInfo.getRelativeOrder());
/* 163 */     applyComparator(context, contextInfo);
View Full Code Here

TOP

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

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.