Package org.javalite.async
Class Command
- java.lang.Object
-
- org.javalite.async.Command
-
-
Constructor Summary
Constructors Constructor Description Command()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract 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>
TfromXml(String commandXml)Method used by framework to de-serialize a command from XML.StringgetJMSMessageID()voidsetJMSMessageID(String jmsMessageId)byte[]toBytes()Flattens(serializes, dehydrates, etc.) this instance to a binary representation.StringtoXml()Serializes this object into XML.
-
-
-
Method Detail
-
fromXml
public static <T extends Command> T fromXml(String commandXml)
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
public final String 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
public byte[] toBytes() throws IOExceptionFlattens(serializes, dehydrates, etc.) this instance to a binary representation.- Returns:
- a binary representation
- Throws:
IOException
-
fromBytes
public static <T extends Command> T fromBytes(byte[] bytes) throws IOException
- Throws:
IOException
-
getJMSMessageID
public String getJMSMessageID()
-
setJMSMessageID
public void setJMSMessageID(String jmsMessageId)
-
-