
org.objectweb.dream.protocol.ExportIdentifierChunk Maven / Gradle / Ivy
/**
* Dream
* Copyright (C) 2003-2004 INRIA Rhone-Alpes
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Contact: [email protected]
*
* Initial developer(s): Matthieu Leclercq
* Contributor(s):
*/
package org.objectweb.dream.protocol;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import org.objectweb.dream.message.AbstractChunk;
import org.objectweb.dream.util.Util;
/**
* A chunk containing an export identifier.
*
* @see ExportIdentifier
*/
public class ExportIdentifierChunk extends AbstractChunk
{
/** The default name of chunk of this type. */
public static final String DEFAULT_NAME = "export-id-chunk";
private static final long serialVersionUID = 6387100144673780804L;
private ExportIdentifier exportIdentifier;
// ---------------------------------------------------------------------------
// Chunk methods
// ---------------------------------------------------------------------------
/**
* @return Returns the exportIdentifier.
*/
public ExportIdentifier getExportIdentifier()
{
return exportIdentifier;
}
/**
* @param exportIdentifier The exportIdentifier to set.
*/
public void setExportIdentifier(ExportIdentifier exportIdentifier)
{
this.exportIdentifier = exportIdentifier;
}
// ---------------------------------------------------------------------------
// Implementation of the Chunk interface
// ---------------------------------------------------------------------------
/**
* @see AbstractChunk#newChunk()
*/
public ExportIdentifierChunk newChunk()
{
return new ExportIdentifierChunk();
}
/**
* @see AbstractChunk#transfertStateTo(AbstractChunk)
*/
public void transfertStateTo(ExportIdentifierChunk newInstance)
{
newInstance.setExportIdentifier(exportIdentifier);
}
/**
* @see org.objectweb.dream.pool.Recyclable#recycle()
*/
public void recycle()
{
exportIdentifier = null;
}
// ---------------------------------------------------------------------------
// Implementation of the Externalizable interfaces
// ---------------------------------------------------------------------------
/**
* @see java.io.Externalizable#writeExternal(ObjectOutput)
*/
public void writeExternal(ObjectOutput out) throws IOException
{
Util.writeObject(out, exportIdentifier);
}
/**
* @see java.io.Externalizable#readExternal(ObjectInput)
*/
public void readExternal(ObjectInput in) throws IOException,
ClassNotFoundException
{
exportIdentifier = (ExportIdentifier) Util.readObject(in);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy