Help

Built with Seam

You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.

Seam Cron

Scheduling and asynchronous invocation support for managed beans.


To get started in Maven, copy and paste the following XML fragment into the <dependencies> section of your pom.xml:
        <dependency>
            <groupId>org.jboss.seam.cron</groupId>
            <artifactId>seam-cron-api</artifactId>
            <version>3.0.0.Alpha1</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.seam.cron</groupId>
            <artifactId>seam-cron-scheduling-quartz</artifactId>
            <version>3.0.0.Alpha1</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.seam.cron</groupId>
            <artifactId>seam-cron-asynchronous-quartz</artifactId>
            <version>3.0.0.Alpha1</version>
            <scope>runtime</scope>
        </dependency>
* Maven artifacts are located in the JBoss Community Repository. Find out more about this repository.

Module team

Name Module role Commit username (Git) Organization Hometown (Time zone)
Pete Royle Lead peteroyle Independent Brisbane, Australia (UTC+10)
Dave Oxley Contributor daveoxley Workplace Systems Drouin, VIC, Australia (UTC+10/11)
George Gastaldi Contributor gastaldi Independent Joinville, SC, Brazil (UTC-3)
Cloves Almeida Contributor cjalmeida Independent Eniwetok, Kwajalein (UTC+12)
Jason Porter Contributor lightguard Red Hat, Inc. Salt Lake City, UT, USA (UTC-7)
Dan Allen Contributor mojavelinux Red Hat, Inc. Laurel, MD, USA (UTC-5)
Want your name to appear in this list? Join us in #seam-dev on freenode and let us know you want to get involved.
Special thanks also to the QE And Enterprise Platform Teams who help with releases and generally keep this project ticking along

Description

The best way to run scheduled events in a JSR-299 environment. It makes use of CDI’s typesafe event model for tying business logic to schedules. That is, you define your schedules using the provided qualifiers, which you apply to observer methods containing the business logic that you wish to be run at those times.

Release plan

Version Time frame Focus
3.0.0.Alpha1 ~ Late Feburary
  • Initial preview release

Design whiteboard

This section serves as a whiteboard for design and ideas for this module. Once you've decided to pursue a feature, it should be added to JIRA as a feature request and optionally linked from this page.

Type-safe Scheduled Method Execution

@Scheduled("00:00")
@Qualifier
@Retention( RUNTIME )
@Target( { PARAMETER })
public @interface AtMidnight
{
}

public void howlAtTheMoon(@Observes @AtMidnight CronEvent event) {
    wolf.howl();
}

Built-in Qualifiers for Common Scheduling Needs

public void clockChimes(@Observes @Every(HOUR) Trigger t) { 
    int chimes = t.getValue() % 12;
    if (chimes == 0) { chimes = 12; }
    for (int i=0; i<chimes; i++) {
        bellTower.getRope().pull();
    }
}

Asynchronous Method Execution with CDI Event-driven Callbacks

@Asynchronous @Debit
public Balance addDebit(int dollars) {
    ...
    return new Ballance();
}

public void reportNewBalance(@Observes Balance balance) {
    log.report(balance.amount());
}

public void trackSpending(@Observes @Debit Balance balance) {
    db.saveSomething();
}