Essential ATG Dynamo Training - Got atg Certified Relationship Management Developer?
This is not an official ATG site: ATG, Dynamo, Scenario Server and Personalization Server are trademarks or registered trademarks of Art Technology Group
Articles Exercises Resources Links Search

Read-Me for Demo Schedule

DOWNLOAD FILES

This sample demonstrates the Dynamo scheduling. We will set up a scheduled job, and log the number of active sessions to the info log according to the defined schedule. We'll also see how to automatically start the service every time the server is started.

This sample can be used as a template for any scheduled task simply by modifying the performScheduledTask method of the SessionReporter class.

  • Extract files into <DYNAMO_HOME>\demoschedule
  • Start dynamo with -m demoschedule to enable the demo

Notes

  • None

Exercise

In this exercise you'll add a new scheduled job to report the number of active sessions to the console every 5 minutes  

  1. Examine the source code of demoschedule.SessionReporter
    • Note the implementation of the atg.service.scheduler.Schedulable interface
    • Note the SessionManager property which is used to access the current session information
    • Take a look at the schedule and scheduler properties (what are these for?)
    • Every GenericService class gets doStartService and doStopService (What are we doing in these methods?)
  2. Compile demoschedule.SessionReporter and ensure the class file is on the classpath. (If you are running the 
  3. Create a new globally scoped component called /demoschedule/SessionReporter of class demoschedule.SessionReporter
  4. Ensure that the sessionManager property is set to the dynamo session manager (can you find it?)
  5. Set the schedule to 'every 2 minutes' (Why does this work?)
  6. Set the scheduler to the global scheduler (Can you find this?)
  7. Start the component, Does the SessionReporter work correctly?

Additional Steps

With something like this, we might want the component to be started automatically when the server starts. The InitialService component in /atg/Dynamo maintains a list of components to start automatically.

  1. Add the SessionReporter to the initial services list (Can you find this?)

Solution

The solution files for this exercise can be found in the solution folder.



Technical Training Advertise your Training Programs for Free! Los Angeles Web Design Shopping Cart Software  Form a Corporation