I was looking at how much code is involved in referencing an OSGi
service from a script built using the scripting.java bundle and think
it's a bit verbose:

SlingBindings bindings = (SlingBindings)
request.getAttribute(SlingBindings.class.getName());
SlingScriptHelper sling = bindings.getSling();
Interface service = sling.getService(Interface.class);

I was thinking about adding some kind of annotation-based injection
support so that you could replace these lines with just:


@Inject
private Interface service;

public void service(request, response) {
  // some code using service

}

@Inject seems like the obvious candidate to support for this. WDYT?

Justin

Reply via email to