[EJB 3.0] - How to start a session bean as soon as it is deployed
by masoodah@mdsit.com
Hi,
I want a session bean or other to start as soon as I deploy the application. Basically my need is to access a certain table in the database periodically using @Timeout Timer Serivce.
My bean looks like so
@Stateless
public class AdSetScheduleBean implements AdSetScheduleRemote, AdSetScheduleLocal {
// Add business logic below. (Right-click in editor and choose
// "EJB Methods > Add Business Method" or "Web Service > Add Operation")
public AdSetScheduleBean() {
}
@PostConstruct
public void init() {
System.out.println("I am in Postconstructor of AdSetScheduleBean");
}
@Resource TimerService timerService;
//Method to be called on timer expiration
@Timeout
public void CheckAdSetSchedule( Timer timer ){
// Define method here
}
public void startTimer(){
System.out.println("I am in startTimer");
long timeNow = System.currentTimeMillis();
long interval = 5;
timerService.createTimer(timeNow, interval, null);
}
}
How do I wake this bean on startup and have it check Status ar regular intervals.
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4125643#4125643
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4125643
18 years, 2 months
[JBossWS] - reading a local properties file
by gryffin
I'm writing a POJO/servlet based JAXWS web service on JBoss 4.0.5 w/ JBossWS 1.2.1. I'm trying to use a properties files located at /WEB-INF/properties.xml but I can't find the file. The only way I can seem to get the web service classes to find the properties file is to use an absolute URI from C: which is totally unworkable for production.
Using this code:
if ( !(new File(propertiesPath).exists()) )
| {
| log.fatal("NOT FOUND: " + propertiesPath );
| }
|
This fails, I've tried variations, but can't seem to find the path:
public static final String propertiesPath = "properties.xml";
This works,
public static final String queriesPath = "C:/Documents and Settings/tx714c/workspace/NlsAssociationService341/WEB-INF/properties.xml";
and if I assume that '...\workspace' is my local dir, I can use a relative path. But I can't get a path local to the WAR file to work.
Here's the listing of the war file:
| C:\Documents and Settings\tx714c\My Documents\workspace\ShimWS3.4.1>jar -tf gen\NlsAssociationServic
| e341.war
| META-INF/
| META-INF/MANIFEST.MF
| WEB-INF/
| WEB-INF/web.xml
| WEB-INF/classes/
| WEB-INF/classes/com/
| ...
| WEB-INF/classes/org/soapinterop/xsd/ValidationException.class
| WEB-INF/lib/
| ...
| WEB-INF/lib/wsdl4j-1.5.1.jar
| WEB-INF/properties.xml
| WEB-INF/queries.xml
|
How do I access and load a local properties file from within the war? Thanks!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4125631#4125631
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4125631
18 years, 2 months
[JBoss jBPM] - Re: GPD process designer - gpd.xml coordinates relative to w
by simonbaker
I would greatly appreciate some more help with this topic as we are using JGraph to re-draw our process definition graph for the user. I don't understand how to use the various x, y, h.., w.. values to position the transition labels and draw the bends in the arrows.
For example, here is a typical node in gpd.xml file:
| <node name="Manager - Review Holds" x="290" y="301" width="256" height="40">
| <transition name="Officer - Adjust Holds">
| <label x="43" y="-4"/>
| <bendpoint w1="-162" h1="-29" w2="5" h2="66"/>
| <bendpoint w1="-188" h1="-59" w2="130" h2="42"/>
| </transition>
| <transition name="Manager - Adjust Hold">
| <label x="62" y="-18"/>
| <bendpoint w1="-312" h1="84" w2="-1" h2="62"/>
| </transition>
| <transition name="Done">
| <label x="5" y="-10"/>
| </transition>
| </node>
|
Can the author of the GPD process designer help us understand how to interpret the attributes in the "label" and "bendpoint" elements so we can redraw these features in another coordinate system?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4125628#4125628
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4125628
18 years, 2 months