com.ibm.websphere.personalization.applicationObjects
Interface SelfInitializingApplicationObject


public interface SelfInitializingApplicationObject

This class may be implemented by application objects for the Personalization engine to automatically create the application object when needed in a rule.

Normally, Personalization looks up application objects on the session by key. When an application object is declared to Personalization, the class name (for any old Java bean) and the key in the session where an instance can be found must be given. In version 6, Personalization now checks the request and then the session.

Version 6 also introduced the concept of a SelfInitializingApplicationObject. If an application object implements this interface and the engine does not find the application object on the request or session at the provided key, the engine will instantiate the application object and call an init method on the SelfInitializingApplicationObject interface.

On the init call the engine will pass in the Personalization RequestContext object that contains the request. The application object can put itself on the request or session if so desired. If the application object does store itself on the request or session at the key specified in the application object definition, later uses of the object by the engine will find the object and not incur additional object instantiation.

By using SelfInitializingApplicationObjects, objects can be added to the rule editor without putting a burden on the caller of the rules to instantiate an object and put in on the request. The object instantiation is then also deferred until the rule actually needs to reference the application object.

Often instances of this class are just proxies which offer specialized views of data stored on the request, session, or data accessible given the request.


Method Summary
 void init(RequestContext ctx)
           
 

Method Detail

init

void init(RequestContext ctx)