*/
private SharedAddressbooksSessionBeanRemote shareBean;
+ /**
+ * Cached flag whether the user is sharing address books
+ */
+ private Boolean isUserSharing = null;
+
/**
* Default constructor
*/
if (!this.loginController.isUserLoggedIn()) {
// Not logged in
throw new FaceletException("This method can only be called as logged-in user."); //NOI18N
+ } else if (this.isUserSharing instanceof Boolean) {
+ // Return cached value
+ return this.isUserSharing;
}
// Call the proper bean
- return this.shareBean.isUserSharingAddressbooks(this.loginController.getLoggedInUser());
+ this.isUserSharing = this.shareBean.isUserSharingAddressbooks(this.loginController.getLoggedInUser());
+
+ // Return it
+ return this.isUserSharing;
}
}