Constructs the object through the Reflection API and accesses the object's Public/private methods and fields using reflection invocation.
Package lavasoft.test;
/**
* Test the Business class
*
* @author leizhimin 2010-5-6 20:16:10
*/
public class MyService {
Private String msg;
Public MyService () {
System.out.println ("Log: Parameterless construction method Lavasoft.test.MyService.MyService () has been invoked!" ");
}
Public MyService (String msg) {
System.out.println ("Log: Parametric construction method Lavasoft.test.MyService.MyService () has been invoked!" ");
this.msg = msg;
}
public string dosomething (string person, string something) {
System.out.println ("LOG: Business method Lavasoft.test.MyService.doSomething () has been invoked!") ");
Return person + ' is doing ' + something + '! "+
"Additional message:" + msg;
}
Public String getmsg () {
System.out.println ("LOG:LAVASOFT.TEST.MYSERVICE.GETMSG") has been invoked! ");
return msg;
}
public void Setmsg (String msg) {
System.out.println ("LOG:LAVASOFT.TEST.MYSERVICE.SETMSG") has been invoked! ");
this.msg = msg;
}
Private String doprivate () {
System.out.println ("Log: Private method Lavasoft.test.MyService.doPrivate () has been invoked!") ");
Return "Private Method Doprivate () was called!";
}
}