class SerializerManager {

    private static Serializer[]        serializers    = new Serializer[5];
    public static final byte           Hessian2       = 1;
    //public static final byte    Json        = 2;

    private static final ReentrantLock REENTRANT_LOCK = new ReentrantLock();

    public static Serializer getSerializer(int idx) {
        Serializer currentSerializer = serializers[idx];
        if (currentSerializer == null && idx == Hessian2) {
            REENTRANT_LOCK.lock();
            try {
                currentSerializer = serializers[idx];
                if (currentSerializer == null) {
                    currentSerializer = new HessianSerializer();
                    addSerializer(Hessian2, currentSerializer);
                }
            } finally {
                REENTRANT_LOCK.unlock();
            }
        }
        return currentSerializer;
    }

    public static void addSerializer(int idx, Serializer serializer) {<FILL_FUNCTION_BODY>}
}

        if (serializers.length <= idx) {
            Serializer[] newSerializers = new Serializer[idx + 5];
            System.arraycopy(serializers, 0, newSerializers, 0, serializers.length);
            serializers = newSerializers;
        }
        serializers[idx] = serializer;
    
<no_super_class>