Examples of AssembledDirectory


Examples of org.jboss.virtual.AssembledDirectory

      assertTrue(checker.hasStructureBeenModified(root));
   }

   public void testInitialEmptyDir() throws Exception
   {
      AssembledDirectory top = createAssembledDirectory("top.jar", "top.jar");
      AssembledDirectory metainf = top.mkdir("META-INF");
      StructureModificationChecker checker = createStructureModificationChecker();

      VFSDeploymentUnit vdu = assertDeploy(top);
      try
      {
         VirtualFile root = vdu.getRoot();
         assertFalse(checker.hasStructureBeenModified(root));

         URL url = getResource("/scanning/smoke/META-INF/jboss-scanning.xml");
         assertNotNull(url);
         metainf.addChild(VFS.createNewRoot(url));
         assertTrue(checker.hasStructureBeenModified(root));
      }
      finally
      {
         undeploy(vdu);
View Full Code Here

Examples of org.jboss.virtual.AssembledDirectory

      }
   }

   public void testMultipleChanges() throws Exception
   {
      AssembledDirectory top = createAssembledDirectory("top.jar", "top.jar");
      AssembledDirectory metainf = top.mkdir("META-INF");
      StructureModificationChecker checker = createStructureModificationChecker();

      VFSDeploymentUnit vdu = assertDeploy(top);
      try
      {
         VirtualFile root = vdu.getRoot();
         assertFalse(checker.hasStructureBeenModified(root));

         URL url1 = getResource("/scanning/smoke/META-INF/jboss-scanning.xml");
         assertNotNull(url1);
         metainf.addChild(VFS.createNewRoot(url1));
         URL url2 = getResource("/dependency/module/META-INF/jboss-dependency.xml");
         assertNotNull(url2);
         metainf.addChild(VFS.createNewRoot(url2));

         assertTrue(checker.hasStructureBeenModified(root));
         assertFalse(checker.hasStructureBeenModified(root));

         File f1 = new File(url1.toURI());
View Full Code Here

Examples of org.jboss.virtual.AssembledDirectory

   @Override
   public AssembledDirectory getVirtualFile()
   {
      checkClosed();
      increment();
      return new AssembledDirectory(this);
   }
View Full Code Here

Examples of org.jboss.virtual.plugins.context.vfs.AssembledDirectory

*/
public class VirtualArchiveDeploy2 extends Main
{
   public static void main(String[] args) throws Exception
   {
      AssembledDirectory jar = AssembledContextFactory.getInstance().create("tutorial.jar");
      String[] includes = {"**/beans/*.class"};
      jar.addResources(Customer.class, includes, null);
      // Get tutorial-persistence.xml from classloader and alias it within the archive.
      jar.mkdir("META-INF").addResource("tutorial-persistence.xml", "persistence.xml");

      Bootstrap.getInstance().bootstrap();
      Bootstrap.getInstance().deploy(jar);

      run();
View Full Code Here

Examples of org.jboss.virtual.plugins.context.vfs.AssembledDirectory

*/
public class VirtualArchiveDeploy extends Main
{
   public static void main(String[] args) throws Exception
   {
      AssembledDirectory jar = AssembledContextFactory.getInstance().create("tutorial.jar");
      jar.addClass(Customer.class);
      jar.addClass(CustomerDAOBean.class);
      jar.addClass(CustomerDAOLocal.class);
      jar.addClass(CustomerDAORemote.class);
      // Get tutorial-persistence.xml from classloader and alias it within the archive.
      jar.mkdir("META-INF").addResource("tutorial-persistence.xml", "persistence.xml");

      Bootstrap.getInstance().bootstrap();
      Bootstrap.getInstance().deploy(jar);

      run();
View Full Code Here

Examples of org.jboss.virtual.plugins.context.vfs.AssembledDirectory

public class Handler extends URLStreamHandler
{
   protected URLConnection openConnection(URL u) throws IOException
   {
      String host = u.getHost();
      AssembledDirectory directory = AssembledContextFactory.getInstance().find(host);
      if (directory == null)
         throw new IOException("vfs does not exist: " + u.toString());

      VirtualFile vf = directory.findChild(u.getPath());
      if (vf == null)
         throw new IOException("vfs does not exist: " + u.toString());

      return new VirtualFileURLConnection(u, vf);
   }
View Full Code Here

Examples of org.jboss.virtual.plugins.context.vfs.AssembledDirectory

public class Handler extends URLStreamHandler
{
   protected URLConnection openConnection(URL u) throws IOException
   {
      String host = u.getHost();
      AssembledDirectory directory = AssembledContextFactory.getInstance().find(host);
      if (directory == null) throw new IOException("vfs does not exist: " + u.toString());
      VirtualFile vf = directory.findChild(u.getPath());
      if (vf == null) throw new IOException("vfs does not exist: " + u.toString());
      return new VirtualFileURLConnection(u, vf);
   }
View Full Code Here

Examples of org.jboss.virtual.plugins.context.vfs.AssembledDirectory

/*    */ {
/*    */   protected URLConnection openConnection(URL u)
/*    */     throws IOException
/*    */   {
/* 44 */     String host = u.getHost();
/* 45 */     AssembledDirectory directory = AssembledContextFactory.getInstance().find(host);
/* 46 */     if (directory == null) {
/* 47 */       throw new IOException("vfs does not exist: " + u.toString());
/*    */     }
/* 49 */     VirtualFile vf = directory.findChild(u.getPath());
/* 50 */     if (vf == null) {
/* 51 */       throw new IOException("vfs does not exist: " + u.toString());
/*    */     }
/* 53 */     return new VirtualFileURLConnection(u, vf);
/*    */   }
View Full Code Here

Examples of org.jboss.virtual.plugins.context.vfs.AssembledDirectory

*/
public class VirtualArchiveDeploy2 extends Main
{
   public static void main(String[] args) throws Exception
   {
      AssembledDirectory jar = AssembledContextFactory.getInstance().create("tutorial.jar");
      String[] includes = {"**/beans/*.class"};
      jar.addResources(Customer.class, includes, null);
      // Get tutorial-persistence.xml from classloader and alias it within the archive.
      jar.mkdir("META-INF").addResource("tutorial-persistence.xml", "persistence.xml");

      Bootstrap.getInstance().bootstrap();
      Bootstrap.getInstance().deploy(jar);

      run();
View Full Code Here

Examples of org.jboss.virtual.plugins.context.vfs.AssembledDirectory

*/
public class VirtualArchiveDeploy extends Main
{
   public static void main(String[] args) throws Exception
   {
      AssembledDirectory jar = AssembledContextFactory.getInstance().create("tutorial.jar");
      jar.addClass(Customer.class);
      jar.addClass(CustomerDAOBean.class);
      jar.addClass(CustomerDAOLocal.class);
      jar.addClass(CustomerDAORemote.class);
      // Get tutorial-persistence.xml from classloader and alias it within the archive.
      jar.mkdir("META-INF").addResource("tutorial-persistence.xml", "persistence.xml");

      Bootstrap.getInstance().bootstrap();
      Bootstrap.getInstance().deploy(jar);

      run();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.