I've started to investigate using iPojo interceptors. I'm using iPojo
version 1.11.0. I want to accomplish the following:

Component A can be "extended" by specifying a list of (required)
"extenders" (actually their id's), like this:

  @Property(name = "extenders", mandatory = false)
  private String[] mExtenderIds;

  @Requires(optional = true, id = "extenders")
  private IExtender[] mExtenders;


The property is optional but if any extenderId's are listed then the
@Requires should require that IExtender's with the corresponding extenderId
is started.

The IExtender interface contains the following method:

  public String getExtenderId();

Thus, every extender has an extenderId and if that id is listed in a
components "extender" property then the corresponding service should be
required, otherwise not.

My idea (actually Clement's idea from a previous conversation on this
list). is to use a RankingInterceptor that returns an empty array until all
required services are present.

I think this is doable but in order for my RankingInterceptor to work, it
must have access to the component's "extenders" property. It would then go
through all the services implementing the IExtender interface and if there
are extenders corresponding to the required extenderId's it would return
all of those, otherwise it would return an empty list. Also, if a list of
extenderId's was specified, then the service dependency is set to
mandatory, otherwise to optional.

My problem is how to gain access to the configuration property (the
"extenders" property) of my component from the interceptor. How can I do
this?

Another question I have is how to make sure that the interceptor is active.
If the interceptor is not active then my component could become erroneously
valid. Would it be feasible to have a mandatory dependency on the
interceptor?

/Bengt

Reply via email to