Package com.kabira.platform.swtimer

Transactional timer service

See: Description

Package com.kabira.platform.swtimer Description

Transactional timer service

Provides a transactional timer service.

The default resolution of the timers is one second. This may be changed through configuration.

The timer expiration times are stored as absolute times, thus lowering the possibility of timer drift.

A caller specified Object parameter is provided to the notifier, allowing a single instance of the notifier to be shared for multiple uses.

Timer actions are transactional. They do not take effect until the transaction commits.

Configuration

There is configurable control, on a per-JVM basis for the amount of parallelism in the execution of timer notifications, and for the resolution of timers. These settings are both optional.

                        JVM
                        {
                                jvmName = "com_kabira_examples_chat_Main0";
                                timerParallelism = 4;
                                timerResolutionMilliseconds = 500;
                        };
                        

timerParallelism controls the maximum number of parallel time notification executions. timerParallelism is an integer value from 1 to 1000. When not explicitly configured, timerParallelism defaults to a value of 1.

timerResolutionMilliseconds controls the resolution of timers by setting the interval at which timers are examined by the system. When not explicitly configured, timerResolutionMilliseconds defaults to a value of 1000, yielding a timer resolution of 1 second (1000 milliseconds).

Timer resolution is only approximate and cannot be guaranteed. It depends upon the resolution of operating system services and system load.

Warning

Timer operations cannot be called from a commit notifier. This will cause a fatal runtime exception.

Configuring timerResolutionMilliseconds to values smaller than 1000 will increase CPU usage.
Copyright 2008, 2012 Cloud Software Group, Inc.