madnaelo / jain-slee

Automatically exported from code.google.com/p/jain-slee
0 stars 0 forks source link

JAIN Slee Annotations #2

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

recently we have been working on a tool that would facilitate creation of 
sbb-jar.xml descriptor basing on annotations. Generally speaking, it scans the 
source code looking for annotations, and basing on them the sbb-jar.xml file is 
created.

Main features:
 - all JSA's annotations have source code retention
 - uses Java 6 annotation processing library
 - easy to use (annotations and optionally configuration file)

In attachment there is the complete source code (with examples) and a PDF with 
documentation.

We would like to find out if other users would find it useful, so thank you for 
all your feedback.

Best regards,
Jakub Wachowski
AMG.net

Original issue reported on code.google.com by samir.jorina@gmail.com on 16 Aug 2012 at 11:04

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Hello Jakub,

I find your tool very useful. I tested it and it looks promising.  Do you plan 
to improve the JSA tool or maybe you already did it?

I found same small issues that I list below: 
Issue 1: Generated <resource-adaptor-type-binding> descriptor tag shouldn’t 
always include optional <resource-adaptor-entity-binding>.
    Please note that <resource-adaptor-entity-binding> is optional (see: description in slee-sbb-jar_1_1.dtd or paragraph 3.1.8 page 30 of JAIN SLEE 1.1. spec). Therefor IMHO objectName and entityLink should be optional elements of org.jslee.sbb.annotations.RaBinding annotation (should have default empty value). Apart of changing mentioned RaBinding annotation elements code modification of appendRaTypeBinding method of SbbJarXmlBuilder class would be required (to make sure that <resource-adaptor-entity-binding> tag is generated only in case e.g. one of @RaBinding annotation elements was specified) 

Issue 2: Generated <env-entry> tag has no <description> subtag. This is due to 
missing ‘description’ attribute in EnvEntryModel class. Apart from adding 
‘description’ attribute to EnvEntryModel class modification of 
insertEnvEntries method of AnnotationsProcessor class and appendEnvEntry method 
of SbbJarXmlBuilder class would be need.

Issue 3: Generated sbb-jar.xml may contain duplicated <description> tags 
resulting sbb-jar.xml to be invalid. There is a bug in code of appendEvent 
method of SbbJarXmlBuilder class (see line 238) that cause adding 
‘description’ element value of @EventHandler to sbb element instead of 
event element.

Passible improvements:
Currently 'value' element of @LocalInterface as @ ActivityContextInterface is 
String type. Please consider to change of mentioned types to:
Class<? extends javax.slee.SbbLocalObject > localInterface() default 
javax.slee.SbbLocalObject.class;
and 
Class<? extends javax.slee.ActivityContextInterface> activityContextInterface() 
default javax.slee.ActivityContextInterface.class;
This would allow for types control and prevent possible errors that could only 
be discovered while deploying the Sbb.

Regards,
Marek Nowacki

Original comment by haw...@gmail.com on 25 Oct 2012 at 10:50

GoogleCodeExporter commented 9 years ago
Hi Marek,

thank you for your feedback, it is really nice to hear that someone has found 
this project useful.

Concerning the issues you have mentioned: although it doesn't seem that they 
would take much time to improve, it is quite hard to say when I will find some 
time to correct them. Hopefully next week, but I can't promise anything.

As far as the improvement you mentioned is concerned - I believe it's a good 
point and I'll try it out as soon as I have some spare time. 

Best regards,
Jakub

Original comment by samir.jorina@gmail.com on 30 Oct 2012 at 9:04

GoogleCodeExporter commented 9 years ago
Hi,

I have updated the project according to remarks from comment #2. I have also 
included the suggested improvements.

Change Log:
1) since resource-adaptor-entity-binding is optional and can have multiple 
repetitions, now RaBinding takes array of RaEntityBinding annotations (this is 
a new annotation)
2) env-entry now has the description element
3) description tag is now correctly assigned to the event element (and not to 
the sbb element)
4) LocalInterface and ActivityContextInterface now take Class<...> instead of 
String (note: despite the Marek's suggestion I have decided not to declare any 
default value for these annotations)

Updated code and documentation in attachment.

Regards,
Jakub

Original comment by samir.jorina@gmail.com on 14 Nov 2012 at 2:35

Attachments: