The service-registry can handle classes just as well as interfaces. That means you can expose the generated class directly as a service:
<service>
<provide interface="your.generated.clazz"/>
</service>
This is not good practice though, for several reasons:
- You'd have to export the generated class from your bundle, exposing implementation details, which hurts modularity.
- It is not clear weather the generated class respects the OSGi service lifecycle.
Ideally, you'd write a proxy-service that uses the generated class, exposes all the OSGi-specific functions and implements the interface you want to expose.