Package org.javalite.async
Class Command
java.lang.Object
org.javalite.async.Command
Super class of all commands. Only the method
execute() is to be provided by subclasses to
do real application work.- Author:
- Igor Polevoy on 4/4/15.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidexecute()Subclasses are to provide implementation of this method to get application-specific work done.static <T extends Command>
TfromBytes(byte[] bytes)static <T extends Command>
TMethod used by framework to de-serialize a command from XML.voidsetJMSMessageID(String jmsMessageId)byte[]toBytes()Flattens(serializes, dehydrates, etc.) this instance to a binary representation.toXml()Serializes this object into XML.
-
Constructor Details
-
Command
public Command()
-
-
Method Details
-
fromXml
Method used by framework to de-serialize a command from XML.- Parameters:
commandXml- XML representation of a command.- Returns:
- new instance of a command initialized with data from
commandXmlargument.
-
execute
public abstract void execute()Subclasses are to provide implementation of this method to get application-specific work done. -
toXml
Serializes this object into XML. The output is used byfromXml(String)to de-serialize a command after it passes through messaging broker.- Returns:
- XML representation of this instance.
-
toBytes
Flattens(serializes, dehydrates, etc.) this instance to a binary representation.- Returns:
- a binary representation
- Throws:
IOException
-
fromBytes
- Throws:
IOException
-
getJMSMessageID
-
setJMSMessageID
-