Config by java class instead of xml