class SimpleCredentialsFactoryBean implements FactoryBean<SimpleCredentials> {

    @Override
    public SimpleCredentials getObject() throws Exception {
        if (simpleCredentials == null) {
            simpleCredentials = new SimpleCredentials(userID, password.toCharArray());
        }
        return simpleCredentials;
    }

}