public static LFQuizTreeElementPersistence getPersistence() { if (_persistence == null) { _persistence = (LFQuizTreeElementPersistence) PortletBeanLocatorUtil.locate( com.arcusys.learn.persistence.liferay.service.ClpSerializer .getServletContextName(), LFQuizTreeElementPersistence.class.getName()); ReferenceRegistry.registerReference(LFQuizTreeElementUtil.class, "_persistence"); } return _persistence; }
public Object invokeOnRemoteModel( String methodName, Class<?>[] parameterTypes, Object[] parameterValues) throws Exception { Object[] remoteParameterValues = new Object[parameterValues.length]; for (int i = 0; i < parameterValues.length; i++) { if (parameterValues[i] != null) { remoteParameterValues[i] = ClpSerializer.translateInput(parameterValues[i]); } } Class<?> remoteModelClass = _lfAchievementRemoteModel.getClass(); ClassLoader remoteModelClassLoader = remoteModelClass.getClassLoader(); Class<?>[] remoteParameterTypes = new Class[parameterTypes.length]; for (int i = 0; i < parameterTypes.length; i++) { if (parameterTypes[i].isPrimitive()) { remoteParameterTypes[i] = parameterTypes[i]; } else { String parameterTypeName = parameterTypes[i].getName(); remoteParameterTypes[i] = remoteModelClassLoader.loadClass(parameterTypeName); } } Method method = remoteModelClass.getMethod(methodName, remoteParameterTypes); Object returnValue = method.invoke(_lfAchievementRemoteModel, remoteParameterValues); if (returnValue != null) { returnValue = ClpSerializer.translateOutput(returnValue); } return returnValue; }