001/*
002 * $RCSfile: ObjectMismatchTrigger.java,v $
003 * $Revision: 1.1.2.2 $ $Date: 2011/07/17 19:24:12 $
004 * 
005 * Copyright 2011 Kabira Technologies, Inc. All rights reserved.
006 */
007
008package com.kabira.platform;
009
010import java.io.ObjectStreamClass;
011import java.io.ObjectOutputStream;
012import java.io.ObjectInputStream;
013import java.io.IOException;
014
015/**
016 * Indicate that this class implements mismtached object triggers.
017 * These triggers are invoked for an instance when an class change has
018 * been detected on a remote node. 
019 * <p>
020 * This interface will only affect Managed types.
021 */
022public interface ObjectMismatchTrigger
023{
024    /**
025     * Called when writing data to a mismatched node. The remoteClassDescriptor
026     * will be populated by distribution, and will contain the field
027     * description of the remote class, the application can use that to
028     * determine what to write.
029     */
030    public void writeObjectToStream(
031                ManagedObjectStreamClass remoteClassDescriptor,
032                ObjectOutputStream out) throws IOException;
033
034    /**
035     * Called when reading data from a mismatched node. The
036     * remoteClassDescriptor will be populated by distribution, and will
037     * contain the field description of the remote class, the application
038     * will use that to determine how to read the stream.
039     */
040    public void readObjectFromStream(
041                ManagedObjectStreamClass remoteClassDescriptor,
042                ObjectInputStream in) throws IOException;
043}
044