null) cachedException;
/ / security check (! method.isAnnotationPresent (ServiceMethod.class)) {new SecurityException («Method is not annotated with ServiceMethod!");
}
/ / use another invoke type if method is static (Modifier.isStatic (method.getModifiers ())) {method.invoke (clazz.getClass (), param.params.toArray ());
} else {method.invoke (clazz.newInstance (), param.params.toArray ());// Todo create method to get class instance?
}
} static Method getMethod (String methodName, Class owner, Class [] params) throws NoSuchMethodException, ClassNotFoundException {cache=InvokeCache.getInstance (); result; ((result=cache.findMethod (methodName)) !=null) {/ / try to find method in cacheresult;
} else {= owner.getMethod (methodName, params); result;
}
} static Class getClass (String className) throws ClassNotFoundException {cache=InvokeCache.getInstance (); result; ((result=cache.findClass (className))!=null) {result;
} else {= Class.forName (className);. cacheClass (result); result;
}
}
}com.gmail.dosofredriver.ajax.serviceserver.util.logger;java.io.PrintWriter;java.io.StringWriter;java.util.Date;java.util.logging.Formatter;java.util.logging.Handler;java.util.logging.Level;java.util.logging.LogRecord;
/ **
* @ author. .
*, HTML.
*
* / HTMLFormatter extends Formatter {
/ **
* Return head of HTML file.
* /
@ OverrideString getHead (Handler h)
{
/ **
* Write title, meta data and table.
* / «
AppLog
» +
«» +
« » +
«» +
«
«
message
thrown message
stacktrace
»;
}
/ **
* Return end of HTML file.
* /
@ OverrideString getTail (Handler h)
{
/ **
* Write end of table and HTML file.
* / « »;
}
/ **
* Format message to table string.
* /
@ OverrideString format (LogRecord record)
{result=new StringBuilder (); d=new Date (); level=record.getLevel ();
/ **
* Error will be highlighted with red color,
* warnings with grey,
...