@@ -0,0 +1,713 @@
+package com.siirush.localwiki.search.interceptor;%0A%0Aimport javax.inject.Inject;%0A%0Aimport org.aopalliance.intercept.MethodInterceptor;%0Aimport org.aopalliance.intercept.MethodInvocation;%0A%0Aimport com.siirush.localwiki.search.SearchEngine;%0A%0Apublic class IndexInterceptor implements MethodInterceptor %7B%0A%09private final SearchEngine searchEngine;%0A%09%0A%09@Inject%0A%09public IndexInterceptor(SearchEngine searchEngine) %7B%0A%09%09this.searchEngine = searchEngine;%0A%09%7D%0A%09%0A%09public Object invoke(MethodInvocation invocation) throws Throwable %7B%0A%09%09Throwable thrown = null;%0A%09%09try %7B%0A%09%09%09return invocation.proceed();%0A%09%09%7D catch (Throwable t) %7B%0A%09%09%09thrown = t;%0A%09%09%09throw t;%0A%09%09%7D finally %7B%0A%09%09%09if (thrown == null) %7B%0A%09%09%09%09searchEngine.index();%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%0A%7D%0A

Add index method interceptor.