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.

爸爸 x said...

20170619 junda
oakley sunglasses sale
cheap jerseys wholesale
burberry outlet sale
cheap ray ban sunglasses
adidas uk store
michael kors outlet clearance
cheap nba jerseys
true religion outlet
ray ban sunglasses
nike air max 90

Pandurang Dusange said...

Court marriage in thane
court marriage in mumbai
marriage registration in thane
marriage registration in mumbai
Out of State Marriage registration in Thane
Temple marriage in thane
Christian marriage in thane

kenzo julian said...

This is a very good article material and it is very useful for us all. thank you . cara menggugurkan kandungan

Harsh Kumar said...

15 August Hindi Speech 2017
15 August Hindi Shayari Images 2017
15 August Hindi Essay 2017
15 August SMS Wallpapers 2017

eric yao said...

Coach Outlet ED Hardy Outlet Coach Outlet Store Online Kate Spade Outlet Cheap Jordans Coach Purses Coach Outlet Kate Spade Outlet Toms Outlet Louis Vuitton

Habib Malik said...

AP SSC Time Table 2018
AP Intermediate Time Table 2018
Goa SSC Date Sheet 2018
Goa Board HSSC Date Sheet 2018

Danish Ahmed said...

Thanks for sharing this article, now you can also check your Admit card & Recuritment 2017 by following below given links...

police si admit card 2017

gpsc medical officer admit card 2017

tamilnadu teacher recuritment 2017

bihar police constable recuritment 2017

gujarat high court recruitment 2017

Farhan Khan said...

FCI Watchman

Admit Card 2017

CG SET Admit Card


MP Patwari

Admit Card 2017

JEE Main 2018

Application Form

PNRD Assam

REcruitment 2017

Danish Ahmed said...

Thanks for sharing this article, now you can also check your Recuritment & Notification 2017-2018 by following below given links...

fci andhra pradesh watchman recuritment 2017

fci tamilnadu watchman recuritment 2017

xat notification 2018

jkbote polytechnic result 2017

Habib Malik said...

Kalyani University Routine 2018
Tripura Board Madhyamim Date Sheet 2018
Tripura Board HS Date Sheet 2018
Telangana SSC Date Sheet 2018
Telanagana Intermediate Date Sheet 2018

asoranker said...

Thanks on your marvelous posting! It is very useful and good.Come on. I want to introduce an app store optimization tips, I try it and I feel it is so good to rank app to top in app store search results, have you ever heard it?

adidas nmd said...

nhl jerseys
cheap ray bans
oakley sunglasses wholesale
ralph lauren polo
fitflops sale clearance
nike blazer pas cher
christian louboutin shoes
cheap ray ban sunglasses
oakley sunglasses
nike outlet

shrutiexpress said...

Thanks for sharing this article, now you can also check your emergency Courier Services in Thane and Mumbai by following below given links...

Courier services in Mumbai
Courier services in Thane
Courier services in Ghatkopar
Courier services in Kalyan
Courier services in Dombivli said...

awesome for valuable information. now you can also check your latest luxury project in Mumbai, Lucknow, Hyderabad, Thane, Pune, Delhi, Gujrat by following below given links...

Construction Companies in Mumbai
Construction Companies in Thane
Construction Companies in Pune
Construction Companies in Lucknow
Construction Companies in Hyderabad
Construction Companies in Delhi
Construction Companies in Gujrat

Habib Malik said...

GSAT Application Form 2018
HP Application Form 2018
Karnataka DCET Application Form 2018
RIE EEE Application Form 2018
SSC CGL Application Form 2018

suster pk said...

I really love this post I will visit again to read your post in a very short time and I hope you will make more posts like this.
cara menggugurkan hamil

David Wolf said...

thanks david for worderful addition visit my site Kamagra bestellen

Parcel Chief said...

I really love this post I will visit again to read your post in a very short time please also related post visit my site Courier to Australia