public class ApplicationObjectSupport
extends java.lang.Object
Title: ApplicationObjectSupport.java
Description:
bboss workgroup
Copyright (c) 2007
| 限定符和类型 | 字段和说明 |
|---|---|
protected org.slf4j.Logger |
logger
Logger that is available to subclasses
|
| 构造器和说明 |
|---|
ApplicationObjectSupport() |
| 限定符和类型 | 方法和说明 |
|---|---|
BaseApplicationContext |
getApplicationContext()
Return the ApplicationContext that this object is associated with.
|
protected MessageSourceAccessor |
getMessageSourceAccessor()
Return a MessageSourceAccessor for the application context
used by this object, for easy message access.
|
protected void |
initApplicationContext()
Subclasses can override this for custom initialization behavior.
|
protected void |
initApplicationContext(BaseApplicationContext context)
Subclasses can override this for custom initialization behavior.
|
protected boolean |
isContextRequired()
Determine whether this application object needs to run in an ApplicationContext.
|
protected java.lang.Class |
requiredContextClass()
Determine the context class that any context passed to
setApplicationContext must be an instance of. |
void |
setApplicationContext(BaseApplicationContext context) |
public final void setApplicationContext(BaseApplicationContext context) throws com.frameworkset.spi.assemble.BeanInstanceException
com.frameworkset.spi.assemble.BeanInstanceExceptionprotected boolean isContextRequired()
Default is "false". Can be overridden to enforce running in a context (i.e. to throw IllegalStateException on accessors if outside a context).
protected java.lang.Class requiredContextClass()
setApplicationContext must be an instance of.
Can be overridden in subclasses.protected void initApplicationContext(BaseApplicationContext context) throws java.lang.RuntimeException
setApplicationContext after setting the context instance.
Note: Does not get called on reinitialization of the context but rather just on first initialization of this object's context reference.
The default implementation calls the overloaded initApplicationContext()
method without ApplicationContext reference.
context - the containing ApplicationContextApplicationContextException - in case of initialization errorsjava.lang.Exception - if thrown by ApplicationContext methodsjava.lang.RuntimeExceptionsetApplicationContext(org.frameworkset.spi.BaseApplicationContext)protected void initApplicationContext()
throws java.lang.RuntimeException
The default implementation is empty. Called by
initApplicationContext().
ApplicationContextException - in case of initialization errorsjava.lang.Exception - if thrown by ApplicationContext methodsjava.lang.RuntimeExceptionsetApplicationContext(org.frameworkset.spi.BaseApplicationContext)public final BaseApplicationContext getApplicationContext() throws java.lang.IllegalStateException
java.lang.IllegalStateException - if not running in an ApplicationContextprotected final MessageSourceAccessor getMessageSourceAccessor() throws java.lang.IllegalStateException
java.lang.IllegalStateException - if not running in an ApplicationContext