net.lessy.util.configuration
Class Environment

java.lang.Object
  extended by net.lessy.util.configuration.Environment
All Implemented Interfaces:
Environmentable, org.springframework.context.ApplicationContextAware

Deprecated. What was meant to be convenience, turns out to be pain in the butt

public class Environment
extends Object
implements org.springframework.context.ApplicationContextAware, Environmentable

Global Environment initializes the Spring-Beans factory acts as a factory for those Beans

Author:
Hans Lesmeister

Constructor Summary
Environment()
          Deprecated. Default Constructor.
 
Method Summary
protected  void afterInitialize(org.springframework.context.ApplicationContext applicationContext)
          Deprecated. Is called after the default context has been loaded.
 org.springframework.context.ApplicationContext getApplicationContext()
          Deprecated. Gets the Application Context
static Environment getInstance()
          Deprecated. Gets the singleton instance of the environment
static void initialize()
          Deprecated. Initializes the Environment.
 void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
          Deprecated. Setter for the spring application context called by Spring
 void shutDown()
          Deprecated. De-Initializes the Environment, i.e. at the end of the Application.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Environment

public Environment()
Deprecated. 
Default Constructor.

Throws:
IllegalStateException - if the constructor is called more then once. Only call it once because it is a singleton
Method Detail

initialize

public static void initialize()
Deprecated. 
Initializes the Environment. In a web-environment this is best done in the Context-Listener (i.e. at the start of the application). This method is intended to run exactly once and there fore it is not synchronized


getInstance

public static Environment getInstance()
Deprecated. 
Gets the singleton instance of the environment

Returns:
Environment-Instance

shutDown

public void shutDown()
Deprecated. 
De-Initializes the Environment, i.e. at the end of the Application. In a web-environment this is best done in the Context-Listener. You can override this method to add application specific clean-work.
Do not forget to call super.

Specified by:
shutDown in interface Environmentable

afterInitialize

protected void afterInitialize(org.springframework.context.ApplicationContext applicationContext)
Deprecated. 
Is called after the default context has been loaded. Can be explicitly be overridden by implementors.

Parameters:
applicationContext -

setApplicationContext

public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
                           throws org.springframework.beans.BeansException
Deprecated. 
Setter for the spring application context called by Spring

Specified by:
setApplicationContext in interface org.springframework.context.ApplicationContextAware
Parameters:
applicationContext -
Throws:
org.springframework.beans.BeansException

getApplicationContext

public org.springframework.context.ApplicationContext getApplicationContext()
Deprecated. 
Gets the Application Context

Returns:
Application Context


Copyright © 2012. All Rights Reserved.