Added ability to set the service. Used from junit tests which are not
run with OSGI.