public 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.
Modifier and Type | Method and Description |
---|---|
java.util.EnumSet<ApiType> |
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:
|
java.lang.String |
getApplicationName() |
org.osgi.framework.Version |
getApplicationVersion() |
boolean |
getDelegateToSystem() |
java.lang.Iterable<java.lang.String> |
getDynamicImportPackage() |
java.lang.Iterable<java.lang.String> |
getImportPackage() |
java.lang.Iterable<java.lang.String> |
getRequireBundle() |
GatewayConfiguration |
setApiTypeVisibility(ApiType... types)
Sets the allowed API types.
|
GatewayConfiguration |
setApiTypeVisibility(java.lang.Iterable<ApiType> types)
Sets the allowed API types.
|
GatewayConfiguration |
setApplicationName(java.lang.String name) |
GatewayConfiguration |
setApplicationVersion(org.osgi.framework.Version version) |
GatewayConfiguration |
setDelegateToSystem(boolean delegateToSystem) |
GatewayConfiguration |
setDynamicImportPackage(java.util.List<java.lang.String> packageImports) |
GatewayConfiguration |
setDynamicImportPackage(java.lang.String... packageImports) |
GatewayConfiguration |
setImportPackage(java.util.List<java.lang.String> packageImports) |
GatewayConfiguration |
setImportPackage(java.lang.String... packageImports) |
GatewayConfiguration |
setRequireBundle(java.util.List<java.lang.String> bundleRequirements) |
GatewayConfiguration |
setRequireBundle(java.lang.String... bundleRequirements) |
GatewayConfiguration setRequireBundle(java.util.List<java.lang.String> bundleRequirements)
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.GatewayConfiguration setRequireBundle(java.lang.String... bundleRequirements)
setRequireBundle(List)
GatewayConfiguration setImportPackage(java.util.List<java.lang.String> packageImports)
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.GatewayConfiguration setImportPackage(java.lang.String... packageImports)
setImportPackage(List)
GatewayConfiguration setDynamicImportPackage(java.util.List<java.lang.String> packageImports)
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.GatewayConfiguration setDynamicImportPackage(java.lang.String... packageImports)
setDynamicImportPackage(List)
GatewayConfiguration setApplicationName(java.lang.String name)
name
- The name of the application. This should be unique.GatewayConfiguration setApplicationVersion(org.osgi.framework.Version version)
version
- The version of an application.GatewayConfiguration setDelegateToSystem(boolean delegateToSystem)
delegateToSystem
- true if findSystemClass should be called if the bundle is unable to load the class.boolean getDelegateToSystem()
GatewayConfiguration setApiTypeVisibility(ApiType... types)
types
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.types
- The type that of APIs that are allowed to be loaded by the gateway class loaderGatewayConfiguration setApiTypeVisibility(java.lang.Iterable<ApiType> types)
types
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.types
- The type that of APIs that are allowed to be loaded by the gateway class loaderjava.lang.Iterable<java.lang.String> getRequireBundle()
java.lang.Iterable<java.lang.String> getImportPackage()
java.lang.Iterable<java.lang.String> getDynamicImportPackage()
java.util.EnumSet<ApiType> 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 loaderjava.lang.String getApplicationName()
org.osgi.framework.Version getApplicationVersion()