Class OsgiAbstractJobProducerEndpoint<A>
- Direct Known Subclasses:
NopServiceEndpoint
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.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the job producer that is backing this REST endpoint.Return the service registry.getSvc()voidsetService(A service) voidsetServiceRegistry(ServiceRegistry serviceRegistry) Methods inherited from class org.opencastproject.rest.AbstractJobProducerEndpoint
checkHeartbeat, dispatchJob
-
Constructor Details
-
OsgiAbstractJobProducerEndpoint
public OsgiAbstractJobProducerEndpoint()
-
-
Method Details
-
getService
Description copied from class:AbstractJobProducerEndpointReturns the job producer that is backing this REST endpoint.- Specified by:
getServicein classAbstractJobProducerEndpoint- Returns:
- the job producer
-
setService
-
getSvc
-
getServiceRegistry
Description copied from class:AbstractJobProducerEndpointReturn the service registry.- Specified by:
getServiceRegistryin classAbstractJobProducerEndpoint
-
setServiceRegistry
-