Interface ApplicationConfigurator
-
public interface ApplicationConfiguratorProvides methods to register specific REST Toolkit JAX-RS application components and package scan boundaries.- Since:
- 5.9.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ApplicationConfiguratoraddPackages(boolean recursively, Package... packages)Adds one or more packages which will be used to scan for resource, provider andfeatureclasses.ApplicationConfiguratoraddPackages(boolean recursively, String... packageNames)Adds one or more fully qualified packages name which will be used to scan for resource, provider andfeatureclasses.ApplicationConfiguratoraddPackages(Package... packages)Adds one or more packages which will be used to scan for resource, provider andfeatureclasses.ApplicationConfiguratoraddPackages(String... packageNames)Adds one or more fully qualified packages name which will be used to scan for resource, provider andfeatureclasses.ApplicationConfiguratoraddProperties(Map<String,Object> properties)Adds custom application-wide properties.ApplicationConfiguratorregister(Class<?> aClass)Registers a resource, provider orfeatureclass.ApplicationConfiguratorregister(Object aSingleton)Registers a resource, provider orfeatureinstance.
-
-
-
Method Detail
-
addPackages
ApplicationConfigurator addPackages(Package... packages)
Adds one or more packages which will be used to scan for resource, provider andfeatureclasses.Packages will be scanned recursively.
Calling this method is similar to calling
addPackages(true, Package...).- Parameters:
packages- an array of packages.- Returns:
- the
thisobject. - See Also:
addPackages(boolean, String...)
-
addPackages
ApplicationConfigurator addPackages(boolean recursively, Package... packages)
Adds one or more packages which will be used to scan for resource, provider andfeatureclasses.Note: Only packages accessible from the web application's classloader can be scanned.
- Parameters:
recursively- can be scanned recursively.packages- an array of packages- Returns:
- the
thisobject. - See Also:
addPackages(boolean, String...)
-
addPackages
ApplicationConfigurator addPackages(String... packageNames)
Adds one or more fully qualified packages name which will be used to scan for resource, provider andfeatureclasses.Packages will be scanned recursively.
Calling this method is similar to calling
addPackages(true, String...)- Parameters:
packageNames- an array of fully qualified packages name.- Returns:
- the
thisobject. - See Also:
addPackages(boolean, Package...)
-
addPackages
ApplicationConfigurator addPackages(boolean recursively, String... packageNames)
Adds one or more fully qualified packages name which will be used to scan for resource, provider andfeatureclasses.Note: Only packages accessible from the web application's classloader can be scanned.
- Parameters:
recursively- can be scanned recursively.packageNames- an array of fully qualified packages name.- Returns:
- the
thisobject. - See Also:
addPackages(boolean, Package...)
-
addProperties
ApplicationConfigurator addProperties(Map<String,Object> properties)
Adds custom application-wide properties.If any of the added properties already exists, the values of the existing properties will be replaced with the new values.
- Parameters:
properties- properties map to register- Returns:
- the
thisobject.
-
register
ApplicationConfigurator register(Class<?> aClass)
Registers a resource, provider orfeatureclass.A class will be ignored and a warning log message produced if the requirements of root resources or provider/feature are not met.
Classes registered through this method can be packaged inside or outside the web application archive.
- Parameters:
aClass- The class to register as a JAX-RS application's component.- Returns:
- the
thisobject.
-
register
ApplicationConfigurator register(Object aSingleton)
Registers a resource, provider orfeatureinstance. Its fields and properties declared as dependencies (seeContext) are injected by the runtime prior to use.A singleton will be ignored and a warning log message produced if the requirements of root resources or provider/feature are not met.
The class of objects registered through this method can be packaged inside or outside the web application archive.
- Parameters:
aSingleton- The object to register as a JAX-RS application's singleton.- Returns:
- the
thisobject.
-
-