Services

Log Service

The LogService takes log requests from bundles and the LogReaderService allows other bundles to read entries from the log. You can specify that the LogService log messages at one of four specified levels: Error, Warning, Info, or Debug. The LogService is intended to report errors, although you can log any message.

The LogService interface enables you to:

 Specify the message or exception or both to be logged.
 Supply a log level signifying the severity of the log message.
 Specify the service that is associated with the log requests.
The LogReaderService interface enables you to:
 Retrieve recent past log entries.
 Receive notification of new log entries.
Bundles can make log requests through LogService after they get the Service object from the Framework. LogService can log a simple message at the specified log level, and it can also log a message with an exception at the specified log level.

Configuring LogService

The LogService configurations described here are specific to the implementation of LogService that is included in ServiceTango. LogService has a limited number of configuration options. You can control the log size and the log threshold (Error, Warning, Informational, or Debug severity level). When a threshold level is specified, only entries with the level equal to or greater than the current threshold are logged. Error is the highest threshold level and Debug is the lowest level.

To make these configurations, start smfadmin. Under Registered Services, click LogService. Change the Log Size field and Log Threshold radio buttons for the configuration you need.

For more detailed information about methods for the LogService, see the OSGi API specification.

HttpService

The HttpService is an HTTP 1.0 Web server with a Java 2.2 servlet engine with support for and JavaServer Pages 1.1. The HttpService enables other bundles to dynamically register and unregister servlets and other static resources such as GIF files. You can register HTML files, GIF files, class files, or any resources that can be read through a URL.

When a bundle registers a service or resource, it must provide an HttpContext object. The HttpContext object provides methods that HttpService calls to get information about a registration. For example, resources that are registered might require a special MIME type or authentication. Servlets that are registered with the same HttpContext object share the same ServletContext. Servlets can be registered using the registerServlet method. Resources can be registered using the registerResource method.

Configuring HttpService

The HttpService configurations described here are specific to the implementation of HttpService that is included in ServiceTango. HttpService has a limited number of configuration options. You can control the HTTP port, the maximum number of threads, and the thread priority.

For more specific information about the HttpService API, see the OSGi API specification.