How to use the RF's Basic Services

The following sections give a brief overview of the RF's built-in Basic Services. The Basic Services are additional services that are not related to resources but are provided as global services for now as well.


Table of Contents

Application Log

Caches

System Landscape

Scheduler

Task Queue


Application Log

If an application or extension wants to log logging information, it can use the IAppLogService to write its logging information into an IAppLog.

The IAppLog is similar to the logging and tracing API, described in RF Components and their Runtime, and will be replaced by the APIs described there. For now, its implementation allows applications to write the log and it offers a log viewer that can be used by an administrator.


Caches

The ICacheService offers getCache() for retrieving a configured implementation of an ICache (package com.sapportals.wcm.util.cache). This cache can be used by an application or extension to cache frequently requested objects. It is configured using the KM configuration UI.

The caches implement local caches and are not cluster-aware. The application is therefore responsible for handling the proper cache invalidation in a clustered environment.


System Landscape

Since the RF's main task is to integrate various backend systems, the applications and extensions might require information about the systems they are to connect to. This is handled by the ILandscapeService.

It offers the method isClusterInstallation() for determining whether the entire system is running in a clustered installation. The method getSystemFactory() retrieves the ISystemFactory, which is used in turn to retrieve information about a specific system. A system is identified by its ID, whereas the information about it is represented as ISystem.

A system's type determines its ICredentials, which specify the logon credentials required to log on to a system of that type and to carry out the user mapping between the portal and the backend system.


Scheduler

The scheduler service ISchedulerService supports ISchedulerTasks that represent tasks that have to be executed periodically. An application or extension has to define its own scheduler tasks in the configuration in order to have them configured to run at a certain time.

The ISchedulerService's method createSchedulerEntry()creates a task that has to be re-registered again on the next start-up.

An implementation of an ISchedulerTask is instantiated by the scheduler on the start-up of the RF. Its run() method is then called periodically, as specified by its ISchedulerTimeTable.


Task Queue

In order to support the sourcing out of "large" time-consuming computations, an application can use the scheduler to perform batch tasks at times when only few users are logged on. The task queue offers another method for separating these batch tasks from the application. THis method is especially useful in a load-balanced installation:

The application retrieves an ITaskQueueWriter for a specific namespace and ID from the ITaskQueueService and uses it to place ITasks into an ITaskQueue. The ITaskQueue stores the tasks and distributes them to the ITaskQueueReaders.

On the other side, the application batch job retrieves the appropriate ITaskQueueReader (for the application's namespace and ID) from the ITaskQueueService and uses it to get the ITasks sent by the application from the ITaskQueue.