2 Replies Latest reply on Jun 29, 2007 11:12 PM by colintoal

    Deployment Scanner framework

      Guys,

      Thanks for Seam.. enjoying it very much.

      For shiggles - I'm working on some code to wrap Jackrabbit in a manner similar to 'EJB3 Persistence'. My immediate goal is to annotate a POJO with some custom annotations and - at deploy time - have my code read the annotations from the compiled classes and generate JCR CND type specifier and register the type.

      The Seam Deployment Scanner Framework is perfect for this. Its even built in a way that can be easily extended. So here is my question - is there a public API I can use to extend this ?

        • 1. Re: Deployment Scanner framework
          gavin.king

          No, not yet, but there is a JIRA issue asking for this and we are definitely going to open it up when we get time.

          • 2. Re: Deployment Scanner framework

            Cool - I'm glad its on the plan for the future - as the Scanner facility is nice.

            One thought I had is to use a meta-annotation to represent "scan discoverable".

            One could annotate the annotation that indicates why the class is being discovered with it.

            I'm imagining something like:

            public @interface @ScanDiscoverable
            {
             String value() default ""; // resource token ? like seam.properties ? necessary ?
            }
            
            ...
            // Seam example
            @ScanDiscoverable
            public @interface Name
            ...
            


            This provides the ability to extend the Scanner's discoverable classes with new annotations (like my @JCRContentItem annotation).

            Then the Scanner could be extended with Pre and Post Scan hooks (also discovered during scanning):

            public @interface ExecutePostScan
            {
             Annotation discoverable();
            }


            Methods (or Classes ? I'm not quite sure yet) bearing this annotation would have to implement a contract like

            @ExecutePostScan(discoverable=JCRContentItem)
            public void executePostInitializeScan ( ServletContext ctx, Set<Class<Object>> )


            This would give the new @ScanDiscoverable annotation implementor a clean post Scan hook.