I have some doubts concerning the idea of DOSGi intents
and its implementation. I have being using another DOSGi
implementation (CXF) and, there, the idea of intents is
implemented using the interceptor pattern. In fact, when a
remote service is published locally, a distribution
provider creates a corresponding endpoint. Then, the
intents that are indicated during service publication are
mapped to interceptors which are appended to the endpoint
(in fact, to the corresponding chains of interceptors).
Once this endpoint is created and configured, it can be
exported to an external repository where it can be found
by a client.
In this scenario, a service developer/publisher can
indicate to the SERVER SIDE distribution provider (using
intents) that some special processing is needed in order
to this service become remotely available. Those intents
are interpreted and the corresponding interceptors are
added to the corresponding endpoint's chains. Such an
intent can be, for example, a Log intent which instructs
the distribution provider on the server side to log all
requests that arrive to this service.
When a client is going to use a remote service, the
distribution provider on the CLIENT SIDE creates a proxy
which can also have some interceptors appended to
it. Let´s consider the necessity of cryptography as an
example... Well, when we say that a service should receive
encrypted requests, it will not be able to process a
request which is not encrypted. So, when we create a proxy
to this service on the client side, this proxy should
include an interceptor which is responsible for encrypting
the request before sending it to the server side. The
endpoint on the server side must also have an interceptor
which is responsible for decrypting the request. So, in
this case, an intent set on the SERVER SIDE is motivating
the creation of interceptors on BOTH sides of the
I wonder, however, if the client could establish some
requirement to the distribution provider on its own side.
For example, consider a client that would like to indicate
that its requests should be monitored from the client
perspective (so that, for example, the round-trip time and
marshalling time could be captured and that failures could
be logged). This kind of "intent" makes sense only to this
client, and not to other clients from the same service.
Well, in this case we could plug the monitoring capability
using the proxy to the remote service (through
interceptors). Can we say that this kind of requirement is
an intent that should be indicated by the client? And in
this case, how could we indicate such intent since the
only thing that the client sends to the registry in order
to select a server is a filter?
Well, sorry about this long email and about those
confused ideas. In fact, this is basically a brainstorm.
Thank you, very much for the attention and patience.