com.codemonster.surinam.mgmt
Class ActionDocumentConverter

java.lang.Object
  extended by com.codemonster.surinam.mgmt.ActionDocumentConverter

public class ActionDocumentConverter
extends Object

This is a converter that moves Action Documents back and forth between its two natural forms, an XML 'Action Document' and an 'Action Sequence'. The XML form is well suited for storage and transmission over networks while the sequence form is designed for runtime operations where the object form allows it to interact with other objects in the execution context.

Its worth mentioning that Action Documents do not just describe a service but also include both construction and command instructions. It is this data that melds with Action objects to execute directly on Service Blocks to implement the command. This keeps the instruction logic, out of the block itself and leaves the Action Sequence set open for future expansion since an Action object merely becomes a consumer of the Service Block's API.

Be aware that converting an action sequence to XML strips out the original comments or other structure that might have been in the original document(s) and converts it to a list of action objects can be fed into the ServiceBlockCommander.

Note that this converter only goes one-way. Normally, getting an Action Document out of the system to persist comes from the BlueprintManager. This is because there is an assumption that if you had an ActionSequence, it probably started with XML... therefore, you already have the XML and don't need to convert it back again. This does not address the edge case where you have created the sequence programmatically but still need to turn it into XML; currently there doesn't seem to be much use for that.

See Also:
ServiceBlockCommander

Constructor Summary
ActionDocumentConverter()
           
 
Method Summary
static ActionSequence toSequence(String actionXML)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionDocumentConverter

public ActionDocumentConverter()
Method Detail

toSequence

public static ActionSequence toSequence(String actionXML)


Copyright © 2010. All Rights Reserved.