moving code for efjs integration in common java class