edu.internet2.middleware.shibboleth.common.config.service
Class ServletContextAttributeExporter

java.lang.Object
  extended by edu.internet2.middleware.shibboleth.common.config.service.ServletContextAttributeExporter
All Implemented Interfaces:
Service, org.springframework.beans.factory.BeanNameAware, org.springframework.context.ApplicationContextAware

public class ServletContextAttributeExporter
extends Object
implements Service, org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.BeanNameAware

A simple service that exports Spring beans into the Servlet context as an attribute.


Field Summary
private  org.springframework.context.ApplicationContext appCtx
          Application context into which we're loaded.
private  Collection<String> exportedBeans
          ID of beans exported into the servlet context.
private  String id
          ID of this service.
private  boolean initialized
          Whether this service has been initialized.
private  org.slf4j.Logger log
          Class logger.
 
Constructor Summary
ServletContextAttributeExporter(Collection<String> beans)
          Constructor.
 
Method Summary
 void destroy()
          Destroys a service, freeing any resources it may currently be using.
 String getId()
          Gets the ID of this service.
 void initialize()
          Initializes this service.
 boolean isDestroyed()
          Gets whether the service has been destroyed.
 boolean isInitialized()
          Gets whether the service is initialized and ready for use.
 void setApplicationContext(org.springframework.context.ApplicationContext context)
          
 void setBeanName(String name)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private final org.slf4j.Logger log
Class logger.


appCtx

private org.springframework.context.ApplicationContext appCtx
Application context into which we're loaded.


id

private String id
ID of this service.


initialized

private boolean initialized
Whether this service has been initialized.


exportedBeans

private Collection<String> exportedBeans
ID of beans exported into the servlet context.

Constructor Detail

ServletContextAttributeExporter

public ServletContextAttributeExporter(Collection<String> beans)
Constructor.

Parameters:
beans - ID of beans exported into the servlet context
Method Detail

destroy

public void destroy()
             throws ServiceException
Destroys a service, freeing any resources it may currently be using. Whether a service can be re-initialized after being destroyed is implementation dependent.

Specified by:
destroy in interface Service
Throws:
ServiceException - thrown if there is a problem destroying the service

getId

public String getId()
Gets the ID of this service.

Specified by:
getId in interface Service
Returns:
ID of this service

initialize

public void initialize()
                throws ServiceException
Initializes this service. Calling this on an initialized service should return immediately without affecting any service state.

Specified by:
initialize in interface Service
Throws:
ServiceException - thrown if there is a problem initializing the service

isInitialized

public boolean isInitialized()
Gets whether the service is initialized and ready for use.

Specified by:
isInitialized in interface Service
Returns:
true if the service is ready for use, false it not

setApplicationContext

public void setApplicationContext(org.springframework.context.ApplicationContext context)

Specified by:
setApplicationContext in interface org.springframework.context.ApplicationContextAware

setBeanName

public void setBeanName(String name)

Specified by:
setBeanName in interface org.springframework.beans.factory.BeanNameAware

isDestroyed

public boolean isDestroyed()
Gets whether the service has been destroyed.

Specified by:
isDestroyed in interface Service
Returns:
true if the service has been destroyed


Copyright © 1999-2012. All Rights Reserved.