|
Errai 3.0.1-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.errai.ioc.rebind.ioc.injector.AbstractInjector
public abstract class AbstractInjector
Nested Class Summary | |
---|---|
protected static class |
AbstractInjector.RegisterCache
|
Field Summary | |
---|---|
protected AbstractInjector.RegisterCache |
_registerCache
|
protected boolean |
alternative
|
protected Map<String,Object> |
attributes
|
protected boolean |
basic
|
protected String |
beanName
|
protected String |
creationalCallbackVarName
|
protected boolean |
enabled
|
protected MetaClass |
enclosingType
|
protected String |
postInitCallbackVar
|
protected String |
preDestroyCallbackVar
|
protected boolean |
provider
|
protected QualifyingMetadata |
qualifyingMetadata
|
protected MetaParameterizedType |
qualifyingTypeInformation
|
protected boolean |
replaceable
|
protected boolean |
singleton
|
protected boolean |
softDisabled
|
protected boolean |
testMock
|
Constructor Summary | |
---|---|
AbstractInjector()
|
Method Summary | |
---|---|
void |
addDisablingHook(Runnable runnable)
Add a Runnable task to be executed when and if the injector is disabled. |
void |
addInvokeAfter(MetaMethod method,
Statement statement)
Adds an invoke after statement on the specified method. |
void |
addInvokeAround(MetaMethod method,
Statement statement)
Adds an invoke around statement on the specified method. |
void |
addInvokeBefore(MetaMethod method,
Statement statement)
Adds an invoke before statement on the specified method. |
ProxyMaker.ProxyProperty |
addProxyProperty(String propertyName,
Class type,
Statement statement)
Adds a proxy property to the generated proxy. |
ProxyMaker.ProxyProperty |
addProxyProperty(String propertyName,
MetaClass type,
Statement statementReference)
Adds a proxy property to the generated proxy. |
void |
addRegistrationHook(RegistrationHook registrationHook)
Adds a registration hook to be triggered when the bean is ready to render its registration to be bean manager |
void |
addRenderingHook(RenderingHook renderingHook)
Adds a RenderingHook which will be triggered when the injector is rendered. |
void |
addStatementToEndOfInjector(Statement statement)
Add a statement to the end of the bean injector code. |
List<Statement> |
createProxyDeclaration(InjectionContext context)
|
List<Statement> |
createProxyDeclaration(InjectionContext context,
Statement beanRef)
|
protected void |
disableSoftly()
|
List<Statement> |
getAddToEndStatements()
|
Object |
getAttribute(String name)
Gets a persistent attribute associated with this injector. |
String |
getBeanName()
Get the name of the bean (if it has a name). |
MetaClass |
getConcreteInjectedType()
Returns the concrete type that will be returned by this injector. |
String |
getCreationalCallbackVarName()
The unique variable name for a BeanProvider associated with this bean. |
protected List<Runnable> |
getDisablingCallbacks()
|
MetaClass |
getEnclosingType()
The enclosing type of the injector. |
String |
getInstanceVarName()
The unique variable name for the bean instance. |
static QualifyingMetadata |
getMetadataWithAny(QualifyingMetadata metadata)
|
String |
getPostInitCallbackVar()
The unique variable name for the InitalizationCallback associated with a bean CreationalContext in the boostrapper method. |
String |
getPreDestroyCallbackVar()
The unique variable name for the DestructionCallback associated with the BeanProvider for this bean. |
String |
getProxyInstanceVarName()
The unique variable name for the proxied bean instance. |
Map<String,ProxyMaker.ProxyProperty> |
getProxyPropertyMap()
Returns a map of all proxy properties in the injector. |
QualifyingMetadata |
getQualifyingMetadata()
Returns the QualifyingMetadata associated with this injector. |
MetaParameterizedType |
getQualifyingTypeInformation()
Returns parameterized type data associated with this injector |
protected List<RegistrationHook> |
getRegistrationHooks()
|
protected List<RenderingHook> |
getRenderingHooks()
|
Map<MetaMethod,Map<WeaveType,Collection<Statement>>> |
getWeavingStatements()
|
Map<MetaMethod,Map<WeaveType,Collection<Statement>>> |
getWeavingStatementsMap()
|
boolean |
hasAttribute(String name)
Checks if injector has the specified named attribute |
protected static boolean |
hasNewQualifier(InjectableInstance instance)
|
boolean |
isAlternative()
Checks if the injector an alternative. |
boolean |
isCreated()
Checks if construction has begun. |
boolean |
isDependent()
Check if the injector if of the dependent scope. |
boolean |
isEnabled()
Checks if the injector is enabled, and is eligible for injection consideration. |
boolean |
isProvider()
Checks if the injector represents a provider. |
boolean |
isProxied()
Checks if the injector is a proxied injector. |
boolean |
isPseudo()
Checks if the injector is a psuedo bean. |
boolean |
isRegularTypeInjector()
Returns true if the injector type is a regular type injector. |
boolean |
isRendered()
Checks if the injector's BeanProvider already been rendered. |
boolean |
isSingleton()
Checks if the injector for a singleton bean. |
boolean |
isSoftDisabled()
Checks if the injector is soft disabled. |
boolean |
isStatic()
Checks is the injector is a static injector, meaning that it can safely be referenced from anywhere, without concern for ordering of its declaring class. |
boolean |
isTestMock()
Checks if the injector represents a test mock. |
protected void |
markRendered(InjectableInstance injectableInstance)
|
boolean |
matches(MetaParameterizedType parameterizedType,
QualifyingMetadata qualifyingMetadata)
Determines whether or not the the bean type this injector producers matches the specified parameterized type and qualifying metadata. |
void |
registerWithBeanManager(InjectionContext context,
Statement valueRef)
|
void |
setAttribute(String name,
Object value)
Sets a persistent attribute to be associated with this injector. |
void |
setCreated(boolean created)
|
void |
setCreationalCallbackVarName(String creationalCallbackVarName)
|
void |
setEnabled(boolean enabled)
Set the enabled state of the bean. |
void |
setPostInitCallbackVar(String var)
Sets a variable name reference to the InitializationCallback to associate with the BeanProvider for this bean. |
void |
setPreDestroyCallbackVar(String preDestroyCallbackVar)
Sets a variable name reference to the DestructionCallback to associate with this BeanProvider for this bean. |
void |
setRendered(boolean rendered)
|
void |
setReplaceable(boolean replaceable)
|
void |
setSoftDisabled(boolean softDisabled)
|
String |
toString()
|
void |
updateProxies()
This method should be called to ensure that the proxies have been updated to reflect any code weavings that may have been added. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.jboss.errai.ioc.rebind.ioc.injector.Injector |
---|
getBeanInstance, getInjectedType, renderProvider |
Field Detail |
---|
protected QualifyingMetadata qualifyingMetadata
protected MetaParameterizedType qualifyingTypeInformation
protected String postInitCallbackVar
protected String preDestroyCallbackVar
protected String creationalCallbackVarName
protected boolean enabled
protected boolean softDisabled
protected boolean testMock
protected boolean alternative
protected boolean singleton
protected boolean replaceable
protected boolean provider
protected boolean basic
protected MetaClass enclosingType
protected String beanName
protected Map<String,Object> attributes
protected AbstractInjector.RegisterCache _registerCache
Constructor Detail |
---|
public AbstractInjector()
Method Detail |
---|
public boolean isTestMock()
Injector
isTestMock
in interface Injector
public boolean isAlternative()
Injector
isAlternative
in interface Injector
public boolean isRendered()
Injector
isRendered
in interface Injector
public boolean isSingleton()
Injector
isSingleton
in interface Injector
public boolean isDependent()
Injector
isDependent
in interface Injector
public boolean isPseudo()
Injector
isPseudo
in interface Injector
public boolean isProvider()
Injector
isProvider
in interface Injector
public boolean isStatic()
Injector
isStatic
in interface Injector
public MetaClass getEnclosingType()
Injector
getEnclosingType
in interface Injector
public boolean isCreated()
Injector
isCreated
in interface Injector
public void setCreated(boolean created)
public void setRendered(boolean rendered)
public void setReplaceable(boolean replaceable)
public String getPostInitCallbackVar()
Injector
getPostInitCallbackVar
in interface Injector
public void setPostInitCallbackVar(String var)
Injector
setPostInitCallbackVar
in interface Injector
var
- a unique variable name pointing to an instance of InitializationCallback.public String getPreDestroyCallbackVar()
Injector
getPreDestroyCallbackVar
in interface Injector
public void setPreDestroyCallbackVar(String preDestroyCallbackVar)
Injector
setPreDestroyCallbackVar
in interface Injector
preDestroyCallbackVar
- a unique variable name pointing to an instance of InitializationCallbackpublic String getCreationalCallbackVarName()
Injector
getCreationalCallbackVarName
in interface Injector
public void setCreationalCallbackVarName(String creationalCallbackVarName)
public boolean matches(MetaParameterizedType parameterizedType, QualifyingMetadata qualifyingMetadata)
Injector
matches
in interface Injector
parameterizedType
- the parameterized type to compare against.qualifyingMetadata
- the qualifying metadata to compare against
public QualifyingMetadata getQualifyingMetadata()
Injector
getQualifyingMetadata
in interface Injector
public MetaParameterizedType getQualifyingTypeInformation()
Injector
getQualifyingTypeInformation
in interface Injector
public String getProxyInstanceVarName()
Injector
getProxyInstanceVarName
in interface Injector
public String getInstanceVarName()
Injector
getInstanceVarName
in interface Injector
public void addRegistrationHook(RegistrationHook registrationHook)
Injector
addRegistrationHook
in interface Injector
registrationHook
- a registration hook to be called at registration of the bean with the bean manager.public void registerWithBeanManager(InjectionContext context, Statement valueRef)
public void addRenderingHook(RenderingHook renderingHook)
Injector
RenderingHook
which will be triggered when the injector is rendered.
addRenderingHook
in interface Injector
renderingHook
- an instance of RenderingHook
to be called when the injector is rendered.protected void markRendered(InjectableInstance injectableInstance)
public String toString()
toString
in class Object
public String getBeanName()
Injector
getBeanName
in interface Injector
public boolean isEnabled()
Injector
isEnabled
in interface Injector
public boolean isSoftDisabled()
Injector
isSoftDisabled
in interface Injector
public void setSoftDisabled(boolean softDisabled)
protected void disableSoftly()
public void setEnabled(boolean enabled)
Injector
setEnabled
in interface Injector
enabled
- the enabled state of the bean to set (true for enabled, false for disabled).public void addDisablingHook(Runnable runnable)
Injector
Runnable
task to be executed when and if the injector is disabled.
addDisablingHook
in interface Injector
runnable
- an instance of Runnable
to be called if the injector is disabled.public boolean isRegularTypeInjector()
Injector
isRegularTypeInjector
in interface Injector
protected static boolean hasNewQualifier(InjectableInstance instance)
public MetaClass getConcreteInjectedType()
Injector
getConcreteInjectedType
in interface Injector
protected List<RegistrationHook> getRegistrationHooks()
protected List<RenderingHook> getRenderingHooks()
protected List<Runnable> getDisablingCallbacks()
public void setAttribute(String name, Object value)
Injector
setAttribute
in interface Injector
name
- the name of the attributevalue
- the value of the attribute.public Object getAttribute(String name)
Injector
getAttribute
in interface Injector
name
- the name of the attribute
public boolean hasAttribute(String name)
Injector
hasAttribute
in interface Injector
name
- the name of the attribute.
public Map<MetaMethod,Map<WeaveType,Collection<Statement>>> getWeavingStatements()
public Map<MetaMethod,Map<WeaveType,Collection<Statement>>> getWeavingStatementsMap()
public Map<String,ProxyMaker.ProxyProperty> getProxyPropertyMap()
Injector
ProxyMaker.ProxyProperty
references.
getProxyPropertyMap
in interface Injector
public List<Statement> getAddToEndStatements()
public void addStatementToEndOfInjector(Statement statement)
addStatementToEndOfInjector
in interface Injector
statement
- public boolean isProxied()
Injector
BeanProvider
returns a proxy, rather than a direct reference to a bean.
isProxied
in interface Injector
public List<Statement> createProxyDeclaration(InjectionContext context)
public List<Statement> createProxyDeclaration(InjectionContext context, Statement beanRef)
public void addInvokeAround(MetaMethod method, Statement statement)
Injector
addInvokeAround
in interface Injector
method
- the method to invoke aroundstatement
- the statement to execute.public void addInvokeBefore(MetaMethod method, Statement statement)
Injector
addInvokeBefore
in interface Injector
method
- the method to invoke aroundstatement
- the statement to execute.public void addInvokeAfter(MetaMethod method, Statement statement)
Injector
addInvokeAfter
in interface Injector
method
- the method to invoke aroundstatement
- the statement to execute.public ProxyMaker.ProxyProperty addProxyProperty(String propertyName, Class type, Statement statement)
Injector
addProxyProperty
in interface Injector
propertyName
- the name of the property.type
- the type of the property.statement
- the statement which will yield the value to be put into the property.
ProxyMaker.ProxyProperty
reference which can be used as a regular
statement reference in Errai Codegen. The instance of ProxyProperty can be used in generated code
(such as in AOP statements) to refer to the injected proxy property.public ProxyMaker.ProxyProperty addProxyProperty(String propertyName, MetaClass type, Statement statementReference)
Injector
addProxyProperty
in interface Injector
propertyName
- the name of the property.type
- the type of the property.statementReference
- the statement which will yield the value to be put into the property.
ProxyMaker.ProxyProperty
reference which can be used as a regular
statement reference in Errai Codegen. The instance of ProxyProperty can be used in generated code
(such as in AOP statements) to refer to the injected proxy property.public void updateProxies()
Injector
updateProxies
in interface Injector
public static QualifyingMetadata getMetadataWithAny(QualifyingMetadata metadata)
|
Errai 3.0.1-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |