org.eiichiro.jazzmaster.aspectj.frontend
Class AspectJInjection
java.lang.Object
org.eiichiro.jazzmaster.frontend.Injection
org.eiichiro.jazzmaster.aspectj.frontend.AspectJInjection
public class AspectJInjection
- extends org.eiichiro.jazzmaster.frontend.Injection
AspectJInjection is Injection extension implementation to
inject Jazzmaster service into application frontend with
AspectJ 5. With Jazzmaster
built-in Injection, you need to implement the following code to get a
service injected application frontend:
HelloFrontend frontend = Application.getFrontend(HelloFrontend.class);
With AspectJInjection, you can get it with the following code:
HelloFrontend helloFrontend = new HelloFrontend();
AspectJInjection is implemented as the aspect and weaven into
initialization (constructor execution) of @Frontend annotated class.
So, though you instantiate application frontend directly, you can get the
frontend instance that service has been injected.
AspectJInjection does not only make your code simple, but also make
easy to integrate Jazzmaster application frontend with third-party libraries.
For example, in case of using Apache Struts Action as Jazzmaster
application frontend. If you use Jazzmaster built-in Injection, you
need to customize the code of Apache Struts instantiating an Action
class. If you use AspectJInjection, the code of service injection has
been weaven into Action constructor. Therefore, you can use Apache
Struts Action as Jazzmaster application frontend with NO Struts code
enhancement.
- Author:
- Eiichiro Uchiumi
- See Also:
Injection,
Frontend,
Application
| Fields inherited from class org.eiichiro.jazzmaster.frontend.Injection |
logger |
|
Method Summary |
void |
adviceFrontendInitialization(org.aspectj.lang.JoinPoint joinPoint)
The advice which injects Jazzmaster service instance (proxy) into the
specified application frontend instance. |
void |
frontendInitialization()
The pointcut for weaving Injection into @Frontend
annotated class's constructor. |
| Methods inherited from class org.eiichiro.jazzmaster.frontend.Injection |
inject |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AspectJInjection
public AspectJInjection()
frontendInitialization
public void frontendInitialization()
- The pointcut for weaving
Injection into @Frontend
annotated class's constructor.
adviceFrontendInitialization
public void adviceFrontendInitialization(org.aspectj.lang.JoinPoint joinPoint)
- The advice which injects Jazzmaster service instance (proxy) into the
specified application frontend instance.
- Parameters:
joinPoint - The join point that represents @Frontend
annotated class's constructor execution.
Copyright © 2009-2012 Eiichiro Uchiumi. All Rights Reserved.