Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability for a ServiceProvider to fail with an exception #188

Open
ljacomet opened this issue Dec 15, 2016 · 2 comments
Open

Ability for a ServiceProvider to fail with an exception #188

ljacomet opened this issue Dec 15, 2016 · 2 comments
Assignees
Labels

Comments

@ljacomet
Copy link
Member

ljacomet commented Dec 15, 2016

When working on ehcache/ehcache3#1710 we simplified the lifecycle between client and server by moving bits of configuration into the entity creation. However, we had to do some configuration tricks between the entity and the corresponding state service as we cannot fail service retrieval, there is not supported exception path.

Could we consider adding a ServiceCreationException or similar when a ServiceProvider knows that the configuration cannot be honoured?

@jd0-sag
Copy link
Contributor

jd0-sag commented Dec 15, 2016

Just to be clear, is this in initialize (operating on ServiceProviderConfiguration) or getService (operating on ServiceConfiguration)?

I assume you mean the getService case.

The only concern I have with this whether or not we will need a way to handle multiple ServiceProvider instances proving the same service type. If so, we would probably change the rule from "only one provider per type" to "only one non-null response from getService per type". In that situation, there would be 2 meanings of failure from this call.

@ljacomet
Copy link
Member Author

@jd0-sag Indeed, it is getService. For the multi ServiceProvider case, we could rely (not ideal I admit) on a specific exception to mean I handle this type but can't answer this request as opposed to I am supposed to handle this but failed to for non recoverable reasons.

@myronkscott myronkscott self-assigned this Jan 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants