Interface GatewayConfiguration
This interface allows for configuration of the gateway for an application. The caller constructs an instance and calls the setters, these are then used by the ClassLoadingService to construct a gateway class loader instance for the application.
It is possible to configure GatewayClassLoaders to use the APIResolverHook
to filter the packages that are available to be
loaded. This resolver hook will only be enabled if a call to setApiTypeVisibility(ApiType...)
or setApiTypeVisibility(Iterable)
has been made, if no call is
made then the gateway class loader will not be configured to filter any of the packages based on their API type and all packages will be available.
-
Method Summary
Modifier and TypeMethodDescriptionReturns a set of the API types that are allowed to be seen by a gateway class loader created from this configuration, the options for the set are:org.osgi.framework.Version
boolean
setApiTypeVisibility
(ApiType... types) Sets the allowed API types.setApiTypeVisibility
(Iterable<ApiType> types) Sets the allowed API types.setApplicationName
(String name) setApplicationVersion
(org.osgi.framework.Version version) setDelegateToSystem
(boolean delegateToSystem) setDynamicImportPackage
(String... packageImports) setDynamicImportPackage
(List<String> packageImports) setImportPackage
(String... packageImports) setImportPackage
(List<String> packageImports) setRequireBundle
(String... bundleRequirements) setRequireBundle
(List<String> bundleRequirements)
-
Method Details
-
setRequireBundle
- Parameters:
bundleRequirements
- a list of bundle requirements. A bundle requirement contains a bundle symbolic name, followed by a set of attributes and directives which are separated by semicolons.
-
setRequireBundle
- See Also:
-
setImportPackage
- Parameters:
packageImports
- a list of package import requirements. A package requirements contains a package name, followed by a set of attributes and directives which are separated by semi-colons.
-
setImportPackage
- See Also:
-
setDynamicImportPackage
- Parameters:
packageImports
- a list of dynamic package import requirements. A package requirements contains a package name, followed by a set of attributes and directives which are separated by semi-colons. A dynamic package import is wired on demand, rather than up front.
-
setDynamicImportPackage
- See Also:
-
setApplicationName
- Parameters:
name
- The name of the application. This should be unique.
-
setApplicationVersion
- Parameters:
version
- The version of an application.
-
setDelegateToSystem
- Parameters:
delegateToSystem
- true if findSystemClass should be called if the bundle is unable to load the class.
-
getDelegateToSystem
boolean getDelegateToSystem() -
setApiTypeVisibility
Sets the allowed API types. Even if notypes
are supplied this will enable the filtering of packages for gateway class loaders constructed from this configuration. Once it is set it cannot be unset.- Parameters:
types
- The type that of APIs that are allowed to be loaded by the gateway class loader- Returns:
- The GatewayConfiguration with this property set
-
setApiTypeVisibility
Sets the allowed API types. Even if notypes
are supplied this will enable the filtering of packages for gateway class loaders constructed from this configuration. Once it is set it cannot be unset.- Parameters:
types
- The type that of APIs that are allowed to be loaded by the gateway class loader- Returns:
- The GatewayConfiguration with this property set
-
getRequireBundle
-
getImportPackage
-
getDynamicImportPackage
-
getApiTypeVisibility
Returns a set of the API types that are allowed to be seen by a gateway class loader created from this configuration, the options for the set are:
null
: Do not restrict the packages visible to the class loader- Empty: Restrict the packages available to just "internal" packages
- Non Empty Set: Restrict the packages available to just the types supplied and "internal" packages
- Returns:
- The set of allowed API types
-
getApplicationName
String getApplicationName() -
getApplicationVersion
org.osgi.framework.Version getApplicationVersion()
-