net.sf.doolin.context
Class AbstractApplication

java.lang.Object
  extended by net.sf.doolin.context.AbstractApplication
All Implemented Interfaces:
Application, org.springframework.context.ApplicationContextAware
Direct Known Subclasses:
GUIApplication

public abstract class AbstractApplication
extends Object
implements Application, org.springframework.context.ApplicationContextAware

Abstract application based on a Spring application context.

Author:
Damien Coraboeuf

Constructor Summary
AbstractApplication()
           
 
Method Summary
<T> T
getBean(Class<T> idClass)
          Gets a bean from the application, using a class as an identifier.
 Object getBean(String id)
          Gets a bean from the application.
 boolean isDefined(Class<?> idClass)
          Checks if a bean is defined in the application, using a class as an identifier.
 boolean isDefined(String id)
          Checks if a bean is defined in the application
 void setApplicationContext(org.springframework.context.ApplicationContext ctx)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.doolin.context.Application
start
 

Constructor Detail

AbstractApplication

public AbstractApplication()
Method Detail

setApplicationContext

public void setApplicationContext(org.springframework.context.ApplicationContext ctx)
                           throws org.springframework.beans.BeansException

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

getBean

public <T> T getBean(Class<T> idClass)
Gets a bean from the application, using a class as an identifier.

Type Parameters:
T - Type of the bean
Parameters:
idClass - Class as an ID
Returns:
Bean

isDefined

public boolean isDefined(Class<?> idClass)
Checks if a bean is defined in the application, using a class as an identifier.

Parameters:
idClass - Class as an ID
Returns:
true if the bean is defined

isDefined

public boolean isDefined(String id)
Checks if a bean is defined in the application

Parameters:
id - Bean ID
Returns:
true if the bean is defined

getBean

public Object getBean(String id)
Gets a bean from the application.

Parameters:
id - Bean ID
Returns:
Bean


Copyright © 2011. All Rights Reserved.