当前位置: 首页>>代码示例>>Java>>正文


Java Message.get方法代码示例

本文整理汇总了Java中com.liferay.portal.kernel.messaging.Message.get方法的典型用法代码示例。如果您正苦于以下问题:Java Message.get方法的具体用法?Java Message.get怎么用?Java Message.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.liferay.portal.kernel.messaging.Message的用法示例。


在下文中一共展示了Message.get方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: receive

import com.liferay.portal.kernel.messaging.Message; //导入方法依赖的package包/类
@Override
public void receive(Message message) throws MessageListenerException {
	// TODO Auto-generated method stub
	try {
		JSONObject msgData = (JSONObject) message.get("msgToEngine");
		
		boolean dossierFileSync = msgData.getBoolean("dossierFileSync");
		
		if (dossierFileSync) {
			_doReceiveKySoRequest(message);
		} else {
			_doReceiveJasperRequest(message);
		}
		
	} catch (Exception e) {
		_log.error("Unable to process message " + message, e);
	}
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:19,代码来源:Engine.java

示例2: receive

import com.liferay.portal.kernel.messaging.Message; //导入方法依赖的package包/类
@Override
public void receive(Message message) throws MessageListenerException {
	if(log.isDebugEnabled())log.debug("CleanLearningActivityTries receive");
	Message responseMessage = MessageBusUtil.createResponseMessage(message);
	responseMessage.setPayload("RECEIVED");
	try{
		this.la = (LearningActivity)message.get("learningActivity");	
		this.user = (User)message.get("userc");
		activityTriesDeleted = (ActivityTriesDeleted)message.get("activityTriesDeleted");
		onlyNotPassed = (Boolean)message.get("onlyNotPassed");
		process();
		MessageBusUtil.sendMessage(responseMessage.getDestinationName(), responseMessage);
	}catch(Exception e){
		if(log.isInfoEnabled())log.info(e.getMessage());
		if(log.isDebugEnabled())e.printStackTrace();
		
		e.printStackTrace();
	}
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:20,代码来源:CleanLearningActivityTriesAllUsers.java

示例3: receive

import com.liferay.portal.kernel.messaging.Message; //导入方法依赖的package包/类
@Override
public void receive(Message message) throws MessageListenerException {
	
	try {
		this.groupId	= message.getLong("groupId");
		this.fileName = message.getString("fileName");
		this.key = message.getString(key);
		this.serviceContext = (ServiceContext)message.get("serviceContext");
		this.themeDisplay = (ThemeDisplay)message.get("themeDisplay");
	
		Role adminRole = RoleLocalServiceUtil.getRole(themeDisplay.getCompanyId(),"Administrator");
		List<User> adminUsers = UserLocalServiceUtil.getRoleUsers(adminRole.getRoleId());
		 
		PrincipalThreadLocal.setName(adminUsers.get(0).getUserId());
		PermissionChecker permissionChecker = PermissionCheckerFactoryUtil.create(adminUsers.get(0));
		PermissionThreadLocal.setPermissionChecker(permissionChecker);
	
		MultiVMPoolUtil.put("exportCourseCache", key, true);
		try {
			doExportCourse();
		} finally {
			MultiVMPoolUtil.remove("exportCourseCache", key);
		}
		
		
	} catch (Exception e) {
		e.printStackTrace();
	}
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:30,代码来源:ExportCourse.java

示例4: receive

import com.liferay.portal.kernel.messaging.Message; //导入方法依赖的package包/类
@Override
public void receive(Message message) throws MessageListenerException {
	
	try {
		
		this.groupId	= message.getLong("groupId");
		this.newCourseName = message.getString("newCourseName");
		this.startDate 	= (Date)message.get("startDate");
		this.endDate 	= (Date)message.get("endDate");
		this.serviceContext = (ServiceContext)message.get("serviceContext");
		this.themeDisplay = (ThemeDisplay)message.get("themeDisplay");
		this.childCourse =(Boolean)message.get("childCourse");
		this.visible = message.getBoolean("visible");
		this.includeTeacher = message.getBoolean("includeTeacher");
		this.cloneForum = message.getBoolean("cloneForum");
		Role adminRole = RoleLocalServiceUtil.getRole(themeDisplay.getCompanyId(),"Administrator");
		List<User> adminUsers = UserLocalServiceUtil.getRoleUsers(adminRole.getRoleId());
		 
		PrincipalThreadLocal.setName(adminUsers.get(0).getUserId());
		PermissionChecker permissionChecker =PermissionCheckerFactoryUtil.create(adminUsers.get(0), true);
		PermissionThreadLocal.setPermissionChecker(permissionChecker);
	
		doCloneCourse();
		
	} catch (Exception e) {
		e.printStackTrace();
	}
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:29,代码来源:CloneCourse.java

示例5: receive

import com.liferay.portal.kernel.messaging.Message; //导入方法依赖的package包/类
@Override
public void receive(Message message) throws MessageListenerException {
	
	try {
		
		this.newEditionName = message.getString("newEditionName");
		this.startDate 	= (Date)message.get("startDate");
		this.endDate 	= (Date)message.get("endDate");
		this.serviceContext = (ServiceContext)message.get("serviceContext");
		this.themeDisplay = (ThemeDisplay)message.get("themeDisplay");
		this.parentCourseId = (Long)message.get("parentCourseId");
		this.isLinked = (Boolean)message.get("isLinked");
		this.startExecutionDate = (Date) message.get("startExecutionDate");
		this.endExecutionDate = (Date) message.get("endExecutionDate");
		this.editionFriendlyURL = (String)message.get("editionFriendlyURL");
		this.editionLayoutId = (Long)message.get("editionLayoutId");
		log.debug("Parent Course Id: "+parentCourseId);
		Role adminRole = RoleLocalServiceUtil.getRole(themeDisplay.getCompanyId(),"Administrator");
		List<User> adminUsers = UserLocalServiceUtil.getRoleUsers(adminRole.getRoleId());
		 
		PrincipalThreadLocal.setName(adminUsers.get(0).getUserId());
		PermissionChecker permissionChecker =PermissionCheckerFactoryUtil.create(adminUsers.get(0));
		PermissionThreadLocal.setPermissionChecker(permissionChecker);
	
		doCreateEdition();
		
		
		
	} catch (Exception e) {
		e.printStackTrace();
	}
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:33,代码来源:CreateEdition.java

示例6: receive

import com.liferay.portal.kernel.messaging.Message; //导入方法依赖的package包/类
@Override
public void receive(Message message) throws MessageListenerException {
	Message responseMessage = MessageBusUtil.createResponseMessage(message);

	responseMessage.setPayload("RECEIVED");

	try{
		this.la = (LearningActivity)message.get("learningActivity");
		this.user = (User)message.get("user");
		User userc = (User)message.get("userc");

		createInstance(la.getCompanyId(),la.getGroupId(),userc.getUserId(), la.getModuleId(), la.getActId());
		
		if(log.isDebugEnabled())log.debug(" LearningActivity: " + la.getTitle(Locale.getDefault()) + " - " + la.getActId() + " - " +user.getFullName());
		
		process();
		MessageBusUtil.sendMessage(responseMessage.getDestinationName(), responseMessage);

	}catch(Exception e){
		if(log.isInfoEnabled())log.info(e.getMessage());
		if(log.isDebugEnabled())e.printStackTrace();
	} finally {
		endInstance();
	}
	
	
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:28,代码来源:CleanLearningActivityTriesUser.java

示例7: _doReceiveKySoRequest

import com.liferay.portal.kernel.messaging.Message; //导入方法依赖的package包/类
private void _doReceiveKySoRequest(Message message) {
	
	try {
		
		JSONObject msgData = (JSONObject) message.get("msgToEngine");
		
		long dossierFileId = msgData.getLong("dossierFileId");
		
		DossierFile dossierFile = DossierFileLocalServiceUtil.fetchDossierFile(dossierFileId);
		
		dossierFile.setIsNew(true);
		
		DossierFileLocalServiceUtil.updateDossierFile(dossierFile);
		
		Indexer<DossierFile> indexer = IndexerRegistryUtil.nullSafeGetIndexer(DossierFile.class);
		
		indexer.reindex(dossierFile);
		
	} catch (SearchException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:24,代码来源:Engine.java

示例8: _doReceiveJasperRequest

import com.liferay.portal.kernel.messaging.Message; //导入方法依赖的package包/类
private void _doReceiveJasperRequest(Message message) {
	// TODO Auto-generated method stub
	_log.info("Jasper processing .............................");
	JSONObject msgData = (JSONObject) message.get("msgToEngine");

	File file = FileUtil.createTempFile(JRReportUtil.DocType.PDF.toString());

	try {

		long userId = msgData.getLong("userId");

		long classPK = msgData.getLong("classPK");

		String className = msgData.getString("className");
		
		JSONObject jsonData = JSONFactoryUtil.createJSONObject();
		try {
			jsonData = JSONFactoryUtil.createJSONObject(msgData.getString("formData"));
		} catch (JSONException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}

		String fileExport = JRReportUtil.createReportFile(msgData.getString("jrxmlTemplate"),
				jsonData.toJSONString(), null, file.getCanonicalPath());

		if (Validator.isNotNull(fileExport)) {
			
			_log.info("Jasper export success: " + fileExport);
			
			JSONObject msgDataIn = JSONFactoryUtil.createJSONObject();
			msgDataIn.put("className", className);
			msgDataIn.put("classPK", classPK);
			msgDataIn.put("userId", userId);
			msgDataIn.put("filePath", fileExport );
			
			message.put("msgToEngine", msgDataIn);
			MessageBusUtil.sendMessage("jasper/dossier/in/destination", message);
		}

	} catch (Exception e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}

}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:47,代码来源:Engine.java

示例9: receive

import com.liferay.portal.kernel.messaging.Message; //导入方法依赖的package包/类
@Override
public void receive(Message message) throws MessageListenerException {
	String action = message.getString(UserLogKeys.UserActivityMessageKeys.ACTION);
	String description = message.getString(UserLogKeys.UserActivityMessageKeys.DESCRIPTION);
	
	long userId = message.getLong(UserLogKeys.UserActivityMessageKeys.USER_ID);
	long groupId = message.getLong(UserLogKeys.UserActivityMessageKeys.GROUP_ID);
	long companyId = message.getLong(UserLogKeys.UserActivityMessageKeys.COMPANY_ID);
	
	String email  = message.getString(UserLogKeys.UserActivityMessageKeys.EMAIL);
	String userName  = message.getString(UserLogKeys.UserActivityMessageKeys.USER_NAME);
	Date createDate = (Date) message.get(UserLogKeys.UserActivityMessageKeys.CREATE_DATE);
	String site = message.getString(UserLogKeys.UserActivityMessageKeys.SITE);
	String page  = message.getString(UserLogKeys.UserActivityMessageKeys.PAGE);
	String ip = message.getString(UserLogKeys.UserActivityMessageKeys.IP);
	String sessionId = message.getString(UserLogKeys.UserActivityMessageKeys.SESSION_ID);
	String url = message.getString(UserLogKeys.UserActivityMessageKeys.URL);
	String userAgent = message.getString(UserLogKeys.UserActivityMessageKeys.USER_AGENT);
	try {
		log.info(action+"-----userId: "+userId+"--groupId:"+groupId+"--companyId: "+companyId
				+"--username: "+userName+"--email: "+email+"--createdate: "+createDate+"---description: "+description
				+"--site: "+site+"--page: "+page+"--ip: "+ip+"--url: "+url+"--useragent: "+userAgent);
		UserActivity userActivity= UserActivityLocalServiceUtil
				.addUserActivity(userId, groupId, companyId, createDate, userName, email, site, page, action, description, url, sessionId, ip, userAgent);
		log.info("--add new UserActivity success !");
		NewUserLog newUserLog= NewUserLogLocalServiceUtil.getByUserId(userId);
		if(newUserLog!=null){
			newUserLog=  NewUserLogLocalServiceUtil
					.updateNewUserLog(userId, groupId, companyId, createDate, userName, email,
							site, page, action, description, userActivity.getId());
			log.info("update NewUserLog success !");
		}else{
			newUserLog=NewUserLogLocalServiceUtil
					.addNewUserLog(userId, groupId, companyId, createDate, userName, email, 
							site, page, action, description, userActivity.getId());
			log.info("insert NewUserLog success !");
		}
	} catch(Exception ex){
		log.error(ex);
	}
}
 
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:42,代码来源:UserLogMessageImpl.java

示例10: doReceive

import com.liferay.portal.kernel.messaging.Message; //导入方法依赖的package包/类
@Override
protected void doReceive(Message message) throws Exception {

	if (_log.isDebugEnabled()) {
		_log.debug("doReceive(message = " + JSONFactoryUtil.serialize(message) + ")");
	}

	SocialActivity activity = (SocialActivity)message.get("activity");
	AssetEntry assetEntry = (AssetEntry)message.get("assetEntry");

	long activityId = activity.getActivityId();

	SocialActivity fetchedActivity = SocialActivityLocalServiceUtil.fetchSocialActivity(activityId);

	boolean consistent = fetchedActivity != null;

	consistent = consistent
			&& (assetEntry == null || assetEntry.equals(fetchedActivity.getAssetEntry()));

	if (consistent) {

		BadgeInstanceLocalServiceUtil.processSocialActivity(activityId);

	} else {

		MessageSender.resendMessage(message);
	}
}
 
开发者ID:slemarchand,项目名称:gamification-portlet,代码行数:29,代码来源:SocialActivityProcessingMessageListener.java


注:本文中的com.liferay.portal.kernel.messaging.Message.get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。