Aspects - Can't be more simpler - Solaris Rss

This is a discussion on Aspects - Can't be more simpler - Solaris Rss ; Develop and use "aspects" to believe how Fuji made it easier for you! You can start right here with your own "echo" aspect development.
In Fuji Milestone 9 (M9), aspects became more simpler and dynamic. Its a breeze to develop ...

Aspects - Can't be more simpler

Develop and use "aspects" to believe how Fuji made it easier for you! You can start right here with your own "echo" aspect development.

In Fuji Milestone 9 (M9), aspects became more simpler and dynamic. Its a breeze to develop and use aspects.

From M9 onwards, you can also have aspects that are integral to your integration application, by scoping thoseaspects with the components of that application and taking advantage of thatapplication's life cycle.Moreover, you can also develop "type"d aspects in that application itself by simple POJOs and then inject corresponding aspects.

A Java Developer develops an interceptor that can behave by its own set of properties. The interceptor can be "type"d , by which aspects can be injected to the Fuji runtime. The typed interceptor is an innovative design concept that cleared many obstacles to make aspects more appealing.

An aspects user can inject aspects to the fuji runtime by Fuji CLI (Command Line Interface), Integration Application, aspects archetypes and your own applications. He can also control the behavior of the aspects by changing the aspects property values through Fuji CLI.

Thats it! You have already developed and deployed "echo" typed aspect. And, Its time for injection of aspects.

Echo Aspect Injection

Aspects can be injected to Fuji runtime by CLI (Command LineInterface), by Integration Application or by your own application.Additionally, out-of-the-box aspects, like Log and Policy, can beinjected by their maven archetype projects.

The "type" of your interceptor is instrumental for creation and injection of dynamic aspects to the Fuji runtime.

Echo Aspect Injection by CLI command : create-aspect

The create-aspect command injects an aspect to the Fuji runtime. All interceptor scoping parameters, the "type" parameter and and aspect specific commands can be provided as part of the command. For example,

The above command injects "echo-1" aspect. The interceptor scope, status=Active, will trigger execution of this aspect, at every message exchange point of all the active messages. As per the logic of echo, for all active messages, we see the message,

Aspects can also be injected to Fuji runtime by integration applications. The life cycle of such aspects are tied to the application that contained them. Means, aspects are created when that application is installed and are deleted when that application uninstalled.

To inject aspects, go to aspects folder under Other Sources folder of any integration application of Milestone 9 and higher. Right click on that aspects folder and add property files. Each property file under this aspects folder, represents one aspect.

Have a properties file similar to the following to inject a echo-2 aspect ..

type=echo
name=echo-2
status=Active
echoProperty=This echo-2 aspect is created in the integration application.

Build and deploy your application and notice availability of echo-2 by Fuji CLI command, list-configurations.
You can have as many aspects as you want. You can also organize your aspects in sub-directories.

Your own applications

You can also inject aspects from your own applications! What all you need to do is package all your aspect properties files under META-INF/aspects folder in your deployment jar.

By now, you have already experienced how simple its easy to develop your own aspects and various means of injecting aspects to the Fuji runtime.

And these aspects are dynamic. You can switch the injection point by changing the interceptor specific properties. And you can control the behavior of the aspect by changing your aspect specific properties.

Fuji CLI provides set-configuration command to change the properties of your "name"d aspect by its name.

For example, if you want to inject echo-1 at an endpoint, say, file1-endpoint, the command looks like

-> fuji set-configuration --name=echo-1 endpoint=file1-endpoint

from now onwards, the echo-1 aspect echoes only for the messages delivered or originated from file1-endpont.

Your setConfiguration method of the corresponding aspect's instance is identified and called by JBI framework!

Conclusion

As an java aspect developer, you just concentrate developing aspect's behavior method and handle the configuration method. And Fuji backs you up with dealing aspects injection, interception and dynamic behavior of your aspects.

Fuji is evolving at fast pace for more support and functionality.

Stay tuned for more advancements and start developing your aspects. And yes, its open source and contribute back.