Package org.jboss.deployers.plugins.main

Examples of org.jboss.deployers.plugins.main.MainDeployerImpl


      assertEmpty(map.keySet());
   }

   protected DeployerClient getMainDeployer()
   {
      MainDeployerImpl main = new MainDeployerImpl();
      main.setStructuralDeployers(createStructuralDeployers());
      AbstractController controller = new AbstractController();
      DeployersImpl deployers = new DeployersImpl(controller);
      deployers.setMgtObjectCreator(new DefaultManagedObjectCreator());
      deployers.addDeployer(new TestAttachmentsDeployer());
      deployers.addDeployer(new OrderedTestAttachmentDeployer(controller));
      main.setDeployers(deployers);
      return main;
   }
View Full Code Here


   }

   public void testStructureFailure() throws Exception
   {
      DeployerClient main = getMainDeployer();
      MainDeployerImpl mainImpl = (MainDeployerImpl)main;
      StructuralDeployers sd = new StructuralDeployers()
      {
         public DeploymentContext determineStructure(Deployment deployment) throws DeploymentException
         {
            throw new DeploymentException("No such structure deployers.");
         }
      };
      mainImpl.setStructuralDeployers(sd);
      Deployment deployment = createSimpleDeployment("failure");
      makeFail(deployment, deployer);
      try
      {
         main.addDeployment(deployment);
View Full Code Here

      }
   }

   protected DeployerClient getDependencyMainDeployer()
   {
      MainDeployerImpl main = new MainDeployerImpl();
      main.setStructuralDeployers(createStructuralDeployers());
      AbstractController controller = new AbstractController();
      DeployersImpl deployers = new DeployersImpl(controller);
      deployers.setMgtObjectCreator(new DefaultManagedObjectCreator());
      deployers.addDeployer(new DependencyDeployer(controller));
      main.setDeployers(deployers);
      return main;
   }
View Full Code Here

      return main;
   }

   protected DeployerClient getComponentMainDeployer()
   {
      MainDeployerImpl main = new MainDeployerImpl();
      main.setStructuralDeployers(createStructuralDeployers());
      AbstractController controller = new AbstractController();
      DeployersImpl deployers = new DeployersImpl(controller);
      deployers.setMgtObjectCreator(new DefaultManagedObjectCreator());
      deployers.addDeployer(new TestAttachmentsDeployer());
      deployers.addDeployer(new TestAttachmentDeployer(controller));
      main.setDeployers(deployers);
      return main;
   }
View Full Code Here

   public void testAliasRemove() throws Exception
   {
      DeployerClient mainDeployer = getMainDeployer();
      // change structure builder
      MainDeployerImpl mdi = assertInstanceOf(mainDeployer, MainDeployerImpl.class);
      AbstractStructuralDeployers ads = assertInstanceOf(mdi.getStructuralDeployers(), AbstractStructuralDeployers.class);
      ads.setStructureBuilder(new RenamingStructureBuilder());

      Version v1 = Version.parseVersion("1");
      Deployment ad = createSimpleDeployment("A");
      addClassLoadingMetaData(ad, ad.getName(), v1, true, A.class);
View Full Code Here

      enableTrace("org.jboss.deployers");
   }

   public void testBshNonMetadataDeploy() throws Throwable
   {
      MainDeployerImpl main = new MainDeployerImpl();
      main.setStructuralDeployers(createStructuralDeployers());
      addStructureDeployer(main, new JARStructure());
      MockBshDeployer bshDeployer = new MockBshDeployer();
      FileStructure fileStructure = new FileStructure();
      fileStructure.addFileMatcher(bshDeployer);
      addStructureDeployer(main, fileStructure);
      DeployersImpl deployers = new DeployersImpl(new AbstractController());
      deployers.setMgtObjectCreator(new DefaultManagedObjectCreator());
      deployers.addDeployer(bshDeployer);
      main.setDeployers(deployers);
      VFSDeployment deployment = createDeployment("/nonmetadata", "nmd.jar");
      main.deploy(deployment);
      assertNotNull(bshDeployer.getScipts());
      assertEquals(1, bshDeployer.getScipts().size());
      BshScript script = bshDeployer.getScipts().iterator().next();
      assertNotNull(script);
      assertNotNull(script.getProperties());
View Full Code Here

      return matcher;
   }

   protected VFSDeploymentContext getTopDeploymentContext(DeployerClient main, String name)
   {
      MainDeployerImpl mdi = (MainDeployerImpl)main;
      Collection<DeploymentContext> all = mdi.getAll();
      for (DeploymentContext dc : all)
      {
         if (dc.getSimpleName().equals(name))
            return VFSDeploymentContext.class.cast(dc);
      }
View Full Code Here

   public void testMatchers() throws Throwable
   {
      KernelController controller = getController();

      MainDeployerImpl main = new MainDeployerImpl();
      main.setStructuralDeployers(createStructuralDeployers());

      BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("JARStructure", JARStructure.class.getName());
      controller.install(builder.getBeanMetaData());
      builder = BeanMetaDataBuilder.createBuilder("FileStructure", ExposedFileStructure.class.getName());
      controller.install(builder.getBeanMetaData());

      ControllerContext jarContext = controller.getInstalledContext("JARStructure");
      assertNotNull(jarContext);
      JARStructure jarStructure = (JARStructure)jarContext.getTarget();
      assertNotNull(jarStructure);
      addStructureDeployer(main, jarStructure);

      ControllerContext fileContext = controller.getInstalledContext("FileStructure");
      assertNotNull(fileContext);
      ExposedFileStructure fileStructure = (ExposedFileStructure)fileContext.getTarget();
      assertNotNull(fileStructure);
      addStructureDeployer(main, fileStructure);

      Set<FileMatcher> matchers = fileStructure.getMatchers();
      assertNotNull(matchers);
      assertEmpty(matchers);

      builder = BeanMetaDataBuilder.createBuilder("BeanDeployer", TestBeanDeployer.class.getName());
      controller.install(builder.getBeanMetaData());
      assertEquals(1, matchers.size());

      builder = BeanMetaDataBuilder.createBuilder("BshDeployer", TestBshDeployer.class.getName());
      controller.install(builder.getBeanMetaData());
      assertEquals(2, matchers.size());

      builder = BeanMetaDataBuilder.createBuilder("ExactNameDeployer", TestNameDeployer.class.getName());
      builder.addConstructorParameter(String.class.getName(), "some.bsh");
      controller.install(builder.getBeanMetaData());
      assertEquals(3, matchers.size());

      Deployers deployers = createDeployers();
      main.setDeployers(deployers);

      FeedbackDeployer beanDeployer = addDeployer(main, "BeanDeployer");
      FeedbackDeployer shellDeployer = addDeployer(main, "BshDeployer");
      FeedbackDeployer nameDeployer = addDeployer(main, "ExactNameDeployer");
View Full Code Here

/* 216 */     deployer.checkComplete();
/*     */
/* 218 */     Thread thread = Thread.currentThread();
/* 219 */     ClassLoader old = thread.getContextClassLoader();
/*     */
/* 221 */     MainDeployerImpl hack = (MainDeployerImpl)deployer;
/* 222 */     ClassLoader cl = null;
/* 223 */     if (first != null)
/*     */     {
/* 225 */       DeploymentContext ctx = hack.getDeploymentContext(first.getName());
/* 226 */       if (ctx != null)
/* 227 */         cl = ctx.getClassLoader();
/*     */     }
/* 229 */     if (cl != null) {
/* 230 */       thread.setContextClassLoader(cl);
View Full Code Here

TOP

Related Classes of org.jboss.deployers.plugins.main.MainDeployerImpl

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.