Friday, June 18, 2010

EJB annotations and Stereotyping

Certainly for the EJB-related annotations, I would love to see @Stateless, @Stateful, @Singleton and @MessageDriven be used for stereotyping as well as all the other class level annotations for transactions, security, locking, timeouts and scheduling.

Great security example:

 @RolesAllowed({"SuperUser", "AccountAdmin", "SystemAdmin"})
 public @interface Admins {}
In one swoop all the security rolls become controlled in one spot and there's no need to go changing a million usages to modify the roll names.

Here's a couple great scheduling examples:

 @Schedule(second=”0”, minute=”0”, hour=”0”, month=”*”, dayOfWeek=”*”, year=”*”)
 public @interface Daily {}
 @Schedule(second=”0”, minute=”0”, hour=”0”, month=”*”, dayOfMonth=”15,Last”, year=”*”)
 public @interface BiMonthly {}
The list goes on and on. A much fuller example:
@RolesAllowed({"SuperUser", "AccountAdmin", "SystemAdmin"})
@Interceptors({LoggingInterceptor.class, StatisticsInterceptor.class})
public @interface SuperBean {}
And to use all that, just:
public class MyBean {

    public void doSomething() {


Heiko W. Rupp said...

This for sure looks interesting. Would you allow stereotypes to inherit from each other?

For the @Daily stereotype: I voted in the EJB3 cycle to directly have such keywords (basically what you have in newer cron implementations) within @Schedule

David Blevins said...

Sure, I would allow stereotypes to inherit from each other. Having a lot of levels will add indirection and potentially slow down your deployments, but I don't see any issues giving people that choice.

Definitely the cron built-in @hourly @daily, etc. were an inspiration for me as well and I did make this proposal in EJB 3.1 while we were talking about @Schedule. There was definitely interest and we might see it in a future EJB spec -- though likely after EJB 3.2.

I've worked on it in OpenEJB and am hoping to have a prototype in another week.

Narender Godara said...

Packers and movers Kanpur
Packers and movers Karnal
Packers and movers Kolkata
Packers and movers Lucknow

Arjun Singh said...

just for getting new clients and for new promotions at last and so individuals want a organization who are thinking more regarding their clients and working for their specifications and expectations of clients.
Packers and Movers in Bangalore
Packers and Movers in Pune
Packers and Movers in Hyderabad
Packers and Movers in Mumbai

amine lahragui said...

Your work is very good and I appreciate you and hopping for some more informative posts. happy new year 2016 new year 2016 bonne année 2016 happy new year 2016 images feliz año nuevo 2016 imagenes de año nuevo 2016 feliz año 2016

Deepak Negi said...

Hey Guys Must Check these :-

I can do that live show
I can do that live telecast
I can do that Show live streaming
muharram 2015 Images
muharram 2015 Hd Wallpapers
Happy muharram 2015 Quotes
Muharram 2015 Slogans
muharram 2015 Karbala sms
Muharram 2015 Quotes
10 muharram 2015 Talwar Matam Videos
Muharram 2015 Zanjeer Juloos Videos
muharram 2015 Poems
Hazrat Hussain Poetry 2015
muharram 2015 Qawwali Mp3
10 Muharram 2015 shayari
Muharram 2015 Status
Labbaik ya hussain mp3 Songs
Hazrat Hussain Hd Images
Happy Childrens Day 2015 Images
Mastizaade Box Office Collection
Mastizaade Funny Scenes
Mastizaade hd Videos
Mastizaade Hot Scenes
Mastizaade Movie Review
Mastizaade Romantic Scenes
Mastizaade Songs
Mastizaade trailer film
World Aids Day 2015 Quotes
World Aids Day 2015 Posters
World Aids Day 2015 Themes
World Aids Day 2015 Slogans

Mary Brown said...

Java EE article is practical oriented and real time examples. How Java EE address the enterprise development is very important. for that you need a practical orieneted Java Training you need.

Online Java Training
Online Java Training from India
Java Training Institutes in Chennai
Java Training in Chennai
Java Training

Anna said...

Great Explanation with appropriate example.
Online Java Training
Online Java Training India

Ranveer Patil said...

This is great do you have a catologue if so I would love one to share with friends and family.
ipl 2016 live matches watch online here
watch cricket stream on cricbuzz ipl matches
ipl live streaming 2016 score watch online

Friv4 Games Online said...

I found a lot of information here to create this actually best for all newbie here. Thank you for this information.
i like play games happy wheels online and play happy wheels 2 games and friv4school , games for girls , games go girls

asds said...

Inspirational Life Quotes
Happy Birthday
father's day 2016
Happy father's Day 2016
Happy Mothers Day Images

ياسين الميموني said...

هاي داي مهكرة 2016

تحميل لعبة Hay Day

عمل روت لكل الهواتف

اضافات بلوجر

متفوق للمعلوميات

Mothers Day said...

Mumbai Court Marriage
Mothers Day Images
Mothers Day Images 2016
Happy Mothers Day Images
Happy Mothers Day Images 2016
Cute Mothers Day Poems & Sayings For Friend
Mothers Day 2016 Images
2016 Mothers Day Images
Happy Mothers Day 2016 Images
2016 Happy Mothers Day Images
Images Mothers Day
Images Mothers Day 2016
Images Happy Mothers Day
Happy Mothers Day Images 2016
Images For Mothers Day 2016
Images For 2016 Mothers Day
Images For Happy Mothers Day 2016
Images For 2016 Happy Mothers Day
2016 Mothers Day
Long Mother Day Messages From Husband
Thankful Mothers Day Messages From Husband

Maxi said...

watch the huntsman winter's war full movie online

compadres full movie online

watch tale of tales movie online

watch mother’s day full movie online

watch green room full movie watch online

watch ratchet and clank movie online

watch keanu full movie online

captain america civil war full movie watch online

watch the jungle book 2016 movie online

watch game of thrones season 6 episode 1 online