I'm currently testing out osgi (Spring DM) on a new application. The application needs to be able to listen to file system events. Today I've solved this with a simple time based poller, but when Java 7 is released I probably want to replace that with a NIO2 based implementation.
So far I'm looking at three bundles, two for the file service implementations and one for the business logic consuming one of the services. The two implementations should implement the same interface so my question is, where to place that interface? Placing the interface in the bundle containing the implementation would cause the service to depend on one of its consumers.
What would be the best and most osgi-like way to structure this? So far my best bet is to create a new "api" bundle defining the common interfaces for the implementations.