4 Replies Latest reply on Nov 13, 2008 11:57 AM by jump

    Can I access origin jar by means of custom deployment handler?

    jump

      Can I access origin jar by means of custom deployment handler?


      I have very simple custom deployment handler.


      public class BpmDeploymentHandler implements DeploymentHandler {
      
           private Set<InputStream> files = new HashSet<InputStream>();
           private static final LogProvider log = Logging.getLogProvider(BpmDeploymentHandler.class);
           
           @Override
           public String getName() {
                return "BpmDeploymentHadler";
           }
      
           @Override
           public void handle(String name, ClassLoader classLoader) {
                
                if(name.endsWith(".xml")) {
                     File f = new File(name);
                     File parent = f.getParentFile();
                     log.info("parent is " + parent);
                     log.info("name is " + name);
                }
           }
      }



      So I putted seam-deployment.properties into META-INF inside my jar, but outcome I received was really strange


      [BpmDeploymentHandler:45] parent is META-INF
      [BpmDeploymentHandler:49] name is META-INF/faces-config.xml



      this looks strange, cause I got no faces-config.xml in my jar
      But next string surprised me even more, cause parent of processdefinition.xml should be my jar


      [BpmDeploymentHandler:45] parent is null
      [BpmDeploymentHandler:49] name is processdefinition.xml



      Looks like my deployment handler was called on every deployment of jar containing seam.properties file. This strings are proving my assumption


      [BpmDeploymentHandler:45] parent is META-INF/maven/org.jboss.seam/jboss-seam-ui
      [BpmDeploymentHandler:49] name is META-INF/maven/org.jboss.seam/jboss-seam-ui/pom.xml




      So, can any1 explain my, how does it work? Description in seam reference is really poor. When deployment handler should be invoked? And how to access origin par from handler?