本文整理匯總了Java中org.kuali.rice.ksb.messaging.remotedservices.Message類的典型用法代碼示例。如果您正苦於以下問題:Java Message類的具體用法?Java Message怎麽用?Java Message使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Message類屬於org.kuali.rice.ksb.messaging.remotedservices包,在下文中一共展示了Message類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: storeMessage
import org.kuali.rice.ksb.messaging.remotedservices.Message; //導入依賴的package包/類
public synchronized Message storeMessage(Message message) {
String id = message.getId();
if (id == null) {
lastMessageId++;
id = String.valueOf(lastMessageId);
message.setId(id);
}
messages.put(id, message);
return message;
}
示例2: Storage
import org.kuali.rice.ksb.messaging.remotedservices.Message; //導入依賴的package包/類
public Storage() {
inboxes = new HashMap<String, Inbox>();
messages = new HashMap<String, Message>();
lastInboxId = 0;
lastMessageId = 0;
}
示例3: retrieveMessage
import org.kuali.rice.ksb.messaging.remotedservices.Message; //導入依賴的package包/類
public Message retrieveMessage(String id) {
return messages.get(id);
}
示例4: deleteMessage
import org.kuali.rice.ksb.messaging.remotedservices.Message; //導入依賴的package包/類
public synchronized Message deleteMessage(String id) {
return messages.remove(id);
}
示例5: exerciseMessagingService
import org.kuali.rice.ksb.messaging.remotedservices.Message; //導入依賴的package包/類
/**
* This method ...
*
* @param inboxResource
* @param messageResource
*/
private void exerciseMessagingService(InboxResource inboxResource,
MessageResource messageResource) {
Inbox inbox = new Inbox();
inbox.setOwner("Joe Q. Tester");
inbox = inboxResource.createInbox(inbox);
Message message = new Message();
message.setRecipient("Joe Q. Tester");
message.setSubject("Hello new world!");
message.setText("This is a test message.");
Message createdMessage = messageResource.createMessage(message);
List<String> messages = inbox.getMessages();
messages.add(createdMessage.getId());
inboxResource.updateInbox(inbox);
inbox = inboxResource.retrieveInbox(inbox.getId());
List<String> updatedMessages = inbox.getMessages();
String updatedMessageId = updatedMessages.get(0);
Message retrievedMessage = messageResource.retrieve(updatedMessageId);
assertTrue(retrievedMessage.getSubject().equals("Hello new world!"));
}
示例6: createMessage
import org.kuali.rice.ksb.messaging.remotedservices.Message; //導入依賴的package包/類
/**
* This overridden method ...
*
* @see org.kuali.rice.ksb.messaging.remotedservices.MessageResource#createMessage(org.kuali.rice.ksb.messaging.remotedservices.Message)
*/
public Message createMessage(Message message) {
return storage.storeMessage(message);
}
示例7: retrieve
import org.kuali.rice.ksb.messaging.remotedservices.Message; //導入依賴的package包/類
/**
* This overridden method ...
*
* @see org.kuali.rice.ksb.messaging.remotedservices.MessageResource#retrieve(java.lang.String)
*/
public Message retrieve(String id) {
return storage.retrieveMessage(id);
}
示例8: update
import org.kuali.rice.ksb.messaging.remotedservices.Message; //導入依賴的package包/類
/**
* This overridden method ...
*
* @see org.kuali.rice.ksb.messaging.remotedservices.MessageResource#update(org.kuali.rice.ksb.messaging.remotedservices.Message)
*/
public void update(Message message) {
storage.storeMessage(message);
}