EasyBeans

Improve Deployment Flexibility

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: EasyBeans 1.2.0 M1
  • Fix Version/s: EasyBeans 1.2.0 M2
  • Component/s: Core
  • Description:
    Hide
    EasyBeans employs org.ow2.easybeans.deployment.Deployment to scan and anlysis classes in deployable archive so that retrieves the EJB metadata.

    Scanning bytecode with ASM is a prevalent technique used by many frameworks for intelligent deployment purpose. And EasyBeans has a nice extensible mechanism for this. So we can make use of it to add some so call build-in deployment support for certain frameworks. For example JPA, actually EasyBeans can tell which are entity classes, JPA provider needn't search for them again.

    Implements and register org.ow2.util.scan.api.IAnnotationVisitor can achieve deployment customization. But the only flaw is org.ow2.easybeans.deployment.Deployment hardcoding EasyBeansEjbJarDeployableFactory.

    public void analyze(final ClassLoader classLoader) throws ScanException, ResolverException,
                DeployableHelperException, DeployableMetadataException {

    Line 135: EasyBeansEjbJarDeployableFactory deployableFactory = getDeployableFactory();

    If this can be extracted to a protected method, it would be perfect.
    Show
    EasyBeans employs org.ow2.easybeans.deployment.Deployment to scan and anlysis classes in deployable archive so that retrieves the EJB metadata. Scanning bytecode with ASM is a prevalent technique used by many frameworks for intelligent deployment purpose. And EasyBeans has a nice extensible mechanism for this. So we can make use of it to add some so call build-in deployment support for certain frameworks. For example JPA, actually EasyBeans can tell which are entity classes, JPA provider needn't search for them again. Implements and register org.ow2.util.scan.api.IAnnotationVisitor can achieve deployment customization. But the only flaw is org.ow2.easybeans.deployment.Deployment hardcoding EasyBeansEjbJarDeployableFactory. public void analyze(final ClassLoader classLoader) throws ScanException, ResolverException,             DeployableHelperException, DeployableMetadataException { Line 135: EasyBeansEjbJarDeployableFactory deployableFactory = getDeployableFactory(); If this can be extracted to a protected method, it would be perfect.
  1. Deployment.java
    (8 kB)
    stone long
    02/Apr/10 8:12 AM
  2. Deployment.java.patch
    (2 kB)
    stone long
    09/Apr/10 9:15 AM
  1. code2.jpg
    (80 kB)
  2. code3.jpg
    (222 kB)

Activity

Hide
stone long added a comment - 02/Apr/10 8:12 AM
Refactor org.ow2.easybeans.deployment.Deployment
Show
stone long added a comment - 02/Apr/10 8:12 AM Refactor org.ow2.easybeans.deployment.Deployment
Hide
stone long added a comment - 02/Apr/10 8:15 AM
I've attached the refactor code org.ow2.easybeans.deployment.Deployment

Please check the following lines, others are remained no change.

Modify line 135, and add line 208-EOF
Show
stone long added a comment - 02/Apr/10 8:15 AM I've attached the refactor code org.ow2.easybeans.deployment.Deployment Please check the following lines, others are remained no change. Modify line 135, and add line 208-EOF
Hide
Guillaume Sauthier added a comment - 02/Apr/10 1:55 PM
Please, can you provide a patch instead of the whole file ?
It's much more easier to apply and to see what you have changed when using a patch.

Don't worry, with your favorite IDE or tortoise, that's very easy to produce one...
Show
Guillaume Sauthier added a comment - 02/Apr/10 1:55 PM Please, can you provide a patch instead of the whole file ? It's much more easier to apply and to see what you have changed when using a patch. Don't worry, with your favorite IDE or tortoise, that's very easy to produce one...
Hide
stone long added a comment - 07/Apr/10 5:10 AM
Sorry, maybe it's not that comprehensive.

So I attach the code difference, screenshot of IDEA IntelliJ code comparison tool.

Hope these will help, I'm not sure about what patch means.
Show
stone long added a comment - 07/Apr/10 5:10 AM Sorry, maybe it's not that comprehensive. So I attach the code difference, screenshot of IDEA IntelliJ code comparison tool. Hope these will help, I'm not sure about what patch means.
Hide
Guillaume Sauthier added a comment - 07/Apr/10 9:22 AM
It's just a good habit when working with opensources projects to provide contribution as patches.
That's just a diff (similar to what you get when typing 'svn diff'), but all IDEs have wizards to help creating/applying patches.

Here is a quick link on "how to create a patch" for IDEA: http://www.jetbrains.com/idea/webhelp/creating-patches.html
Show
Guillaume Sauthier added a comment - 07/Apr/10 9:22 AM It's just a good habit when working with opensources projects to provide contribution as patches. That's just a diff (similar to what you get when typing 'svn diff'), but all IDEs have wizards to help creating/applying patches. Here is a quick link on "how to create a patch" for IDEA: http://www.jetbrains.com/idea/webhelp/creating-patches.html
Hide
stone long added a comment - 09/Apr/10 9:15 AM
Thanks for Guillaume 's patient instruction, I've uploaded the patch file, generated by TortoiseSVN client.
Show
stone long added a comment - 09/Apr/10 9:15 AM Thanks for Guillaume 's patient instruction, I've uploaded the patch file, generated by TortoiseSVN client.
Hide
Florent BENOIT added a comment - 26/Apr/10 10:23 AM
Committed
Show
Florent BENOIT added a comment - 26/Apr/10 10:23 AM Committed

People

Dates

  • Created:
    02/Apr/10 8:11 AM
    Updated:
    26/Apr/10 10:23 AM
    Resolved:
    26/Apr/10 10:23 AM