Class RestPublisher

java.lang.Object
org.opencastproject.kernel.rest.RestPublisher
All Implemented Interfaces:
RestConstants

public class RestPublisher extends Object implements RestConstants
Listens for JAX-RS annotated services and publishes them to the global URL space using a single shared HttpContext.
  • Field Details

    • logger

      protected static final org.slf4j.Logger logger
      The logger
    • JAX_RS_SERVICE_FILTER

      public static final String JAX_RS_SERVICE_FILTER
      The rest publisher looks for any non-servlet with the 'opencast.service.path' property
      See Also:
    • NAMESPACE_MAP

      protected static final ConcurrentHashMap<String,String> NAMESPACE_MAP
      A map that sets default xml namespaces in XMLStreamWriters
    • providers

      protected List<Object> providers
    • componentContext

      protected org.osgi.service.component.ComponentContext componentContext
      The rest publisher's OSGI declarative services component context
    • jaxRsTracker

      protected org.osgi.util.tracker.ServiceTracker<Object,Object> jaxRsTracker
      A service tracker that monitors JAX-RS annotated services, (un)publishing servlets as they (dis)appear
    • bundleTracker

      protected org.osgi.util.tracker.BundleTracker<Object> bundleTracker
      A bundle tracker that registers StaticResource servlets for bundles with the right headers.
    • baseServerUri

      protected String baseServerUri
      The base URL for this server
    • servletRegistrationMap

      protected Map<String,org.osgi.framework.ServiceRegistration<?>> servletRegistrationMap
      Holds references to servlets that this class publishes, so they can be unpublished later
  • Constructor Details

    • RestPublisher

      public RestPublisher()
  • Method Details

    • activate

      protected void activate(org.osgi.service.component.ComponentContext componentContext)
      Activates this rest publisher
    • deactivate

      protected void deactivate()
      Deactivates the rest publisher
    • bindHttpService

      public void bindHttpService(org.osgi.service.http.HttpService httpService)
    • unbindHttpService

      public void unbindHttpService(org.osgi.service.http.HttpService httpService)
    • createEndpoint

      protected void createEndpoint(org.osgi.framework.ServiceReference<?> ref, Object service)
      Creates a REST endpoint for the JAX-RS annotated service.
      Parameters:
      ref - the osgi service reference
      service - The service itself
    • destroyEndpoint

      protected void destroyEndpoint(String alias, Object service)
      Removes an endpoint
      Parameters:
      alias - The URL space to reclaim
      service - The service reference