net.sf.vcaperture.util.spring
Class ApplicationContextFactory

java.lang.Object
  extended by net.sf.vcaperture.util.spring.ApplicationContextFactory
All Implemented Interfaces:
org.springframework.context.ApplicationContextAware

public class ApplicationContextFactory
extends java.lang.Object
implements org.springframework.context.ApplicationContextAware

The static factory which provides the context as necesary within the application.

TODO: This class assumes that only one context will ever be used within the container in which it is running. It could make use of a ThreadLocal (or similar) to provide for multiple contexts to be available.

TODO: Not so much a factory as it is a locator. Perhaps should be renamed.

Author:
Jeremy Thomerson (jthomerson@users.sourceforge.net)

Nested Class Summary
private static class ApplicationContextFactory.AppContextWrapper
           
 
Field Summary
private static ApplicationContextFactory INSTANCE
           
private  IApplicationContext mWrapper
           
 
Constructor Summary
ApplicationContextFactory()
           
 
Method Summary
 IApplicationContext getContext()
           
static ApplicationContextFactory getFactory()
           
 void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
           
 void setContext(org.springframework.context.ApplicationContext context)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

private static final ApplicationContextFactory INSTANCE

mWrapper

private IApplicationContext mWrapper
Constructor Detail

ApplicationContextFactory

public ApplicationContextFactory()
Method Detail

getFactory

public static ApplicationContextFactory getFactory()

getContext

public final IApplicationContext getContext()

setContext

public final void setContext(org.springframework.context.ApplicationContext context)

setApplicationContext

public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
                           throws org.springframework.beans.BeansException
Specified by:
setApplicationContext in interface org.springframework.context.ApplicationContextAware
Throws:
org.springframework.beans.BeansException


Copyright © 2008. All Rights Reserved.