org.jasig.portal.layout
Class UserLayoutStoreFactory

java.lang.Object
  extended by org.jasig.portal.layout.UserLayoutStoreFactory

public final class UserLayoutStoreFactory
extends Object

Produces and manages a static singleton instance of IUserLayoutStore. The IUserLayoutStore implementation that we use is that named by the portal.properties property "org.jasig.portal.layout.UserLayoutStoreFactory.implementation". In the case where that property is not set or the IUserLayoutStore it names cannot be instantiated, we fall back on the RDBMDistributedLayoutStore as the default. Prior to uPortal 2.5, this class existed in the package org.jasig.portal. It has been moved to its present package to express that it is part of the user layout infrastructure. This class is final because it is not designed to be subclassed.

Version:
$Revision: 19776 $ $Date: 2010-01-14 16:17:21 -0600 (Thu, 14 Jan 2010) $
Author:
Ken Weiner, kweiner@unicon.net, Michael Ivanov, mvi@immagic.com

Field Summary
static String LAYOUT_STORE_IMPL_PROPERTY
          The name of the portal.properties property the value of which is the name of the IUserLayoutStore implementation we should use.
 
Constructor Summary
UserLayoutStoreFactory()
           
 
Method Summary
static IUserLayoutStore getUserLayoutStoreImpl()
          Returns the singleton IUserLayoutStore instance, which will be that specified in portal.properties, an instance of the default IUserLayoutStore, or null, in that order.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LAYOUT_STORE_IMPL_PROPERTY

public static final String LAYOUT_STORE_IMPL_PROPERTY
The name of the portal.properties property the value of which is the name of the IUserLayoutStore implementation we should use.

See Also:
Constant Field Values
Constructor Detail

UserLayoutStoreFactory

public UserLayoutStoreFactory()
Method Detail

getUserLayoutStoreImpl

public static IUserLayoutStore getUserLayoutStoreImpl()
Returns the singleton IUserLayoutStore instance, which will be that specified in portal.properties, an instance of the default IUserLayoutStore, or null, in that order. That is, we return a static singleton IUserLayoutStore instance when possible, prefering to return an instance of the IUserLayoutStore implementation named in our portal.properties property. If that property is not set or that implementation cannot be successfully instantiated, we will return an instance of the default IUserLayoutStore implementation. If we cannot instantiate that default IUserLayoutStore we will return null. This method is synchronized to ensure a consistent return value, resolving a double checked locking problem. By synchronizing, we ensure that when we write to the userLayoutStoreImpl static field, that write will be available to other threads when they obtain the lock and enter this method.

Returns:
the configured or default IUserLayoutStore implementation, or null


Copyright © 2010 Jasig. All Rights Reserved.