I'd like to expose a component's interface as an interface and the implementing class would be package protected (and maybe in some other package):
package baz.iface
interface Foo {
void bar();
}
package baz.whatever
@Component
class SpringyFoo implements baz.iface.Foo {
public void bar() { frobnicate(); }
}
Assuming baz.whatever
is in the component-scan
, will Spring be able to autowire a baz.iface.Foo
somewhere else?
class FooClient {
@Autowired
private baz.iface.Foo;
}