com.liferay.faces.util.factory
Class FactoryExtensionFinder

java.lang.Object
  extended by com.liferay.faces.util.factory.FactoryExtensionFinder

public abstract class FactoryExtensionFinder
extends Object

This class provides a factory lookup mechanism similar to the FactoryFinder in the JSF API. Factory instances are stored as attributes in the ExternalContext.getApplicationMap().

Author:
Neil Griffin

Constructor Summary
FactoryExtensionFinder()
           
 
Method Summary
static Object getFactory(Class<?> factoryClass)
          Deprecated. Call getFactory(ExternalContext, Class) instead.

Returns the factory instance associated with the specified factory class from the external context associated with the current faces context.

static Object getFactory(javax.faces.context.ExternalContext externalContext, Class<?> factoryClass)
          Returns the factory instance associated with the specified factory class from the specified external context.
abstract  Object getFactoryInstance(Class<?> factoryClass)
          Deprecated. Call getFactoryInstance(ExternalContext, Class) instead.

Returns the factory instance associated with the specified factory class from the external context associated with the current faces context.

abstract  Object getFactoryInstance(javax.faces.context.ExternalContext externalContext, Class<?> factoryClass)
          Returns the factory instance associated with the specified factory class from the specified external context.
static FactoryExtensionFinder getInstance()
          Returns the thread-safe Singleton instance of the factory extension finder.
abstract  void registerFactory(ConfiguredElement configuredFactoryExtension)
          Deprecated. Call registerFactory(ExternalContext, ConfiguredElement) instead.

Registers the specified configured factory extension by storing it as an attribute in the ExternalContext.getApplicationMap() associated with the current faces context. Since this method is designed to be called during application initialization, it is not guaranteed to be thread-safe.

abstract  void registerFactory(javax.faces.context.ExternalContext externalContext, ConfiguredElement configuredFactoryExtension)
          Registers the specified configured factory extension by storing it as an attribute in the specified ExternalContext.getApplicationMap().
abstract  void releaseFactories(javax.faces.context.ExternalContext externalContext)
          Releases all of the factories that were registered via the registerFactory(ExternalContext, ConfiguredElement) method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FactoryExtensionFinder

public FactoryExtensionFinder()
Method Detail

getFactory

@Deprecated
public static Object getFactory(Class<?> factoryClass)
Deprecated. Call getFactory(ExternalContext, Class) instead.

Returns the factory instance associated with the specified factory class from the external context associated with the current faces context.

Parameters:
factoryClass - The factory Class.

getFactory

public static Object getFactory(javax.faces.context.ExternalContext externalContext,
                                Class<?> factoryClass)
Returns the factory instance associated with the specified factory class from the specified external context.

Parameters:
externalContext - The external context associated with the current faces context.
factoryClass - The factory Class.

getInstance

public static FactoryExtensionFinder getInstance()
                                          throws javax.faces.FacesException
Returns the thread-safe Singleton instance of the factory extension finder.

Throws:
javax.faces.FacesException - When the factory extension finder cannot be discovered.

getFactoryInstance

@Deprecated
public abstract Object getFactoryInstance(Class<?> factoryClass)
Deprecated. Call getFactoryInstance(ExternalContext, Class) instead.

Returns the factory instance associated with the specified factory class from the external context associated with the current faces context.

Parameters:
factoryClass - The factory Class.

getFactoryInstance

public abstract Object getFactoryInstance(javax.faces.context.ExternalContext externalContext,
                                          Class<?> factoryClass)
Returns the factory instance associated with the specified factory class from the specified external context.

Parameters:
externalContext - The external context associated with the current faces context.
factoryClass - The factory Class.

registerFactory

@Deprecated
public abstract void registerFactory(ConfiguredElement configuredFactoryExtension)
Deprecated. Call registerFactory(ExternalContext, ConfiguredElement) instead.

Registers the specified configured factory extension by storing it as an attribute in the ExternalContext.getApplicationMap() associated with the current faces context. Since this method is designed to be called during application initialization, it is not guaranteed to be thread-safe.

Parameters:
configuredFactoryExtension - The configured factory extension.

registerFactory

public abstract void registerFactory(javax.faces.context.ExternalContext externalContext,
                                     ConfiguredElement configuredFactoryExtension)
Registers the specified configured factory extension by storing it as an attribute in the specified ExternalContext.getApplicationMap(). Since this method is designed to be called during application initialization, it is not guaranteed to be thread-safe.

Parameters:
externalContext - The external context associated with the current faces context.
configuredFactoryExtension - The configured factory extension.

releaseFactories

public abstract void releaseFactories(javax.faces.context.ExternalContext externalContext)
Releases all of the factories that were registered via the registerFactory(ExternalContext, ConfiguredElement) method. It is designed to be called when a webapp context is destroyed.



Copyright © 2019 Liferay, Inc.. All rights reserved.