|
Errai 3.0.1-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Injector
Defines an injector which is responsible for providing instance references of beans to the code generating container.
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 statement)
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)
Adds a statement to be appended to the end of the generated BeanProvider
code. |
Object |
getAttribute(String name)
Gets a persistent attribute associated with this injector. |
Statement |
getBeanInstance(InjectableInstance injectableInstance)
Return a statement providing access to the injector (or null for asynchronous logic) |
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. |
MetaClass |
getEnclosingType()
The enclosing type of the injector. |
MetaClass |
getInjectedType()
The injected type of the injector. |
String |
getInstanceVarName()
The unique variable name for the bean instance. |
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 |
boolean |
hasAttribute(String name)
Checks if injector has the specified named attribute |
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. |
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 |
renderProvider(InjectableInstance injectableInstance)
|
void |
setAttribute(String name,
Object value)
Sets a persistent attribute to be associated with this injector. |
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 |
updateProxies()
This method should be called to ensure that the proxies have been updated to reflect any code weavings that may have been added. |
Method Detail |
---|
void renderProvider(InjectableInstance injectableInstance)
Statement getBeanInstance(InjectableInstance injectableInstance)
injectableInstance
-
boolean isEnabled()
boolean isSoftDisabled()
boolean isTestMock()
boolean isAlternative()
boolean isRendered()
boolean isCreated()
boolean isSingleton()
boolean isDependent()
boolean isPseudo()
boolean isProvider()
boolean isStatic()
MetaClass getEnclosingType()
MetaClass getInjectedType()
MetaClass getConcreteInjectedType()
String getInstanceVarName()
String getProxyInstanceVarName()
String getPostInitCallbackVar()
void setPostInitCallbackVar(String var)
var
- a unique variable name pointing to an instance of InitializationCallback.String getPreDestroyCallbackVar()
void setPreDestroyCallbackVar(String preDestroyCallbackVar)
preDestroyCallbackVar
- a unique variable name pointing to an instance of InitializationCallbackString getCreationalCallbackVarName()
boolean matches(MetaParameterizedType parameterizedType, QualifyingMetadata qualifyingMetadata)
parameterizedType
- the parameterized type to compare against.qualifyingMetadata
- the qualifying metadata to compare against
QualifyingMetadata getQualifyingMetadata()
MetaParameterizedType getQualifyingTypeInformation()
void addRegistrationHook(RegistrationHook registrationHook)
registrationHook
- a registration hook to be called at registration of the bean with the bean manager.void addRenderingHook(RenderingHook renderingHook)
RenderingHook
which will be triggered when the injector is rendered.
renderingHook
- an instance of RenderingHook
to be called when the injector is rendered.void addDisablingHook(Runnable runnable)
Runnable
task to be executed when and if the injector is disabled.
runnable
- an instance of Runnable
to be called if the injector is disabled.String getBeanName()
void setEnabled(boolean enabled)
enabled
- the enabled state of the bean to set (true for enabled, false for disabled).boolean isRegularTypeInjector()
void setAttribute(String name, Object value)
name
- the name of the attributevalue
- the value of the attribute.Object getAttribute(String name)
name
- the name of the attribute
boolean hasAttribute(String name)
name
- the name of the attribute.
boolean isProxied()
BeanProvider
returns a proxy, rather than a direct reference to a bean.
void addStatementToEndOfInjector(Statement statement)
BeanProvider
code. Statements added here will be executed after all bean wiring activity has finished.
statement
- void addInvokeAround(MetaMethod method, Statement statement)
method
- the method to invoke aroundstatement
- the statement to execute.void addInvokeBefore(MetaMethod method, Statement statement)
method
- the method to invoke aroundstatement
- the statement to execute.void addInvokeAfter(MetaMethod method, Statement statement)
method
- the method to invoke aroundstatement
- the statement to execute.ProxyMaker.ProxyProperty addProxyProperty(String propertyName, Class type, Statement statement)
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.ProxyMaker.ProxyProperty addProxyProperty(String propertyName, MetaClass type, Statement statement)
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.Map<String,ProxyMaker.ProxyProperty> getProxyPropertyMap()
ProxyMaker.ProxyProperty
references.
void updateProxies()
|
Errai 3.0.1-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |