What is a good approach to associate @before function with this of a REST interface?

int someBeforeFunction(HTTPServerRequest req, HTTPServerResponse res)
{
    // I want my REST implementation here!
    return 0;
}

interface MyInterface
{
    @before!someBeforeFunction("some"):
    void myFunction(int some);
}

Currently the only approach i see is referencing through an explicit static variable. Is there a better solution?