Package org.hornetq.core.deployers.impl

Examples of org.hornetq.core.deployers.impl.FileDeploymentManager


      }
   }

   public void testUndeployAndDeployAgain() throws Exception
   {
      FileDeploymentManager fdm = new FileDeploymentManager(Long.MAX_VALUE);

      fdm.start();

      String filename = "fdm_test_file.xml1";

      File file = new File("tests/tmpfiles/" + filename);

      file.createNewFile();

      FakeDeployer deployer = new FakeDeployer(filename);
      try
      {
         URL url = file.toURI().toURL();
         deployer.deploy(url);

         fdm.registerDeployer(deployer);

         Assert.assertEquals(1, fdm.getDeployers().size());
         Assert.assertTrue(fdm.getDeployers().contains(deployer));
         Assert.assertEquals(1, fdm.getDeployed().size());
         Assert.assertEquals(file.toURI().toURL(), deployer.deployedUrl);
         deployer.deployedUrl = null;
         file.delete();

         // This should cause undeployment

         deployer.undeploy(url);
         Assert.assertEquals(file.toURI().toURL(), deployer.unDeployedUrl);

         fdm.run();

         Assert.assertEquals(1, fdm.getDeployers().size());
         Assert.assertTrue(fdm.getDeployers().contains(deployer));
         Assert.assertEquals(0, fdm.getDeployed().size());

         // Recreate file and it should be redeployed

         file.createNewFile();

         deployer.deploy(url);

         fdm.run();

         Assert.assertEquals(1, fdm.getDeployers().size());
         Assert.assertTrue(fdm.getDeployers().contains(deployer));
         Assert.assertEquals(1, fdm.getDeployed().size());

         Assert.assertEquals(file.toURI().toURL(), deployer.deployedUrl);
      }
      finally
      {
View Full Code Here


      {
         context = new InitialContext();
         registry = new JndiBindingRegistry(context);
      }

      deploymentManager = new FileDeploymentManager(server.getConfiguration().getFileDeployerScanPeriod());

      server.registerActivateCallback(this);

      server.start();
View Full Code Here

      // Create the hard-wired components

      if (configuration.isFileDeploymentEnabled())
      {
         deploymentManager = new FileDeploymentManager(configuration.getFileDeployerScanPeriod());
      }

      callPreActiveCallbacks();

      // startReplication();
View Full Code Here

      // Create the hard-wired components

      if (configuration.isFileDeploymentEnabled())
      {
         deploymentManager = new FileDeploymentManager(configuration.getFileDeployerScanPeriod());
      }

      callPreActiveCallbacks();

      // startReplication();
View Full Code Here

      {
         context = new InitialContext();
         registry = new JndiComponentRegistry(context);
      }

      deploymentManager = new FileDeploymentManager(server.getConfiguration().getFileDeployerScanPeriod());

      server.registerActivateCallback(this);

      server.start();
View Full Code Here

                                                                        "243.7.7.7", 12345,
                                                                        5432, 5432);
      config.getDiscoveryGroupConfigurations().put("mygroup", dcg);
      HornetQServer server = createServer(false, config);

      deploymentManager = new FileDeploymentManager(config.getFileDeployerScanPeriod());

      jmsServer = new JMSServerManagerImpl(server);
      context = new InVMContext();
      jmsServer.setContext(context);
      jmsServer.start();
View Full Code Here

   protected void setUp() throws Exception
   {
      super.setUp();
     
      server = createServer(true);
      DeploymentManager deploymentManager = new FileDeploymentManager(500);
      deployer = new QueueDeployer(deploymentManager, server);
      server.start();
   }
View Full Code Here

         }
      }

      started = true;

      deploymentManager = new FileDeploymentManager(server.getConfiguration().getFileDeployerScanPeriod());

      server.registerActivateCallback(this);

      server.start();
View Full Code Here

      // Create the hard-wired components

      if (configuration.isFileDeploymentEnabled())
      {
         deploymentManager = new FileDeploymentManager(configuration.getFileDeployerScanPeriod());
      }

      callPreActiveCallbacks();

      // startReplication();
View Full Code Here

      }
   }

   private void testStartStop1(final String filename) throws Exception
   {
      FileDeploymentManager fdm = new FileDeploymentManager(Long.MAX_VALUE);

      FileDeploymentManagerTest.log.debug("Filename is " + filename);

      File file = new File("tests/tmpfiles/" + filename);

      FileDeploymentManagerTest.log.debug(file.getAbsoluteFile());

      System.out.println("========file name: " + file.getAbsolutePath());
     
      file.createNewFile();

      FakeDeployer deployer = new FakeDeployer(filename);

      fdm.registerDeployer(deployer);

      fdm.unregisterDeployer(deployer);

      fdm.registerDeployer(deployer);

      fdm.start();
      try
      {
         URL expected = file.toURI().toURL();
         URL deployedUrl = deployer.deployedUrl;
         Assert.assertTrue(expected.toString().equalsIgnoreCase(deployedUrl.toString()));
         deployer.deployedUrl = null;
         fdm.start();
         Assert.assertNull(deployer.deployedUrl);
         fdm.stop();

      }
      finally
      {
         file.delete();
View Full Code Here

TOP

Related Classes of org.hornetq.core.deployers.impl.FileDeploymentManager

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.