package org.jboss.proxy;
import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import org.jboss.invocation.Invocation;
public abstract class Interceptor
implements Externalizable
{
private static final long serialVersionUID = 4358098404672505200L;
protected Interceptor nextInterceptor;
public Interceptor setNext(final Interceptor interceptor) {
nextInterceptor = interceptor;
return interceptor;
}
public Interceptor getNext() {
return nextInterceptor;
}
public abstract Object invoke(Invocation mi) throws Throwable;
public void writeExternal(final ObjectOutput out)
throws IOException
{
out.writeObject(nextInterceptor);
}
public void readExternal(final ObjectInput in)
throws IOException, ClassNotFoundException
{
nextInterceptor = (Interceptor)in.readObject();
}
}