@Override
    protected <T> HasSchema<T> writePojoIdTo(Output output, int fieldNumber, Class<T> clazz)
            throws IOException
    {
        int id;
        BaseHS<T> wrapper = getBaseHS(clazz, true);

        // wait till everything is completely set
        while (0 == (id = wrapper.id))
            LockSupport.parkNanos(1);

        output.writeUInt32(fieldNumber, id, false);

        return wrapper;
    }
Register a {@link Delegate} and assign an id.
<p>
Delegate ids start at 1.
protostuff-runtime-registry/src/main/java/io/protostuff/runtime/IncrementalIdStrategy.java