Class JAXRSServerFactoryBean

    • Constructor Detail

      • JAXRSServerFactoryBean

        public JAXRSServerFactoryBean()
    • Method Detail

      • setApplication

        public void setApplication​(javax.ws.rs.core.Application app)
        Saves the reference to the JAX-RS Application
        Parameters:
        app -
      • setApplicationInfo

        public void setApplicationInfo​(ApplicationInfo provider)
      • setResourceComparator

        public void setResourceComparator​(ResourceComparator rcomp)
        Resource comparator which may be used to customize the way a root resource or resource method is selected
        Parameters:
        rcomp - comparator
      • setStaticSubresourceResolution

        public void setStaticSubresourceResolution​(boolean enableStatic)
        By default the subresources are resolved dynamically, mainly due to the JAX-RS specification allowing Objects being returned from the subresource locators. Setting this property to true enables the runtime to do the early resolution.
        Parameters:
        enableStatic - enabling the static resolution if set to true
      • init

        public void init()
        Creates the JAX-RS Server instance
      • create

        public Server create()
        Creates the JAX-RS Server instance
        Returns:
        the server
      • getServer

        public Server getServer()
      • applyBusFeatures

        protected void applyBusFeatures​(Bus bus)
      • applyFeatures

        protected void applyFeatures()
      • createInvoker

        protected Invoker createInvoker()
      • setLanguageMappings

        public void setLanguageMappings​(Map<Object,​Object> lMaps)
        Sets the language mappings, example, 'en' is the key and 'en-gb' is the value.
        Parameters:
        lMaps - the language mappings
      • setExtensionMappings

        public void setExtensionMappings​(Map<Object,​Object> extMaps)
        Sets the extension mappings, example, 'xml' is the key and 'text/xml' is the value.
        Parameters:
        extMaps - the extension mappings
      • getResourceClasses

        public List<Class<?>> getResourceClasses()
      • setServiceClass

        public void setServiceClass​(Class<?> clazz)
        This method is used primarily by Spring handler processing the jaxrs:server/@serviceClass attribute. It delegates to setResourceClasses method accepting the array of Class parameters.
        Parameters:
        clazz - the service/resource class
      • setResourceClasses

        public void setResourceClasses​(List<Class<?>> classes)
        Sets one or more root resource classes
        Parameters:
        classes - the list of resource classes
      • setResourceClasses

        public void setResourceClasses​(Class<?>... classes)
        Sets one or more root resource classes
        Parameters:
        classes - the array of resource classes
      • setServiceBeanObjects

        public void setServiceBeanObjects​(Object... beans)
        Sets the resource beans. If this is set then the JAX-RS runtime will not be responsible for the life-cycle of resource classes.
        Parameters:
        beans - the array of resource instances
      • setServiceBean

        public void setServiceBean​(Object bean)
        Sets the single resource bean. If this is set then the JAX-RS runtime will not be responsible for the life-cycle of resource classes. Please avoid setting the resource class of this bean explicitly, the runtime will determine it itself.
        Parameters:
        bean - resource instance
      • setServiceBeans

        public void setServiceBeans​(List<Object> beans)
        Sets the resource beans. If this is set then the JAX-RS runtime will not be responsible for the life-cycle of resource classes.
        Parameters:
        beans - the list of resource instances
      • setResourceProvider

        public void setResourceProvider​(Class<?> c,
                                        ResourceProvider rp)
        Sets the provider managing the life-cycle of the given resource class
         Example:
          setResourceProvider(BookStoreInterface.class, new SingletonResourceProvider(new BookStore()));
         
        Parameters:
        c - resource class
        rp - resource provider
      • setResourceProvider

        public void setResourceProvider​(ResourceProvider rp)
        Sets the provider managing the life-cycle of the resource class
         Example:
          setResourceProvider(new SingletonResourceProvider(new BookStore()));
         
        Parameters:
        rp - resource provider
      • setResourceProviders

        public void setResourceProviders​(List<ResourceProvider> rps)
        Sets the list of providers managing the life-cycle of the resource classes
        Parameters:
        rps - resource providers
      • setInvoker

        public void setInvoker​(Invoker invoker)
        Sets the custom Invoker which can be used to customize the way the default JAX-RS invoker calls on the service bean
        Parameters:
        invoker -
      • setStart

        public void setStart​(boolean start)
        Determines whether Services are automatically started during the create() call. Default is true. If false will need to call start() method on Server to activate it.
        Parameters:
        start - Whether (true) or not (false) to start the Server during Server creation.
      • updateClassResourceProviders

        protected void updateClassResourceProviders​(Endpoint ep)
      • setDefaultResourceProvider

        protected void setDefaultResourceProvider​(ClassResourceInfo cri)
      • setDocLocation

        public void setDocLocation​(String docLocation)
        Set the reference to the document (WADL, etc) describing the endpoint
        Parameters:
        docLocation - document location
      • getDocLocation

        public String getDocLocation()
        Get the reference to the document (WADL, etc) describing the endpoint
        Returns:
        document location