Search in sources :

Example 1 with JSynchronizedBlock

use of com.helger.jcodemodel.JSynchronizedBlock in project androidannotations by androidannotations.

the class RoboGuiceHandler method onContentChangedMethod.

private void onContentChangedMethod(RoboGuiceHolder holder, JFieldVar scope, JFieldVar eventManager) {
    JBlock onContentChangedAfterSuperBlock = holder.getOnContentChangedAfterSuperBlock();
    JSynchronizedBlock synchronizedBlock = onContentChangedAfterSuperBlock.synchronizedBlock(getJClass(RoboGuiceClasses.CONTEXT_SCOPE).dotclass());
    JBlock synchronizedBlockBody = synchronizedBlock.body();
    synchronizedBlockBody.invoke(scope, "enter").arg(_this());
    JTryBlock tryBlock = synchronizedBlockBody._try();
    tryBlock.body().staticInvoke(getJClass(RoboGuiceHelper.class), "callInjectViews").arg(_this());
    tryBlock._finally().invoke(scope, "exit").arg(_this());
    onContentChangedAfterSuperBlock.add(synchronizedBlock);
    fireEvent(eventManager, onContentChangedAfterSuperBlock, getJClass(RoboGuiceClasses.ON_CONTENT_CHANGED_EVENT));
}
Also used : JSynchronizedBlock(com.helger.jcodemodel.JSynchronizedBlock) JBlock(com.helger.jcodemodel.JBlock) JTryBlock(com.helger.jcodemodel.JTryBlock)

Aggregations

JBlock (com.helger.jcodemodel.JBlock)1 JSynchronizedBlock (com.helger.jcodemodel.JSynchronizedBlock)1 JTryBlock (com.helger.jcodemodel.JTryBlock)1