Class OsgiAbstractJobProducerEndpoint<A>

java.lang.Object
org.opencastproject.rest.AbstractJobProducerEndpoint
org.opencastproject.rest.OsgiAbstractJobProducerEndpoint<A>

public abstract class OsgiAbstractJobProducerEndpoint<A> extends AbstractJobProducerEndpoint
Refined implementation of AbstractJobProducerEndpoint suitable for use in an OSGi environment.

OSGi dependency injection methods are provided to reduce the amount of boilerplate code needed per service implementation.

Declare as type variable the job producing service on which the endpoint depends.

Example: The endpoint for the WorkflowService can be declared like this:

   public final class WorkflowServiceEndpoint extends OsgiAbstractJobProducerEndpoint<WorkflowServiceImpl>
 

Implementation note: Type variable A cannot have upper bound JobProducer. Even though this may seem reasonable it will cause trouble with OSGi dependency injection. The dependency will most likely be declared on the service's interface and not the concrete implementation. But only the concrete implementation is a JobProducer. With A having an upper bound of JobProducer the signature of setService(Object) will be fixed to that bound: setService(JobProducer). Now the service cannot be injected anymore.