Doing Scheduled agents When not on a Domino server

When you step outside the warmth and comfort of a domino server a lot of things frighten the willies out of you, things you took for granted are suddenly not there, so i thought each time i have to do a notes equivalent in the cold hard
world, I would share:

Today sprig of joy is scheduled agents in Java (on a JBoss server actually), this is all supplied thanks to the amazing people over at, its far more powerful than my example, but it easy to understand when you come from notes, and you can expand on it as you see fit (instruction are in the comments), have fun (oh, if the code looks cramped just copy it to a bigger text widow as i left all the proper indenting in)

import org.quartz.CronTrigger;
import org.quartz.JobDetail;
import org.quartz.Scheduler;
import org.quartz.impl.StdSchedulerFactory;
public class JustLikeANotesAgent {
    public static void SetUpNotesTypeAgent(String CronTriggerPram) throws 
Exception {
        // setting up the scheduler which is basically the equivalent of agent 
       Scheduler scheduler = StdSchedulerFactory.getDefaultScheduler();
        // setting up our "Agent" ie giving it a name and linking it to a chunk 
of code
        JobDetail NotesAgent = new JobDetail("NotesAgentName", null, 
        // setting up our schedule ,there are "simple triggers" and 
        // Crontriggers are more powerful and easy to get a handle on if your 
used to notes
        CronTrigger AgentSchedule=new CronTrigger("AgentScheduleName",null
        // linking the Agent to its schedule and "enabling" it
        scheduler.scheduleJob(NotesAgentName, AgentScheduleName);
        scheduler.start(); // and off we go, basically "load Agmr"
    public static void main(String[] args) {
           //the following string is a Cron Trigger that runs every 5 mins
           // tutorial on crontriggers can be found HERE
     String CronTriggerPram = "0 0/5 * * * ?";
     try {
     } catch (Exception e) {
            //scheduler.shutdown(); this is commented out as its basically like 
"tell agmr quit"     

Leave a Reply

Your email address will not be published.