pt.digitalis.dif.dem.managers.impl
Class MessageManagerImpl

java.lang.Object
  extended by pt.digitalis.dif.dem.managers.impl.AbstractMessageManager
      extended by pt.digitalis.dif.dem.managers.impl.MessageManagerImpl
All Implemented Interfaces:
IMessageManager

public class MessageManagerImpl
extends AbstractMessageManager

Manages the DEM messages, providing operations for access, pooling and persistence.

Author:
Pedro Viegas pviegas@digitalis.pt, Rodrigo Gonçalves rgoncalves@digitalis.pt
Created on:
2007/06/01

Field Summary
 
Fields inherited from class pt.digitalis.dif.dem.managers.impl.AbstractMessageManager
DEFAULT_MESSAGE_FILE_EXTENSION, MESSAGES_FOLDER, NUMBER_SIGN
 
Constructor Summary
MessageManagerImpl()
           
 
Method Summary
 MessageList collectEntityMessagesFromRepository(Class<?> clazz)
          Collect entity messages from resource LanguageID, MessageID, theMessageObject
 MessageList collectEntityMessagesFromRepository(Entity type, Object instance)
          Collect entity messages from resource LanguageID, MessageID, theMessageObject
 MessageList collectEntityMessagesFromRepository(Entity type, String id, String className, String parentID)
          Collect entity messages from resource LanguageID, MessageID, theMessageObject
 MessageList collectEntityMessagesFromRepository(String messagePath)
          Collect entity messages from resource LanguageID, MessageID, theMessageObject
 boolean isPersistent()
           
protected  MessageList readMessageFile(String fileName, String entityName)
          Does the actual reading of the resource file
 
Methods inherited from class pt.digitalis.dif.dem.managers.impl.AbstractMessageManager
addSupportedLanguage, getEntityID, getMessageList, getMessageList, getMessageList, getMessageList, getMessageList, getMessages, getMessages, getMessages, getMessages, getSupportedLanguages, invalidateMessages, isLanguageSupported, updateMessage, updateMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageManagerImpl

public MessageManagerImpl()
Method Detail

collectEntityMessagesFromRepository

public MessageList collectEntityMessagesFromRepository(Class<?> clazz)
Description copied from interface: IMessageManager
Collect entity messages from resource LanguageID, MessageID, theMessageObject

Parameters:
clazz - the class to read the messages from
Returns:
the collected messages
See Also:
IMessageManager.collectEntityMessagesFromRepository(java.lang.Class)

collectEntityMessagesFromRepository

public MessageList collectEntityMessagesFromRepository(Entity type,
                                                       Object instance)
Description copied from interface: IMessageManager
Collect entity messages from resource LanguageID, MessageID, theMessageObject

Parameters:
type - the type of the entity or null if it's not a DEM entity
instance - the entity instance
Returns:
the collected messages
See Also:
IMessageManager.collectEntityMessagesFromRepository(pt.digitalis.dif.dem.Entity, java.lang.Object)

collectEntityMessagesFromRepository

public MessageList collectEntityMessagesFromRepository(Entity type,
                                                       String id,
                                                       String className,
                                                       String parentID)
                                                throws pt.digitalis.utils.inspection.exception.ResourceNotFoundException
Description copied from interface: IMessageManager
Collect entity messages from resource LanguageID, MessageID, theMessageObject

Parameters:
type - the type of the entity or null if it's not a DEM entity
id - the entity id
className - the class name
parentID - the entity's parent ID
Returns:
the collected messages
Throws:
pt.digitalis.utils.inspection.exception.ResourceNotFoundException - if a needed resource for message collection can't be found
See Also:
IMessageManager.collectEntityMessagesFromRepository(pt.digitalis.dif.dem.Entity, java.lang.String, java.lang.String, java.lang.String)

collectEntityMessagesFromRepository

public MessageList collectEntityMessagesFromRepository(String messagePath)
Description copied from interface: IMessageManager
Collect entity messages from resource LanguageID, MessageID, theMessageObject

Parameters:
messagePath - the messagePath for the message file (without the ".messages.xx" suffix)
Returns:
the collected messages
See Also:
IMessageManager.collectEntityMessagesFromRepository(java.lang.String)

isPersistent

public boolean isPersistent()
Returns:
T this implementation supports saving messages to a persistent media. If F changes will be lost after a server restart
See Also:
IMessageManager.isPersistent()

readMessageFile

protected MessageList readMessageFile(String fileName,
                                      String entityName)
Does the actual reading of the resource file

Parameters:
fileName - the name of the message resource file to read
entityName - the name of the entity to witch we are loading the messages
Returns:
the read messages


Copyright © 2014 Digitalis Informática Lda. All Rights Reserved.