I was wondering what are the general steps required in building some sort of java extension or plugin. More specifically, I'm looking to build something like a C++ struct in java that will allow me to declare the methods from a particular class so that I can indicate the order they should be executed by the JVM. This is just pie in the sky at the moment and I'm interested in how the likes of AspectJ or other java extensions work to allow you to declare syntax that is not native to java. I'm assuming this would require some sort of compiler plugin.

As an example, I envisage something like the following

public struct weakProfile { streamDataViaGprs(); sendSimpleMap(); } public struct strongProfile { streamDataVia3G(); sendComplexMap(); sendAudio(); }