Interface MessageFactory<T>
-
- All Known Implementing Classes:
PersistenceMessageFactory
public interface MessageFactory<T>Factory for creating aMessageto be sent viaNotificationHandler, based on an entity.- Author:
- Jeff Fischer
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description org.springframework.messaging.Message<T>createMessage(Object entity)Create aMessagebased on an entity instance.default org.springframework.messaging.Message<T>createMessage(Object entity, Map<String,Object> attributes)Create aMessagebased on an entity instance.
-
-
-
Method Detail
-
createMessage
org.springframework.messaging.Message<T> createMessage(Object entity)
Create aMessagebased on an entity instance.- Parameters:
entity- The entity whose information informs theMessage- Returns:
- The message to send via the
NotificationHandler
-
createMessage
default org.springframework.messaging.Message<T> createMessage(Object entity, Map<String,Object> attributes)
Create aMessagebased on an entity instance. This method is called when the originating entity is an instance ofMessageAdditionalInformationAware. In this case,MessageAdditionalInformationAware.unwrap()is called for theentityparameter, andMessageAdditionalInformationAware.getAttributes()is called to fulfill theattributesparameter before entering this method. SeeDefaultNotificationHandler.notify(NotificationStateAware, NotificationState, NotificationStateRepository)for more information on caller behavior.- Parameters:
entity- The entity whose information informs theMessageattributes- Additional attributes used duringMessagecreation- Returns:
- The message to send via the
NotificationHandler
-
-