Component Context

A component context provides access to the context in which a component executes. The context includes the component's name and containing application name, the node on which it executes, the host managing the node, context parameters available to the component, the component's work area, and so on.

To access the component context, add the following declarations to a Java or Spring component implementation:
import org.osoa.sca.annotations.Context;
import com.tibco.amf.platform.runtime.extension.context.ComponentContext;
@Context
public ComponentContext componentContext;

These declarations are automatically added to the abstract component implementation when a context parameter is defined for the component. The TIBCO ActiveMatrix platform injects the component context object into the component implementation.

If a component implementation wants to create a file, it should do so in the work area assigned to each component. The TIBCO ActiveMatrix platform ensures that these files are deleted when the component is undeployed. Work areas are backed up during node upgrade. A component implementation can retrieve its work area through the component context's getWorkArea() method which returns the java.io.File object that represent the work area folder for that component.