cancel
Showing results for 
Search instead for 
Did you mean: 

Timeout Service in SAP WAS 6.40

Former Member
0 Kudos

Howdy,

I am currently in the process of migrating our enterprise application from Jboss 3.2.6 to SAP WAS 6.40.

In Jboss we have a standard Timer Service and our application class registers as a Listener to the Timer Service listening for notifications at regular intervals and I am trying to implement a similar mechanism in SAP WAS.

Came across a few options

1.To implement the JMX standard Timer mbean as a service and deploy it into SAP WAS so that it is deployed and automatically starteed and then to write a notification listener to this service - Now came across a post that suggested that this is not possible in 6.40 since deployment of custom services is not supported - not sure if it is still possible though

2. Second option is to use the Timeout service in SAP WAS itself but having huge problem in implemnting the listener to this service. First of all i had a problem locating the jar that contained the com.sap.engine.service.timer package, after having doen that <b>i now face the hurdle of finding the file containing the com.sap.engine.frame.container.event package.</b>

Documentation certainly ain't very useful.

Any help from anyone who has attempted to do a similar thing is much appreciated.

Thanks

Dushy

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Check out:

import java.util.Timer;

import java.util.TimerTask;

private static Timer timer = new Timer();

timer.schedule( new JobListingScheduler(),date.getTime(),1000 * 60 * 60 * 24);

class JobListingScheduler extends TimerTask {

public void run() {

}

}

Former Member
0 Kudos

Fantastic, thanks Nathan. Will try that, i m trying to deploy my mbean from a servlet at the moment as that seems to be a preferaable option among the group here.

Having problems getting the servlet load at startup. My understanding is that the servlet should execute the code in the init() method as sooon as i deploy the application to SAP WAS.

My Web.xml looks as follows:

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>

<display-name>Rent-a-Car</display-name>

<description>WEB APP description</description>

<servlet>

<servlet-name>quickCarRentalView.jsp</servlet-name>

<jsp-file>/quickCarRentalView.jsp</jsp-file>

</servlet>

<servlet>

<servlet-name>QuickReservationServlet</servlet-name>

<servlet-class>com.sap.examples.quickcarrental.servlet.QuickReservationServlet</servlet-class>

</servlet>

<servlet>

<servlet-name>Test</servlet-name>

<servlet-class>com.sap.examples.quickcarrental.servlet.Test</servlet-class>

<load-on-startup>0</load-on-startup>

</servlet>

<servlet-mapping>

<servlet-name>quickCarRentalView.jsp</servlet-name>

<url-pattern>/view</url-pattern>

</servlet-mapping>

<servlet-mapping>

<servlet-name>QuickReservationServlet</servlet-name>

<url-pattern>/</url-pattern>

</servlet-mapping>

<servlet-mapping>

<servlet-name>Test</servlet-name>

<url-pattern>/Test</url-pattern>

</servlet-mapping>

<ejb-local-ref>

<ejb-ref-name>ejb/QuickOrderProcessorBean</ejb-ref-name>

<ejb-ref-type>Session</ejb-ref-type>

<local-home>com.yambay.quickcarrental.QuickOrderProcessorLocalHome</local-home>

<local>com.yambay.quickcarrental.QuickOrderProcessorLocal</local>

<ejb-link>QuickCarRentalEjb.jar#QuickOrderProcessorBean</ejb-link>

</ejb-local-ref>

</web-app>

Any suggestions??

Dushy

Former Member
0 Kudos

Sorry My bad, i have got the servlet loading at startup, didn;t realise that because i couldn;t see the logs from my servlet.

Anyway still working on registering the mBean.

Dushy

Former Member
0 Kudos

Have you thought about creating a servlet/jsp that has functionality within it to do the timing? If you do this, then you can setup the servlet/jsp to start on deploy. It will then run until it is undeployed.

I did this with an application that pulls data from the database at a regular interval. It was also there so that if somebody wanted to force the read, then they could go to the jsp directly.

Former Member
0 Kudos

Hi Nathan,

Thanks for the response. I had a similar suggestion from another person i.e. to use a servlet but to actually register my mBean as opposed to running like a Timer itself.

In terms of what you did in your application - i am assuming you implemented a thread inside you servlet - would this be correct??

Thanks

Dushy