At the service level, I have classes that look something like this:
class MyService { public doSomething() { TelnetSession session = new TelnetSession(); session.open("username", "password"); session.execute("blah"); session.close(); } }
In many classes, I have to declare and open a session, and then complete its closure. I would rather do something with annotations, but I don't know where to start. How other people do something like this:
class MyService { @TelnetTransaction public doSomething() { session.execute("blah"); } }
where the method annotated using @TelnetTransaction , opens and passes in the TelnetSession object.
Thanks,
James
java dependency-injection annotations
James
source share