like this?

public class Util {

    private static SessionFactory sessionFactory;
    private static ServiceRegistry serviceRegistry;

    public static SessionFactory configureSessionFactory() {
        Configuration configuration = new Configuration();
        configuration.configure();
        serviceRegistry = new ServiceRegistryBuilder().applySettings(
                configuration.getProperties()).buildServiceRegistry();
        sessionFactory = configuration.buildSessionFactory(serviceRegistry);
        return sessionFactory;
    }
}


in hibernate4.1.9 buildsessionfactory method is deprecated so why serviceRegistry is paased to buildsessionFactory
I want to see if the HTTP proxy support for an application is working correctly. In order to check this I have installed a Ubuntu VirtualBox on my Mac laptop and I want to configure the virtual machine so that it has no access to any other internet host except my test proxy server.

How can I configure the virtual machine? From what I've read it sounds like "route add ..." should be able to do it but I'm not sure exactly how to use it.

Please advise! Thanks!
