Should I write whole in agi?

i need to write a program to handles calls (record some calls in some conditions,channel spy,…)and make logs of all calls in mysql
I found asterisk-java very useful for me. I can write whole asterisk dialplan in asterisk-java
but i don’t know it’s the best solution for me?!!!
or it’s better to connect every part of extentions.conf that I want to asterisk-java?!! (if i do it, the parts that i will connect to agi is so high)

Is it correct to execute all calls in asterisk-java?!!!
my extentions.conf will be:
exten => 1,1,agi(agi://localhost/Test)

oops! sorry I wrote in wrong place
please move it to Asterisk General