/** * INTERNAL: This convenience method will look up a WebLogic execute thread from the runtime MBean * tree. The execute thread contains application information. This code will use the name of the * current thread to lookup the corresponding ExecuteThread. The ExecuteThread will allow us to * obtain the application name (and version, etc). * * @return application name or null if the name cannot be obtained */ private static Object getExecuteThread() { if (getWLSMBeanServer() != null) { // Lazy load the ThreadPoolRuntime instance if (wlsThreadPoolRuntime == null) { ObjectName service = null; ObjectName serverRuntime = null; try { service = new ObjectName(WLS_SERVICE_KEY); } catch (Exception x) { throw SDOException.errorGettingWLSObjectName( WLS_RUNTIME_SERVICE + " [" + WLS_SERVICE_KEY + "]", x); } try { serverRuntime = (ObjectName) wlsMBeanServer.getAttribute(service, WLS_SERVER_RUNTIME); } catch (Exception x) { throw SDOException.errorGettingWLSObjectName(WLS_SERVER_RUNTIME, x); } try { wlsThreadPoolRuntime = (ObjectName) wlsMBeanServer.getAttribute(serverRuntime, WLS_THREADPOOL_RUNTIME); } catch (Exception x) { throw SDOException.errorGettingWLSObjectName(WLS_THREADPOOL_RUNTIME, x); } } try { return wlsMBeanServer.invoke( wlsThreadPoolRuntime, WLS_EXECUTE_THREAD_GET_METHOD_NAME, new Object[] {Thread.currentThread().getName()}, new String[] {String.class.getName()}); } catch (Exception x) { throw SDOException.errorInvokingWLSMethodReflectively( WLS_EXECUTE_THREAD_GET_METHOD_NAME, WLS_THREADPOOL_RUNTIME, x); } } return null; }