<commit_before>package no.tornado.brap.servlet;

import no.tornado.inject.ApplicationContext;

public class InjectProxyServlet extends ProxyServlet {

    protected Object getService() throws ClassNotFoundException, IllegalAccessException, InstantiationException {
        String beanName = servletConfig.getInitParameter("beanName");

        if (beanName == null)
            throw new RuntimeException("You must provide the \"beanName\" init-param to the InjectProxyServlet.");

        return ApplicationContext.getBean(beanName);
    }
}<commit_msg>Added support for Tornado Inject<commit_after>package no.tornado.brap.servlet;

import no.tornado.brap.auth.AuthenticationProvider;
import no.tornado.brap.auth.AuthorizationProvider;
import no.tornado.inject.ApplicationContext;

public class InjectProxyServlet extends ProxyServlet {

    public void createServiceWrapper() throws ClassNotFoundException, IllegalAccessException, InstantiationException {
        super.createServiceWrapper();

        String authenticationProviderBean = servletConfig.getInitParameter("authenticationProviderBeanName");
        if (authenticationProviderBean != null)
            serviceWrapper.setAuthenticationProvider((AuthenticationProvider) ApplicationContext.getBean("authenticationProviderBean"));

        String authorizationProviderBean = servletConfig.getInitParameter("authorizationProviderBeanName");
        if (authorizationProviderBean != null)
            serviceWrapper.setAuthorizationProvider((AuthorizationProvider) ApplicationContext.getBean("authorizationProviderBean"));
    }

    protected Object getService() throws ClassNotFoundException, IllegalAccessException, InstantiationException {
        String beanName = servletConfig.getInitParameter("beanName");

        if (beanName == null)
            throw new RuntimeException("You must provide the \"beanName\" init-param to the InjectProxyServlet.");

        return ApplicationContext.getBean(beanName);
    }
}
{'fraction_non_alphanumeric': 0.07777777777777778, 'fraction_numerical': 0.0, 'mean_word_length': 4.984894259818731, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3404729', 'n_tokens_mistral': 465, 'n_tokens_neox': 453, 'n_words': 102}