org.jbpm.marshalling.impl
Class ProcessInstanceResolverStrategy
java.lang.Object
org.jbpm.marshalling.impl.ProcessInstanceResolverStrategy
- All Implemented Interfaces:
- org.kie.api.marshalling.ObjectMarshallingStrategy
public class ProcessInstanceResolverStrategy
- extends Object
- implements org.kie.api.marshalling.ObjectMarshallingStrategy
When using this strategy, knowledge session de/marshalling process will make sure that
the processInstance is not serialized as a part of the the session/network.
Instead, this strategy, which may only be used for ProcessInstance
objects,
saves the process instance in the ProcessInstanceManager
, and later retrieves
it from there.
If you're doing tricky things with serialization and persistence, please make sure
to remember that the ProcessInstanceManager
cache of process instances is emptied
at the end of every transaction (commit).
Nested classes/interfaces inherited from interface org.kie.api.marshalling.ObjectMarshallingStrategy |
org.kie.api.marshalling.ObjectMarshallingStrategy.Context |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ProcessInstanceResolverStrategy
public ProcessInstanceResolverStrategy()
accept
public boolean accept(Object object)
- Specified by:
accept
in interface org.kie.api.marshalling.ObjectMarshallingStrategy
write
public void write(ObjectOutputStream os,
Object object)
throws IOException
- Specified by:
write
in interface org.kie.api.marshalling.ObjectMarshallingStrategy
- Throws:
IOException
read
public Object read(ObjectInputStream is)
throws IOException,
ClassNotFoundException
- Specified by:
read
in interface org.kie.api.marshalling.ObjectMarshallingStrategy
- Throws:
IOException
ClassNotFoundException
retrieveProcessInstanceManager
public static ProcessInstanceManager retrieveProcessInstanceManager(Object streamContext)
- Retrieve the
ProcessInstanceManager
object from the ObjectOutput- or ObjectInputStream.
The stream object will secretly also either be a MarshallerReaderContext
or a
MarshallerWriteContext
.
- Parameters:
streamContext
- The marshaller stream/context.
- Returns:
- A
ProcessInstanceManager
object.
retrieveKnowledgeRuntime
public static org.drools.core.common.InternalKnowledgeRuntime retrieveKnowledgeRuntime(Object streamContext)
- Retrieve the
ProcessInstanceManager
object from the ObjectOutput- or ObjectInputStream.
The stream object will secretly also either be a MarshallerReaderContext
or a
MarshallerWriteContext
.
The knowledge runtime object is useful in order to reconnect the process instance to the
process and the knowledge runtime object.
- Parameters:
streamContext
- The marshaller stream/context.
- Returns:
- A
InternalKnowledgeRuntime
object.
marshal
public byte[] marshal(org.kie.api.marshalling.ObjectMarshallingStrategy.Context context,
ObjectOutputStream os,
Object object)
throws IOException
- Specified by:
marshal
in interface org.kie.api.marshalling.ObjectMarshallingStrategy
- Throws:
IOException
unmarshal
public Object unmarshal(org.kie.api.marshalling.ObjectMarshallingStrategy.Context context,
ObjectInputStream is,
byte[] object,
ClassLoader classloader)
throws IOException,
ClassNotFoundException
- Specified by:
unmarshal
in interface org.kie.api.marshalling.ObjectMarshallingStrategy
- Throws:
IOException
ClassNotFoundException
createContext
public org.kie.api.marshalling.ObjectMarshallingStrategy.Context createContext()
- Specified by:
createContext
in interface org.kie.api.marshalling.ObjectMarshallingStrategy
Copyright © 2001-2013 JBoss by Red Hat. All Rights Reserved.