List of usage examples for org.springframework.security.util FieldUtils getProtectedFieldValue
public static Object getProtectedFieldValue(String protectedField, Object object)
From source file:com.qcadoo.customTranslation.internal.CustomTranslationManagementServiceImpl.java
private Session getCurrentSession(final DataDefinition dataDefinition) { Object dataAccessService = FieldUtils.getProtectedFieldValue("dataAccessService", dataDefinition); Object hibernateService = FieldUtils.getProtectedFieldValue("hibernateService", dataAccessService); try {/*from w ww .j a v a2s . com*/ return (Session) MethodUtils.invokeExactMethod(hibernateService, "getCurrentSession", new Object[0]); } catch (NoSuchMethodException e) { throw new IllegalStateException(e.getMessage(), e); } catch (IllegalAccessException e) { throw new IllegalStateException(e.getMessage(), e); } catch (InvocationTargetException e) { throw new IllegalStateException(e.getMessage(), e); } }