users@glassfish.java.net

Re: auto execute ejb

From: Adam Bien <abien_at_adam-bien.com>
Date: Mon, 09 Mar 2009 15:39:24 +0100

You will need gf v3;

@Singleton
@Startup
public class Starter{

@PostConstruct
public void startMeUp(){
    //invoke something here...
}

}

regards,

adam
glassfish_at_javadesktop.org schrieb:
> I would like an ejb to be auto construct when glassfish starts up. Is this possible?
>
> In fact, I am trying to develop a job scheduler to fire up some ejb or processes at regular time interval. But the only method I can think of is to have a auto-construct ejb as the job scheduler, which will invoke other ejb for the processes according to a timer. Is there a better way to do this instead of my idea?
>
> I know how to do it using something like a java service loader. But I would like to do it within Glassfish if possible.
> [Message sent by forum member 'senderj' (senderj)]
>
> http://forums.java.net/jive/thread.jspa?messageID=335821
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>
>


-- 
 Consultant, Author, Java Champion
 
 Homepage: www.adam-bien.com
 Weblog: blog.adam-bien.com
 eMail:  abien_at_adam-bien.com
 Mobile: 0049(0)170 280 3144
 Books: Enterprise Architekturen (ISBN: 393504299X),
        Java EE 5 Architekturen  (ISBN: 3939084247),
        J2EE Patterns, J2EE Hotspots, Enterprise Frameworks and Struts