Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Weblogic Load Job

 
Jimi Johnson
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there, anyone have done setting up a load job using WebLogic Platform 8.1?
 
Ajay Reddy
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do not follow the question, could you please explain a little more. Are you trying to run a job (i.e. like a batch process)? If that's the case then you can configure the class that does the job by setting it up as a startup class. When you login to the weblogic console you will see Startup and Shutdown under the section 'Your Deployed Resources'.
 
Jimi Johnson
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ajay, i was looking for a mechanism or interface to run a batch type job through weblogic.

Using startup class, the scheduling has to be program manually i suppose. Is there weblogic out-of-the-box tool or interface specifically for regular batch?
 
Ajay Reddy
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is a sample what I have done. Hope this helps.

/*
The main class that calls your implementation class.
*/
public class TimerTrigger extends Thread {

public TimerTrigger () {

long repeatTimer = 0;
Props prop = new Props();

repeatTimer = Long.valueOf(prop.getSetupParameters("REPORT_TIMER_REPEAT_SECONDS")).intValue();

Timer timer = new Timer();
timer.schedule(new ReportTask(), 0, repeatTimer);
}

public static void main (String[] args) {

TimerTrigger timerTrigger = new TimerTrigger();
Thread timerThread = new Thread(timerTrigger);
Logger.log("INFO", null, "Starting Timer Trigger Thread...");
timerThread.start();

try {
timerThread.join();
}
catch (InterruptedException e) {
DBLogger.log("ERROR", null, "Interrupted Exception Joining Timer Thread");
}
}
}

/*
Your implementation
*/
public class ReportTask extends TimerTask implements Runnable {

/* Implement your batch process here */
public void run() {

}
}
 
shashidhar Ayachitam
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ajay,
but this startup configuration is lost when the server is restarted right?

-Shashi
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic