Updated to use JavaConfig.