Search in sources :

Example 1 with ParticipantDeserializer

use of org.jboss.narayana.rest.integration.api.ParticipantDeserializer in project narayana by jbosstm.

the class RecoveryManager method recreateParticipant.

private Participant recreateParticipant(final InputObjectState inputObjectState, final String applicationId) throws IOException {
    final ParticipantDeserializer deserializer = deserializers.get(applicationId);
    final byte[] participantBytes = inputObjectState.unpackBytes();
    Participant participant = deserializer.recreate(participantBytes);
    if (participant == null) {
        final ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(participantBytes);
        final ObjectInputStream objectInputStream = new ObjectInputStream(byteArrayInputStream);
        participant = deserializer.deserialize(objectInputStream);
    }
    return participant;
}
Also used : Participant(org.jboss.narayana.rest.integration.api.Participant) PersistableParticipant(org.jboss.narayana.rest.integration.api.PersistableParticipant) ByteArrayInputStream(java.io.ByteArrayInputStream) ParticipantDeserializer(org.jboss.narayana.rest.integration.api.ParticipantDeserializer) ObjectInputStream(java.io.ObjectInputStream)

Aggregations

ByteArrayInputStream (java.io.ByteArrayInputStream)1 ObjectInputStream (java.io.ObjectInputStream)1 Participant (org.jboss.narayana.rest.integration.api.Participant)1 ParticipantDeserializer (org.jboss.narayana.rest.integration.api.ParticipantDeserializer)1 PersistableParticipant (org.jboss.narayana.rest.integration.api.PersistableParticipant)1