Use the pushRealmId
and popRealmId
methods of the /atg/multisite/ProfileRealmManager
component to explicitly set the profile realm context for the current thread. Include the identifier of the profile realm as the arguments to these methods. The following example code sets and then removes a profile realm context.
// Obtain a reference to the ProfileRealmManager // component. This example code assumes the following // property configuration: // // profilerealmmanager=/atg/multisite/ProfileRealmManager/ try { // Set the profile realm context profilerealmmanager.pushRealmId("myrealmid"); // Perform operations that require the profile realm context. } finally { // Remove the profile realm context profilerealmmanager.popRealmId("myrealmid"); }