class DelegatingTokenHolder extends AbstractTokenHolderBase {

    @Override
    protected synchronized int createToken( String name ) throws KernelException
    {
        Integer id = tokenRegistry.getId( name );
        if ( id != null )
        {
            return id;
        }

        id = tokenCreator.createToken( name );
        try
        {
            tokenRegistry.put( new NamedToken( name, id ) );
        }
        catch ( NonUniqueTokenException e )
        {
            throw new IllegalStateException( "Newly created token should be unique.", e );
        }
        return id;
    }

    public  DelegatingTokenHolder( TokenCreator tokenCreator, String tokenType );

}