Hello. I'm using a BundleTracker to instantiate services based on the contents of specially-crafted bundle manifest entries. This is working nicely, but the one thing I don't really have is good error reporting: The code that does the processing of bundles doesn't expose any services itself and I don't really have any way to determine from elsewhere in the program if processing a bundle has failed. Is there a preferred design pattern for handling this?
One good option would appear to be the Event Admin, but the downside to this is that (unless I'm wrong), I'd need to use the core OSGi APIs to subscribe to events. That's not a huge downside, but it does mean that code that otherwise has no interest in OSGi specifically has to depend on the APIs (unless I write some other abstraction that relays events to something like an rxjava Observable, and external code can subscribe to this instead). Perhaps the right thing to do in this case is to simply publish errors to the Event Admin and just assume that some other code will subscribe and take care of the errors? Any opinions? I appreciate that the question is a bit vague, but I've not actually seen error reporting discussed in any literature. M
pgpY8ZpgsCeyk.pgp
Description: OpenPGP digital signature
_______________________________________________ OSGi Developer Mail List osgi-dev@mail.osgi.org https://mail.osgi.org/mailman/listinfo/osgi-dev