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"})
 @Stereotype
 @Target(METHOD)
 @Retention(RUNTIME)
 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=”*”)
 @Stereotype
 @Target(METHOD)
 @Retention(RUNTIME)
 public @interface Daily {}
 @Schedule(second=”0”, minute=”0”, hour=”0”, month=”*”, dayOfMonth=”15,Last”, year=”*”)
 @Stereotype
 @Target(METHOD)
 @Retention(RUNTIME)
 public @interface BiMonthly {}
The list goes on and on. A much fuller example:
@Stereotype
@Singleton
@TransactionManagement(CONTAINER)
@TransactionAttribute(REQUIRED)
@ConcurrencyManagement(CONTAINER)
@Lock(READ)
@RolesAllowed({"SuperUser", "AccountAdmin", "SystemAdmin"})
@Interceptors({LoggingInterceptor.class, StatisticsInterceptor.class})
@Target(TYPE)
@Retention(RUNTIME)
public @interface SuperBean {}
And to use all that, just:
@SuperBean
public class MyBean {

    public void doSomething() {
        
    }
}

22 comments:

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.
Signature:
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

yoob games said...

العاب بنات يحتوي موقعنا على تشكيلة من العاب تلبيس بنات متجددة باستمرار وكل مايتعلق بصنف العاب بنات تلبيس ومكياج وطبخ ومرحبا بكم في العاب تلبيس بنات جديدة

العاب بنات - العاب تلبيس بنات ومكياج وطبخ

Lopez Alexander said...

Thanks for giving me the useful information. I think I need it!
Happy Wheels , FNAF World , Five Nights At Freddy's

Akshi Sharma said...

Happy Father's Day
FREE PRINTABLE FATHERS DAY CARDS
Fathers Day 2016 Quotes


best fathers day 2016 facebook timeline covers
fathers day shayari in hindi 2016
fathers day poems from daughter 2016


fathers day 2016 quotes pictures, images and photos
Fathers Day 2016 SMS
fathers day quotes messages images wishes


happy fathers day 2016 quotes sayings in english
happy fathers day greetings 2016 from wife to husbands
happy fathers day 2016 messages, quotes and wishes


Fathers day picture
top 10 fathers day wallpapers quotes images 2016
Fathers Day Poems from Kids


best fathers day messages from daughter
fathers day messages from wife to husband
short father's day quotes 2016

one liner fathers day slogans in english
fathers day slogans in english
fathers day quotes from daughter hindi

best father's day quotes 2016
happy father's day quotes 2016 in hindi and english
fathers day quotes in hindi best hindi shayari



french open final live streaming
french open fin al 2016 live
french open live stream








http://www.fathersday2014s.com/2014/05/fathers-day-messages.html
http://www.fathersday2014s.com/
http://www.fathersday2014s.com/2014/05/fathers-day-greetings.html
http://www.fathersday2014s.com/2014/05/fathers-day-quotes.html
http://www.fathersday2014s.com/2016/05/fathers-day-images.html
http://www.fathersday2014s.com/2016/05/fathers-day-pictures.html

Mahe Rose said...

Fathers Day 2016
fathers Day 2016 Messages
Father's Day 2016 Wishes
Fathters Day Facebook Quotes

Zheng junxai5 said...


zhengjx20160804
cheap rolex watches
fit flops
coach outlet
oakley sunglasses
cheap toms shoes
louis vuitton purses
louboutin sale clearance
christian louboutin sale
true religion outlet
louboutin femme
cheap basketball shoes
louis vuitton bags
polo shirts
rolex watches outlet
oakley outlet
mont blanc pen
michael kors outlet
oakley sunglasses wholesale
michael kors handbags
kd 7 shoes
michael kors outlet
adidas nmd
coach factory outlet online
concords 11
longchamp outlet
louis vuitton outlet
rolex watches for sale
michael kors handbags
coach outlet store online
coach outlet online
coach factory outlet online
michael kors outlet
cheap jerseys
mont blanc pens outlet
vans sneakers
air jordan 4
basketball shoes
lebron 13
cheap rolex watches
lebron 13 shoes

Hua Cai said...

christian louboutin uk
michael kors canada
ugg boots sale
hermes bags
michael kors uk
adidas nmd
mbt shoes outlet
louis vuitton neverfull sale
football shirts
michael kors outlet online
ugg boots
michael kors outlet
longchamp outlet
michael kors outlet clearance
lululemon pants
michael kors uk
tiffany and co
ugg boots
lacoste polo shirts
ugg australia
true religion outlet
iphone case
omega outlet
michael kors outlet
mulberry handbags sale
tiffany jewellery
uggs outlet
mulberry uk
michael kors outlet
mac cosmetics sale
michael kors uk
rolex watches outlet
tiffany outlet
michael kors handbags clearance
ray ban sunglasses sale
20160812caihuali

Kelly Anni said...

Great info. I would like more information about this, because it is very nice. Thanks for sharing : contact form | snapchat emoji

Sk Awna said...

العاب بنات