public static java.lang.String fooRemote(HttpPrincipal httpPrincipal) { try { MethodKey methodKey = new MethodKey(FooServiceUtil.class, "fooRemote", _fooRemoteParameterTypes0); MethodHandler methodHandler = new MethodHandler(methodKey); Object returnObj = null; try { returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler); } catch (Exception e) { throw new com.liferay.portal.kernel.exception.SystemException(e); } return (java.lang.String)returnObj; } catch (com.liferay.portal.kernel.exception.SystemException se) { _log.error(se, se); throw se; } }
@Override public String getSpecificDiplomaContent(){ Object returnObj = null; try { MethodKey getNameMethod = new MethodKey(clp.getClassName(), "getSpecificDiplomaContent"); returnObj = clp.invoke(new MethodHandler(getNameMethod)); } catch (Throwable t) { t = ClpSerializer.translateThrowable(t); if (t instanceof RuntimeException) { throw (RuntimeException)t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } return ((String)returnObj); }
@Override public String getPortletId(){ Object returnObj = null; try { MethodKey getNameMethod = new MethodKey(clp.getClassName(), "getPortletId"); returnObj = clp.invoke(new MethodHandler(getNameMethod)); } catch (Throwable t) { t = ClpSerializer.translateThrowable(t); if (t instanceof RuntimeException) { throw (RuntimeException)t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } return ((String)returnObj); }
@Override public String saveDiploma(UploadRequest uploadRequest,Long courseId) throws Exception{ Object returnObj = null; try { MethodKey getNameMethod = new MethodKey(clp.getClassName(), "saveDiploma", UploadRequest.class, Long.class); returnObj = clp.invoke(new MethodHandler(getNameMethod,uploadRequest, courseId)); } catch (Throwable t) { t = ClpSerializer.translateThrowable(t); if (t instanceof RuntimeException) { throw (RuntimeException)t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } return ((String)returnObj); }
@Override public String updateUserDiploma(Long courseResutlId){ Object returnObj = null; try { MethodKey getNameMethod = new MethodKey(clp.getClassName(), "updateUserDiploma", Long.class); returnObj = clp.invoke(new MethodHandler(getNameMethod, courseResutlId)); } catch (Throwable t) { t = ClpSerializer.translateThrowable(t); if (t instanceof RuntimeException) { throw (RuntimeException)t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } return ((String)returnObj); }
public boolean especificValidations(UploadRequest uploadRequest,PortletResponse portletResponse) { Object returnObj = null; try { MethodKey especificValidationsMethod = new MethodKey(clp.getClassName(), "especificValidations", UploadRequest.class, PortletResponse.class); returnObj = clp.invoke(new MethodHandler(especificValidationsMethod, uploadRequest, portletResponse)); } catch (Throwable t) { t = ClpSerializer.translateThrowable(t); if (t instanceof RuntimeException) { throw (RuntimeException)t; } else { t.printStackTrace(); throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } return ((Boolean)returnObj).booleanValue(); }
@Override public String generateAleatoryQuestions(long actId, long typeId) { Object returnObj = null; try { MethodKey translateMethod = new MethodKey(clp.getClassName(), "generateAleatoryQuestions", long.class, long.class); returnObj = clp.invoke(new MethodHandler(translateMethod, actId, typeId)); } catch (Throwable t) { t = ClpSerializer.translateThrowable(t); if (t instanceof RuntimeException) { throw (RuntimeException)t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } return (String)returnObj; }
public String getTitle(Locale locale){ Object returnObj = null; try { MethodKey getTitleMethod = new MethodKey(clp.getClassName(), "getTitle", Locale.class); returnObj = clp.invoke(new MethodHandler(getTitleMethod, locale)); } catch (Throwable t) { t = ClpSerializer.translateThrowable(t); if (t instanceof RuntimeException) { throw (RuntimeException)t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } return ((String)returnObj); }
public String getDescription(Locale locale){ Object returnObj = null; try { MethodKey getDescriptionMethod = new MethodKey(clp.getClassName(), "getDescription", Locale.class); returnObj = clp.invoke(new MethodHandler(getDescriptionMethod, locale)); } catch (Throwable t) { t = ClpSerializer.translateThrowable(t); if (t instanceof RuntimeException) { throw (RuntimeException)t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } return ((String)returnObj); }
public String getSuffix(){ Object returnObj = null; try { MethodKey getSuffixMethod = new MethodKey(clp.getClassName(), "getSuffix"); returnObj = clp.invoke(new MethodHandler(getSuffixMethod)); } catch (Throwable t) { t = ClpSerializer.translateThrowable(t); if (t instanceof RuntimeException) { throw (RuntimeException)t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } return ((String)returnObj); }
public String getSuffix(long groupId){ Object returnObj = null; try { MethodKey getSuffixMethod = new MethodKey(clp.getClassName(), "getSuffix"); returnObj = clp.invoke(new MethodHandler(getSuffixMethod)); } catch (Throwable t) { t = ClpSerializer.translateThrowable(t); if (t instanceof RuntimeException) { throw (RuntimeException)t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } return ((String)returnObj); }
public String translate(Locale locale, double result){ Object returnObj = null; try { MethodKey translateMethod = new MethodKey(clp.getClassName(), "translate", Locale.class, double.class); returnObj = clp.invoke(new MethodHandler(translateMethod, locale, result)); } catch (Throwable t) { t = ClpSerializer.translateThrowable(t); if (t instanceof RuntimeException) { throw (RuntimeException)t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } return ((String)returnObj); }
public String translate(Locale locale, CourseResult result) { Object returnObj = null; try { MethodKey translateMethod = new MethodKey(clp.getClassName(), "translate", Locale.class, double.class); returnObj = clp.invoke(new MethodHandler(translateMethod, locale, result)); } catch (Throwable t) { t = ClpSerializer.translateThrowable(t); if (t instanceof RuntimeException) { throw (RuntimeException)t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } return ((String)returnObj); }
public String translate(Locale locale, LearningActivityResult result) { Object returnObj = null; try { MethodKey translateMethod = new MethodKey(clp.getClassName(), "translate", Locale.class, double.class); returnObj = clp.invoke(new MethodHandler(translateMethod, locale, result)); } catch (Throwable t) { t = ClpSerializer.translateThrowable(t); if (t instanceof RuntimeException) { throw (RuntimeException)t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } return ((String)returnObj); }
public String translate(Locale locale, ModuleResult result) { Object returnObj = null; try { MethodKey translateMethod = new MethodKey(clp.getClassName(), "translate", Locale.class, double.class); returnObj = clp.invoke(new MethodHandler(translateMethod, locale, result)); } catch (Throwable t) { t = ClpSerializer.translateThrowable(t); if (t instanceof RuntimeException) { throw (RuntimeException)t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } return ((String)returnObj); }
public String translate(Locale locale, long groupId, double result) { Object returnObj = null; try { MethodKey translateMethod = new MethodKey(clp.getClassName(), "translate", Locale.class, double.class); returnObj = clp.invoke(new MethodHandler(translateMethod, locale, result)); } catch (Throwable t) { t = ClpSerializer.translateThrowable(t); if (t instanceof RuntimeException) { throw (RuntimeException)t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } return ((String)returnObj); }
@Override public String getExpecificContentPage() { Object returnObj = null; try { MethodKey getExpecificContentPageMethod = new MethodKey(clp.getClassName(), "getExpecificContentPage", Locale.class); returnObj = clp.invoke(new MethodHandler(getExpecificContentPageMethod)); } catch (Throwable t) { t = ClpSerializer.translateThrowable(t); if (t instanceof RuntimeException) { throw (RuntimeException)t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } return ((String)returnObj); }
@Override public String getName(Locale locale) { Object returnObj = null; try { MethodKey getNameMethod = new MethodKey(clp.getClassName(), "getName", Locale.class); returnObj = clp.invoke(new MethodHandler(getNameMethod, locale)); } catch (Throwable t) { t = ClpSerializer.translateThrowable(t); if (t instanceof RuntimeException) { throw (RuntimeException)t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } return ((String)returnObj); }
@Override public boolean especificValidations(UploadRequest uploadRequest,PortletResponse portletResponse){ Object returnObj = null; try { MethodKey especificValidationsMethod = new MethodKey(clp.getClassName(), "especificValidations", UploadRequest.class, PortletResponse.class); returnObj = clp.invoke(new MethodHandler(especificValidationsMethod, uploadRequest, portletResponse)); } catch (Throwable t) { t = ClpSerializer.translateThrowable(t); if (t instanceof RuntimeException) { throw (RuntimeException)t; } else { t.printStackTrace(); throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } return ((Boolean)returnObj).booleanValue(); }
@Override public long calculateModuleResult(long moduleId, long userId) throws SystemException { Object returnObj = null; try { MethodKey especificValidationsMethod = new MethodKey(clp.getClassName(), "calculateModuleResult", long.class, long.class); returnObj = clp.invoke(new MethodHandler(especificValidationsMethod, moduleId, userId)); } catch (Throwable t) { t = ClpSerializer.translateThrowable(t); if (t instanceof RuntimeException) { throw (RuntimeException)t; } else { t.printStackTrace(); throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } return ((Long)returnObj).longValue(); }
@Override public String filter(String description) { Object returnObj = null; try { MethodKey translateMethod = new MethodKey(clp.getClassName(), "filter", String.class); returnObj = clp.invoke(new MethodHandler(translateMethod, description)); } catch (Throwable t) { t = ClpSerializer.translateThrowable(t); if (t instanceof RuntimeException) { throw (RuntimeException)t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } return ((String)returnObj); }
public MoveTopicoLocalServiceClp(ClassLoaderProxy classLoaderProxy) { _classLoaderProxy = classLoaderProxy; _getBeanIdentifierMethodKey0 = new MethodKey(_classLoaderProxy.getClassName(), "getBeanIdentifier"); _setBeanIdentifierMethodKey1 = new MethodKey(_classLoaderProxy.getClassName(), "setBeanIdentifier", java.lang.String.class); _getTopicosPorComunidadeEForumMethodKey2 = new MethodKey(_classLoaderProxy.getClassName(), "getTopicosPorComunidadeEForum", long.class, long.class); _getForunsComunidadeMethodKey3 = new MethodKey(_classLoaderProxy.getClassName(), "getForunsComunidade", long.class); _getComunidadesComPermissaoParaMoverMethodKey4 = new MethodKey(_classLoaderProxy.getClassName(), "getComunidadesComPermissaoParaMover", long.class, long.class); _moveTopicoMethodKey5 = new MethodKey(_classLoaderProxy.getClassName(), "moveTopico", br.gov.camara.edemocracia.movetopico.model.InfoMoverTopico.class); }
private boolean tentaAutenticar(ActionRequest request, ActionResponse response, String email, String senha) { MethodKey method = new MethodKey("com.liferay.portlet.login.util.LoginUtil", "login", new Class[] { HttpServletRequest.class, HttpServletResponse.class, String.class, String.class, boolean.class, String.class }); try { PortalClassInvoker.invoke(false, method, PortalUtil.getHttpServletRequest(request), PortalUtil.getHttpServletResponse(response), email, senha, false, CompanyConstants.AUTH_TYPE_EA); return true; } catch (Exception e) { if (e instanceof AuthException) { Throwable cause = e.getCause(); if (cause != null) { SessionErrors.add(request, cause.getClass()); salvarLastPathNaSessao(request); } else { SessionErrors.add(request, e.getClass()); salvarLastPathNaSessao(request); } } else { SessionErrors.add(request, e.getClass()); } return false; } }
protected Method getLocalServiceMethod( String methodName, Class<?> parameterType) throws ClassNotFoundException, NoSuchMethodException { String key = methodName; if (parameterType != null) { key = key + "#" + parameterType.getName(); } Method method = null; if (localServiceMethods.containsKey(key)) { try { method = localServiceMethods.get(key).getMethod(); } catch (NoSuchMethodException e) { } } if (method == null) { Class<?> classLocalService = modelService.getClass(); if (parameterType != null) { method = classLocalService.getMethod(methodName, parameterType); } else { method = classLocalService.getMethod(methodName); } if (method == null) { localServiceMethods.put(key, new MethodKey()); } else { localServiceMethods.put(key, new MethodKey(method)); } } return method; }
public void afterInsertOrUpdate(UploadRequest uploadRequest,PortletResponse portletResponse,LearningActivity learningActivity) throws PortalException,SystemException { try { ClassLoader classLoader = clp.getClassLoader(); Class learningActivityClass = Class.forName(LearningActivity.class.getName(),true, classLoader); MethodKey afterInsertOrUpdateMethod = new MethodKey(clp.getClassName(), "afterInsertOrUpdate", UploadRequest.class, PortletResponse.class, learningActivityClass); Object learningActivityObj = translateLearningActivity(learningActivity); clp.invoke(new MethodHandler(afterInsertOrUpdateMethod, uploadRequest, portletResponse, learningActivityObj)); ClassLoaderProxy classLoaderProxy = new ClassLoaderProxy(learningActivityObj, clp.getClassLoader()); learningActivity.setModelAttributes((Map<String, Object>) classLoaderProxy.invoke("getModelAttributes", new Object[]{})); } catch (Throwable t) { t = ClpSerializer.translateThrowable(t); if (t instanceof com.liferay.portal.kernel.exception.PortalException) { throw (com.liferay.portal.kernel.exception.PortalException)t; } if (t instanceof com.liferay.portal.kernel.exception.SystemException) { throw (com.liferay.portal.kernel.exception.SystemException)t; } if (t instanceof RuntimeException) { throw (RuntimeException)t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } }
@Override public boolean isDone(LearningActivity learningActivity, long userId) throws SystemException, PortalException { Object returnObj = null; try { ClassLoader classLoader = clp.getClassLoader(); Class learningActivityClass = Class.forName(LearningActivity.class.getName(),true, classLoader); MethodKey isDoneMethod = new MethodKey(clp.getClassName(), "isDone", learningActivityClass,Long.class); Object learningActivityObj = translateLearningActivity(learningActivity); returnObj = clp.invoke(new MethodHandler(isDoneMethod, learningActivityObj,userId)); ClassLoaderProxy classLoaderProxy = new ClassLoaderProxy(learningActivityObj, clp.getClassLoader()); learningActivity.setModelAttributes((Map<String, Object>) classLoaderProxy.invoke("getModelAttributes", new Object[]{})); } catch (Throwable t) { t = ClpSerializer.translateThrowable(t); if (t instanceof com.liferay.portal.kernel.exception.PortalException) { throw (com.liferay.portal.kernel.exception.PortalException)t; } if (t instanceof com.liferay.portal.kernel.exception.SystemException) { throw (com.liferay.portal.kernel.exception.SystemException)t; } if (t instanceof RuntimeException) { throw (RuntimeException)t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } return ((Boolean)returnObj); }
@Override public String importExtraContent(LearningActivity newLarn, Long userId, PortletDataContext context, ServiceContext serviceContext,Element actElement) throws PortalException, IOException, DocumentException, SystemException { try { ClassLoader classLoader = clp.getClassLoader(); Class learningActivityClass = Class.forName(LearningActivity.class.getName(),true, classLoader); MethodKey importExtraContentMethod = new MethodKey(clp.getClassName(), "importExtraContent", learningActivityClass, Long.class , PortletDataContext.class, ServiceContext.class, Element.class); Object learningActivityObj = translateLearningActivity(newLarn); clp.invoke(new MethodHandler(importExtraContentMethod, learningActivityObj, userId, context,serviceContext, actElement)); } catch (Throwable t) { t = ClpSerializer.translateThrowable(t); if (t instanceof com.liferay.portal.kernel.exception.PortalException) { throw (com.liferay.portal.kernel.exception.PortalException)t; } if (t instanceof IOException) { throw (IOException)t; } if (t instanceof DocumentException) { throw (DocumentException)t; } if (t instanceof com.liferay.portal.kernel.exception.SystemException) { throw (com.liferay.portal.kernel.exception.SystemException)t; } if (t instanceof RuntimeException) { throw (RuntimeException)t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } return null; }
@Override public String addZipEntry(LearningActivity actividad, Long assetEntryId,PortletDataContext context, Element entryElementLoc) throws PortalException, SystemException { try { log.info(":::::addZipEntry:::::"); ClassLoader classLoader = clp.getClassLoader(); Class learningActivityClass = Class.forName(LearningActivity.class.getName(),true, classLoader); MethodKey addZipEntryMethod = new MethodKey(clp.getClassName(), "addZipEntry", learningActivityClass, Long.class , PortletDataContext.class, Element.class); Object learningActivityObj = translateLearningActivity(actividad); log.info(":::::invoke:::::"); clp.invoke(new MethodHandler(addZipEntryMethod, learningActivityObj, assetEntryId, context, entryElementLoc)); log.info(":::::invoked:::::"); } catch (Throwable t) { t = ClpSerializer.translateThrowable(t); if (t instanceof com.liferay.portal.kernel.exception.PortalException) { throw (com.liferay.portal.kernel.exception.PortalException)t; } if (t instanceof com.liferay.portal.kernel.exception.SystemException) { throw (com.liferay.portal.kernel.exception.SystemException)t; } if (t instanceof RuntimeException) { throw (RuntimeException)t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } return null; }
@Override @SuppressWarnings({ "rawtypes", "unchecked", "deprecation" }) public void updateCourse(Course course, ModuleResult moduleResult) throws SystemException { try { ClassLoader classLoader = clp.getClassLoader(); Class courseClass = Class.forName(Course.class.getName(),true, classLoader); Class moduleResultClass = Class.forName(ModuleResult.class.getName(),true, classLoader); MethodKey updateCourseMethod = new MethodKey(clp.getClassName(), "updateCourse",courseClass,moduleResultClass); Object courseObj = translateCourse(course); Object moduleResultObj = translateModuleResult(moduleResult); clp.invoke(new MethodHandler(updateCourseMethod, courseObj, moduleResultObj)); ClassLoaderProxy courseClassLoaderProxy = new ClassLoaderProxy(courseObj, clp.getClassLoader()); course.setModelAttributes((Map<String, Object>) courseClassLoaderProxy.invoke("getModelAttributes", new Object[]{})); ClassLoaderProxy moduleResultClassLoaderProxy = new ClassLoaderProxy(moduleResultObj, clp.getClassLoader()); moduleResult.setModelAttributes((Map<String, Object>) moduleResultClassLoaderProxy.invoke("getModelAttributes", new Object[]{})); } catch (Throwable t) { t = ClpSerializer.translateThrowable(t); if (t instanceof com.liferay.portal.kernel.exception.SystemException) { throw (com.liferay.portal.kernel.exception.SystemException)t; } if (t instanceof RuntimeException) { throw (RuntimeException)t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } }
@Override @SuppressWarnings({ "rawtypes", "unchecked", "deprecation" }) public boolean updateCourse(Course course,long userId) throws SystemException { try { Object returnObj = null; ClassLoader classLoader = clp.getClassLoader(); Class courseClass = Class.forName(Course.class.getName(),true, classLoader); MethodKey updateCourseMethod = new MethodKey(clp.getClassName(), "updateCourse",courseClass,Long.class); Object courseObj = translateCourse(course); returnObj = clp.invoke(new MethodHandler(updateCourseMethod, courseObj, userId)); ClassLoaderProxy courseClassLoaderProxy = new ClassLoaderProxy(courseObj, clp.getClassLoader()); course.setModelAttributes((Map<String, Object>) courseClassLoaderProxy.invoke("getModelAttributes", new Object[]{})); return ((Boolean)returnObj).booleanValue(); } catch (Throwable t) { t = ClpSerializer.translateThrowable(t); if (t instanceof com.liferay.portal.kernel.exception.SystemException) { throw (com.liferay.portal.kernel.exception.SystemException)t; } if (t instanceof RuntimeException) { throw (RuntimeException)t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } }
@Override @SuppressWarnings({ "rawtypes", "unchecked", "deprecation" }) public boolean updateCourse(Course course) throws SystemException { try { Object returnObj = null; ClassLoader classLoader = clp.getClassLoader(); Class courseClass = Class.forName(Course.class.getName(),true, classLoader); MethodKey updateCourseMethod = new MethodKey(clp.getClassName(), "updateCourse",courseClass); Object courseObj = translateCourse(course); returnObj = clp.invoke(new MethodHandler(updateCourseMethod, courseObj)); ClassLoaderProxy courseClassLoaderProxy = new ClassLoaderProxy(courseObj, clp.getClassLoader()); course.setModelAttributes((Map<String, Object>) courseClassLoaderProxy.invoke("getModelAttributes", new Object[]{})); return ((Boolean)returnObj).booleanValue(); } catch (Throwable t) { t = ClpSerializer.translateThrowable(t); if (t instanceof com.liferay.portal.kernel.exception.SystemException) { throw (com.liferay.portal.kernel.exception.SystemException)t; } if (t instanceof RuntimeException) { throw (RuntimeException)t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } }
@Override @SuppressWarnings({ "rawtypes"}) public long getPassPuntuation(Course course) throws DocumentException { Object returnObj = null; try { ClassLoader classLoader = clp.getClassLoader(); Class courseClass = Class.forName(Course.class.getName(),true, classLoader); MethodKey getPassPuntuationMethod = new MethodKey(clp.getClassName(), "getPassPuntuation",courseClass); Object courseObj = translateCourse(course); returnObj = clp.invoke(new MethodHandler(getPassPuntuationMethod, courseObj)); } catch (Throwable t) { t = ClpSerializer.translateThrowable(t); if (t instanceof DocumentException) { throw (DocumentException)t; } if (t instanceof RuntimeException) { throw (RuntimeException)t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } return ((Number)returnObj).longValue(); }
@Override @SuppressWarnings({ "unchecked", "deprecation" }) public void setExtraContent(Course course,String actionId,ServiceContext serviceContext) throws PortalException, SystemException { try { ClassLoader classLoader = clp.getClassLoader(); Class<?> courseClass = Class.forName(Course.class.getName(),true, classLoader); MethodKey setExtraContentMethod = new MethodKey(clp.getClassName(), "setExtraContent", courseClass, String.class, ServiceContext.class); Object courseObj = translateCourse(course); clp.invoke(new MethodHandler(setExtraContentMethod, courseObj, actionId, serviceContext)); ClassLoaderProxy classLoaderProxy = new ClassLoaderProxy(courseObj, clp.getClassLoader()); course.setModelAttributes((Map<String, Object>) classLoaderProxy.invoke("getModelAttributes", new Object[]{})); } catch (Throwable t) { t = ClpSerializer.translateThrowable(t); if (t instanceof PortalException) { throw (PortalException)t; } if (t instanceof SystemException) { throw (SystemException)t; } if (t instanceof RuntimeException) { throw (RuntimeException)t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } }
@Override @SuppressWarnings({ "rawtypes", "unchecked", "deprecation" }) public void onOpenCourse(Course course) throws SystemException { try { ClassLoader classLoader = clp.getClassLoader(); Class courseClass = Class.forName(Course.class.getName(),true, classLoader); MethodKey updateCourseMethod = new MethodKey(clp.getClassName(), "onOpenCourse",courseClass); Object courseObj = translateCourse(course); clp.invoke(new MethodHandler(updateCourseMethod, courseObj)); ClassLoaderProxy courseClassLoaderProxy = new ClassLoaderProxy(courseObj, clp.getClassLoader()); course.setModelAttributes((Map<String, Object>) courseClassLoaderProxy.invoke("getModelAttributes", new Object[]{})); } catch (Throwable t) { t = ClpSerializer.translateThrowable(t); if (t instanceof com.liferay.portal.kernel.exception.SystemException) { throw (com.liferay.portal.kernel.exception.SystemException)t; } if (t instanceof RuntimeException) { throw (RuntimeException)t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } }
@Override @SuppressWarnings({ "rawtypes", "unchecked", "deprecation" }) public void onCloseCourse(Course course) throws SystemException { try { ClassLoader classLoader = clp.getClassLoader(); Class courseClass = Class.forName(Course.class.getName(),true, classLoader); MethodKey updateCourseMethod = new MethodKey(clp.getClassName(), "onCloseCourse",courseClass); Object courseObj = translateCourse(course); clp.invoke(new MethodHandler(updateCourseMethod, courseObj)); ClassLoaderProxy courseClassLoaderProxy = new ClassLoaderProxy(courseObj, clp.getClassLoader()); course.setModelAttributes((Map<String, Object>) courseClassLoaderProxy.invoke("getModelAttributes", new Object[]{})); } catch (Throwable t) { t = ClpSerializer.translateThrowable(t); if (t instanceof com.liferay.portal.kernel.exception.SystemException) { throw (com.liferay.portal.kernel.exception.SystemException)t; } if (t instanceof RuntimeException) { throw (RuntimeException)t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } }
@Override @SuppressWarnings({"rawtypes"}) public JSONObject getEvaluationModel(Course course) throws SystemException { Object returnObj = null; try { ClassLoader classLoader = clp.getClassLoader(); Class courseClass = Class.forName(Course.class.getName(),true, classLoader); MethodKey getEvaluationModelMethod = new MethodKey(clp.getClassName(), "getEvaluationModel",courseClass); Object courseObj = translateCourse(course); returnObj = clp.invoke(new MethodHandler(getEvaluationModelMethod, courseObj)); } catch (Throwable t) { t = ClpSerializer.translateThrowable(t); if (t instanceof com.liferay.portal.kernel.exception.SystemException) { throw (com.liferay.portal.kernel.exception.SystemException)t; } if (t instanceof RuntimeException) { throw (RuntimeException)t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } return ((JSONObject)returnObj); }
public static Object invoke( boolean newInstance, String className, String methodName, String[] parameterTypeNames, Object... arguments) throws Exception { Thread currentThread = Thread.currentThread(); ClassLoader contextClassLoader = currentThread.getContextClassLoader(); try { currentThread.setContextClassLoader( PortalClassLoaderUtil.getClassLoader()); MethodKey methodKey = new MethodKeyPatched( className, methodName, parameterTypeNames, PortalClassLoaderUtil.getClassLoader()); MethodHandler methodHandler = new MethodHandler( methodKey, arguments); return methodHandler.invoke(newInstance); } catch (InvocationTargetException ite) { throw (Exception)ite.getCause(); } finally { currentThread.setContextClassLoader(contextClassLoader); } }