Scheduling is concerned with starting tasks and background processes at the appropriate time, determined by rules and external conditions. Event-driven, real-time schedulers automate background processing and manage the system load throughout the day – no matter how many customer requests occur. This facility is called asynchronous processing. Schedulers can provide such facilities by allowing systems to request the execution of a task at a particular time or when triggered by an (external) event. Thus, they help for example internet vendors to respond to customer demands immediately.
The open J2EE 1.4 specification, because of its scalability and large developer community, is becoming a more and more interesting platform for job scheduling, even more as it is offered as an SAP NetWeaver option. The Java 2 Platform, Enterprise Edition (J2EE) is an appropriate platform for developing multi-tier enterprise applications. It simplifies enterprise applications by basing them on standardized, modular components, by providing a complete set of services and by handling many details of application behavior automatically, without complex programming. It inherits many features of the Java 2 Platform, Standard Edition (J2SE) but also adds support for Enterprise Java Beans components, XML technology and other features.
OS Schedulers have limitations
The chance to schedule tasks in Java introduces on the other side new functional and technical requirements for an appropriate scheduler. Most operating systems provide a simple scheduler capable of executing tasks on a fixed schedule on the level of a certain OS. For example, the OS scheduler delivered by Microsoft just supports Windows tasks. In principle, these traditional OS schedulers can also be used to schedule Java tasks. They do this by synchronous calls to the Java stack. But they are too simple to manage complex job chains and they do not match the methods used to start Java tasks. This will become clear by considering their way of working. OS schedulers start a Java virtual machine (JVM) for each task to be scheduled. A JVM is an OS-specific container which interprets and executes a program written in Java. Today, a JVM is existent for any OS platform. But the OS scheduler approach does not scale well: Each virtual machine has a large fixed memory overhead for the virtual machine itself, for system classes and reserved memory. In addition, a virtual machine takes time to start before a job can be initiated in it. Finally, the job definitions in the Java code have to be distributed manually to every system where the job is supposed to run. So, these overheads make an OS scheduler unusable for anything but a trivial Java workload. A Java scheduler independent of platforms should do better.
Requirements for Java schedulers
A Java scheduler should be able to access components written for J2SE and J2EE. It should provide an application programming interface (API) for Java components to access the scheduling system, and a Java specific runtime environment for jobs written in Java. Also, many applications developed on J2SE and its programming interfaces (APIs) need scheduling services and should be accessible from such a Java scheduler.
A Java application may consume files from a mainframe or a business partner’s system, or produce reports from a database for further distribution. So, Java schedulers are required to integrate Java applications with other systems that work with files. But several J2EE component types cannot work with files. J2EE 1.3 has been extended for J2EE 1.4 to include Web Services and Management. It contains now Web Services such as API for XML Registries (JAXR) and management tools like Java Management Extensions (JMX). All tasks developed with the help of these components and APIs have to be started and monitored by a Java scheduler. Such a scheduler should act as a client for the developed services. To meet these tasks best the scheduler itself, at least partly, should be written in Java. In addition, it should be capable to access components written in languages other than Java and to coordinate activities between Java and non-Java tasks. Such activities can be operating system jobs on multiple platforms, tasks in ERP packages or customer applications. For example, in an environment including one or more of mySAP solutions or SAP Web Application Server (SAP WAS), heterogeneous tasks have to be coordinated: OS (such as Unix) tasks and tasks specific for SAP solutions.
Java scheduling tools cannot optimize frequently-used jobs
J2EE offers only primitive timers incapable of addressing the business need for asynchronous processing. With the ability of asynchronous processing, they can react upon any customer request immediately. J2EE lacks standard means of handling huge workloads which can be distributed according to an `overload alarm´ message, as well as an adequate exception handling.
The J2EE platform has a basic asynchronous capability: Clients send or publish messages which can be processed in an asynchronous manner, which means according to their occurrence. But neither the Java message service API nor Java Message-Driven Beans (MDB), simple facilities for asynchronous processing included in the Enterprise Java Beans (EJB) 2.1 specification of J2EE 1.4, directly address scheduling concerns. EJB technology is the server-side component architecture for the J2EE platform and enables a simplified development of distributed portable applications and a deployment of Web services applications based on Java technology. An EJB requests the timer service to notify it in the event of a single action or regularly in certain intervals. MDB are part of the EJB 2.1 specification, interact with message queues and services like those provided by SAP NetWeaver, and respond to messages sent by such services asynchronously.
SAP NetWeaver provides a comprehensive integration and application platform, designed to work with existing SAP systems and software. It includes SAP WAS supporting Java technology: J2EE 1.3 APIs, JMS, and EJB 2.0. SAP NetWeaver supports MDB as part of the J2EE 1.3 specification but does not provide scheduling support for J2EE 1.4. Nor are traditional SAP scheduling tools such as the scheduler built into SAP Computer Center Management System (CCMS) designed for scheduling Java or J2EE as they have no way of accessing Java code.
External Java schedulers
External schedulers are required that provide for time- and event-based system initiated activities, integrate into Java and J2EE environments and scale to handle large workloads. For SAP NetWeaver-based applications requiring an integrated, enterprise-wide scheduling for Java, J2EE and SAP processes, asynchronous Java scheduler CronacleBeans by Redwood presents a substantial complement.
Contrarily to OS schedulers, Java schedulers can be used across platforms as Java runs inside a virtual machine on an OS platform. In case that the workload exceeds a certain limit and has to be distributed or isolated, an external Java scheduler utilizes as many virtual machines as it needs to process the requests. An external Java scheduler is an enterprise-wide scheduler with components or a connector written in Java and is capable of starting Java tasks and other job types like SAP BW process chains, OS jobs or jobs in other ERP systems across the enterprise.
External Java schedulers thus represent an enterprise-wide single point of control – a key feature of any external scheduler, much more so for one with Java capabilities. A single point of monitoring is critical to visualize business processes across application and platform boundaries, and makes the alignment of IT and business processing simpler.