I have a service in form of interface and i want users to provide services ie give service providers by implementing my service
Users provide services in from of jar files which also contains META-INF/Service/ package.Service file
I am using follwing code in my main Class to load a service provider from jar but failed... i am using Eclipse ..
URLClassLoader urlloader = new URLClassLoader(new URL[]{ new File("file:///c:/jars/Test.jar").toURI().toURL() });
ServiceLoader<Foo> impl = ServiceLoader.load(Foo.class, urlloader);
System.out.println("Using " + impl.getClass());
Service provider is not loading by this code ...kindly help me!