|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.opensymphony.xwork2.util.profiling.ObjectProfiler
public class ObjectProfiler
Constructor Summary | |
---|---|
ObjectProfiler()
|
Method Summary | |
---|---|
static Object |
getProfiledObject(Class interfaceClazz,
Object o)
Given a class, and an interface that it implements, return a proxied version of the class that implements the interface. |
static String |
getTrimmedClassName(Method method)
Given a method, get the Method name, with no package information. |
static Object |
profiledInvoke(Method target,
Object value,
Object[] args)
A profiled call Method.invoke(java.lang.Object, java.lang.Object[]) . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ObjectProfiler()
Method Detail |
---|
public static Object getProfiledObject(Class interfaceClazz, Object o)
The usual use of this is to profile methods from Factory objects:
public PersistenceManager getPersistenceManager() { return new DefaultPersistenceManager(); } instead write: public PersistenceManager getPersistenceManager() { return ObjectProfiler.getProfiledObject(PersistenceManager.class, new DefaultPersistenceManager()); }
A side effect of this is that you will no longer be able to downcast to DefaultPersistenceManager. This is probably a *good* thing.
interfaceClazz
- The interface to implement.o
- The object to proxy
public static Object profiledInvoke(Method target, Object value, Object[] args) throws IllegalAccessException, InvocationTargetException
Method.invoke(java.lang.Object, java.lang.Object[])
. If UtilTimerStack.isActive()
returns false, then no profiling is performed.
IllegalAccessException
InvocationTargetException
public static String getTrimmedClassName(Method method)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |