Add headers and events to serialization

- Relates to #35
- Now event headers and extended state variables
  are serialized with kryo and zookeeper.
This commit is contained in:
Janne Valkealahti
2015-07-05 09:52:36 +01:00
parent cb3b811707
commit bba4bc1d28
5 changed files with 184 additions and 9 deletions

View File

@@ -33,11 +33,11 @@ public interface StateMachinePersist<S, E, T> {
* Write a {@link StateMachineContext} into a persistent store
* with a context object {@code T}.
*
* @param contect the contect
* @param context the context
* @param contextOjb the context ojb
* @throws Exception the exception
*/
void write(StateMachineContext<S, E> contect, T contextOjb) throws Exception;
void write(StateMachineContext<S, E> context, T contextOjb) throws Exception;
/**
* Read a {@link StateMachineContext} from a persistent store

View File

@@ -37,6 +37,15 @@ public class DefaultExtendedState implements ExtendedState {
this.variables = new HashMap<Object, Object>();
}
/**
* Instantiates a new default extended state.
*
* @param variables the variables
*/
public DefaultExtendedState(Map<Object, Object> variables) {
this.variables = variables;
}
@Override
public Map<Object, Object> getVariables() {
return variables;