Personalization - Resource Classloading

 


+ Search Tips   |   Advanced Search

+ Search Tips   |   Advanced Search

 

The recommended location for generated content spot classes and resource collection classes is in a WebSphere Application Server shared library. When a rule is executed, Personalization uses the classloader of the content spot to load any resource collections or application objects required for that rule. If you are using the default com.ibm.websphere.personalization.ContentSpot class to execute rules, then that classloader is the Personalization shared library classloader. In this scenario, your resource collections and application objects must be visible to the classloader of the com.ibm.websphere.personalization.ContentSpot class.

With a generated content spot class, you have the flexibility to place this class and any associated resource collections directly in a web module or portlet application, but they must also be available to the Personalization portlets. Whichever mechanism you use for content spots, the best way to ensure that your resource collection classes are available is to put them in a shared library on the appserver.

In previous versions of Personalization, the user interface classes were loaded dynamically out of other web applications, out of databases, and out of other paths entered by the user. In the current version of Personalization, the content spot and resource collections must be on the classpath for the Personalization portlets. The best way to achieve this is through use of a shared library.

If you use the Personalization resource wizard in Rational Application Developer to create the resource classes in a Web or portlet project, those generated classes will be deployed in the Web module and not be available to the Personalization portlets. You will have to put these classes on a shared library and make that shared library available to the Personalization portlets.

Classes in a shared library are only reloaded when the appserver is reloaded. Classes in a Web module are reloaded when the Web module is reloaded.

  • Ensure the global uniqueness of the class names by using package names.

  • In a cluster of appservers, be sure to copy your content spot and resource classes to each application server in the cluster.

     

    Parent topic:

    Using the Personalization APIs

     

    See also


    Resource interface
    APIs for multivalue properties
    Home |

     

    WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.

     

    IBM is a trademark of the IBM Corporation in the United States, other countries, or both.

     

    Rational is a trademark of the IBM Corporation in the United States, other countries, or both.