Interface KieServices
- All Superinterfaces:
Comparable<KieService>,KieService
The KieServices is a thread-safe singleton acting as a hub giving access to the other Services provided by Kie. As general rule a getX() method just returns a reference to another singleton while a newX() one creates a new instance.
It is possible to obtain a KieServices reference via its Factory as it follows
KieServices kieServices = KieServices.Factory.get();
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classA Factory for this KieServices -
Field Summary
Fields inherited from interface org.kie.api.internal.utils.KieService
UNDEFINED -
Method Summary
Modifier and TypeMethodDescriptionstatic KieServicesget()Returns a reference to the KieServices singletonReturns the KieCommands, a factory for CommandsReturns KieContainer for the classpath, this a global singleton.getKieClasspathContainer(ClassLoader classLoader) Returns KieContainer for the classpath using the given classLoader, this a global singleton.getKieClasspathContainer(String containerId) Returns KieContainer for the classpath enforcing the given containerId, this a global singleton.getKieClasspathContainer(String containerId, ClassLoader classLoader) Returns KieContainer for the classpath enforcing the given containerId and using the given classLoader, this a global singleton.Returns KieLoggers, a factory for KieRuntimeLoggerReturns the KieMarshallers serviceReturns the KieRepository, a singleton acting as a repository for all the available KieModulesReturns the KieResources, a factory that provides Resource implementations for the desired IO resourceReturns KieStoreServicesInstantiate and return an EnvironmentCreate a KieBaseConfiguration on which properties can be set.newKieBaseConfiguration(Properties properties) Create a KieBaseConfiguration on which properties can be set.newKieBaseConfiguration(Properties properties, ClassLoader classLoader) Deprecated.The classLoader has to be defined when creating the KieContainer, so the one passed here will be just ignorednewKieBuilder(File rootFolder) Creates a new KieBuilder to build the KieModule contained in the given foldernewKieBuilder(KieFileSystem kieFileSystem) Creates a new KieBuilder to build the KieModule contained in the given KieFileSystemnewKieBuilder(KieFileSystem kieFileSystem, ClassLoader classLoader) Creates a new KieBuilder to build the KieModule contained in the given KieFileSystem and using the given class loaderCreates a new KieContainer for the classpath, regardless if there's already an existing onenewKieClasspathContainer(ClassLoader classLoader) Creates a new KieContainer for the classpath using the given classLoader, regardless if there's already an existing onenewKieClasspathContainer(String containerId) Creates a new KieContainer for the classpath, regardless if there's already an existing one, enforcing the given containerId.newKieClasspathContainer(String containerId, ClassLoader classLoader) Creates a new KieContainer for the classpath using the given classLoader, regardless if there's already an existing one, enforcing the given containerId.default KieContainernewKieClasspathContainer(String containerId, ClassLoader classLoaderContainer, ReleaseId releaseId) Creates a new KieContainer for the classpath using the given classLoader, regardless if there's already an existing one, enforcing the given containerId.newKieContainer(String containerId, ReleaseId releaseId) Creates a new KieContainer wrapping the KieModule with the given ReleaseId and enforcing the given containerId.newKieContainer(String containerId, ReleaseId releaseId, ClassLoader classLoader) Creates a new KieContainer wrapping the KieModule with the given ReleaseId, using the given class loader and enforcing the given containerId.newKieContainer(ReleaseId releaseId) Creates a new KieContainer wrapping the KieModule with the given ReleaseIdnewKieContainer(ReleaseId releaseId, ClassLoader classLoader) Creates a new KieContainer wrapping the KieModule with the given ReleaseId and using the given class loaderCreates a new KieFileSystem used to programmatically define the resources composing a KieModuleCreates a new KieModuleModel to programmatically define a KieModulenewKieScanner(KieContainer kieContainer) Creates a maven based KieScanner to automatically discover if there are new releases of the KieModule (and its dependencies) wrapped by the given KieContainernewKieScanner(KieContainer kieContainer, String repositoryFolder) Creates a file system based KieScanner to automatically discover if there are new releases of the KieModule (and its dependencies) wrapped by the given KieContainerCreate a KieSessionConfiguration on which properties can be set.newKieSessionConfiguration(Properties properties) Create a KieSessionConfiguration on which properties can be set.newKieSessionConfiguration(Properties properties, ClassLoader classLoader) Create a KieSessionConfiguration on which properties can be set.newReleaseId(String groupId, String artifactId, String version) Creates a new ReleaseId with the given groupId, artifactId and versionMethods inherited from interface org.kie.api.internal.utils.KieService
compareTo, servicePriority, serviceTag
-
Method Details
-
getResources
KieResources getResources()Returns the KieResources, a factory that provides Resource implementations for the desired IO resource- Returns:
- resources
-
getRepository
KieRepository getRepository()Returns the KieRepository, a singleton acting as a repository for all the available KieModules- Returns:
- repository
-
getCommands
KieCommands getCommands()Returns the KieCommands, a factory for Commands- Returns:
- commands
-
getMarshallers
KieMarshallers getMarshallers()Returns the KieMarshallers service- Returns:
- marshallers
-
getLoggers
KieLoggers getLoggers()Returns KieLoggers, a factory for KieRuntimeLogger- Returns:
- loggers
-
getStoreServices
KieStoreServices getStoreServices()Returns KieStoreServices- Returns:
- store services
-
getKieClasspathContainer
KieContainer getKieClasspathContainer()Returns KieContainer for the classpath, this a global singleton.- Returns:
- kie classpath container
-
getKieClasspathContainer
Returns KieContainer for the classpath using the given classLoader, this a global singleton.- Parameters:
classLoader- classLoader- Returns:
- kie classpath container
- Throws:
IllegalStateException- if this method get called twice with 2 different ClassLoaders
-
getKieClasspathContainer
Returns KieContainer for the classpath enforcing the given containerId, this a global singleton.If enforcing the containerId is successful, the KieContainer and its containerId are registered within the KieServices. Deregistration can be performed by calling
KieContainer.dispose()on the resulting KieContainer.If you do not want to enforce a specific containerId, use the
getKieClasspathContainer()method instead.- Parameters:
containerId- the containerId to enforce (non-null).- Returns:
- kie classpath container
- Throws:
IllegalStateException- if the containerId is already existing for another container and therefore cannot be enforced.
-
getKieClasspathContainer
Returns KieContainer for the classpath enforcing the given containerId and using the given classLoader, this a global singleton.If enforcing the containerId is successful, the KieContainer and its containerId are registered within the KieServices. Deregistration can be performed by calling
KieContainer.dispose()on the resulting KieContainer.- Parameters:
containerId- the containerId to enforce (non-null).classLoader- classLoader- Returns:
- kie classpath container
- Throws:
IllegalStateException- if this method get called twice with 2 different ClassLoaders, or if the containerId is already existing for another container and therefore cannot be enforced.
-
newKieClasspathContainer
KieContainer newKieClasspathContainer()Creates a new KieContainer for the classpath, regardless if there's already an existing one- Returns:
- new kie classpath container
-
newKieClasspathContainer
Creates a new KieContainer for the classpath using the given classLoader, regardless if there's already an existing one- Parameters:
classLoader- classLoader- Returns:
- new kie classpath container
-
newKieClasspathContainer
Creates a new KieContainer for the classpath, regardless if there's already an existing one, enforcing the given containerId.If enforcing the containerId is successful, the KieContainer and its containerId are registered within the KieServices. Deregistration can be performed by calling
KieContainer.dispose()on the resulting KieContainer.If you do not want to enforce a specific containerId, use the
newKieClasspathContainer()method instead.- Parameters:
containerId- a unique containerId (non-null).- Returns:
- new kie classpath container
- Throws:
IllegalStateException- if the containerId is already existing for another container, and therefore cannot be enforced.
-
newKieClasspathContainer
Creates a new KieContainer for the classpath using the given classLoader, regardless if there's already an existing one, enforcing the given containerId.If enforcing the containerId is successful, the KieContainer and its containerId are registered within the KieServices. Deregistration can be performed by calling
KieContainer.dispose()on the resulting KieContainer.- Parameters:
containerId- a unique containerId (non-null).classLoader- classLoader- Returns:
- new kie classpath container
- Throws:
IllegalStateException- if the containerId is already existing for another container, and therefore cannot be enforced.
-
newKieClasspathContainer
default KieContainer newKieClasspathContainer(String containerId, ClassLoader classLoaderContainer, ReleaseId releaseId) Creates a new KieContainer for the classpath using the given classLoader, regardless if there's already an existing one, enforcing the given containerId.If enforcing the containerId is successful, the KieContainer and its containerId are registered within the KieServices. Deregistration can be performed by calling
KieContainer.dispose()on the resulting KieContainer.- Parameters:
containerId- a unique containerId (non-null).classLoaderContainer- classLoaderreleaseId- release id of this container- Returns:
- new kie classpath container
- Throws:
IllegalStateException- if the containerId is already existing for another container, and therefore cannot be enforced.UnsupportedOperationException- if the operation is not supported by the kie services
-
newKieContainer
Creates a new KieContainer wrapping the KieModule with the given ReleaseId- Parameters:
releaseId- releaseId- Returns:
- new kie container
-
newKieContainer
Creates a new KieContainer wrapping the KieModule with the given ReleaseId and enforcing the given containerId.If enforcing the containerId is successful, the KieContainer and its containerId are registered within the KieServices. Deregistration can be performed by calling
KieContainer.dispose()on the resulting KieContainer.If you do not want to enforce a specific containerId, use the
newKieContainer(ReleaseId)method instead.- Parameters:
containerId- a unique containerId (non-null).releaseId- releaseId- Returns:
- new kie container
- Throws:
IllegalStateException- if the containerId is already existing for another container, and therefore cannot be enforced.
-
newKieContainer
Creates a new KieContainer wrapping the KieModule with the given ReleaseId and using the given class loader- Parameters:
releaseId- releaseIdclassLoader- classLoader- Returns:
- new kie container
-
newKieContainer
Creates a new KieContainer wrapping the KieModule with the given ReleaseId, using the given class loader and enforcing the given containerId.If enforcing the containerId is successful, the KieContainer and its containerId are registered within the KieServices. Deregistration can be performed by calling
KieContainer.dispose()on the resulting KieContainer.- Parameters:
containerId- a unique containerId (non-null).releaseId- releaseIdclassLoader- classLoader- Returns:
- new kie container
- Throws:
IllegalStateException- if the containerId is already existing for another container, and therefore cannot be enforced.
-
newKieScanner
Creates a maven based KieScanner to automatically discover if there are new releases of the KieModule (and its dependencies) wrapped by the given KieContainer- Parameters:
kieContainer- kieContainer- Returns:
- new kie scanner
-
newKieScanner
Creates a file system based KieScanner to automatically discover if there are new releases of the KieModule (and its dependencies) wrapped by the given KieContainer- Parameters:
kieContainer- kieContainerrepositoryFolder- The folder where the new releases will be dropped- Returns:
- new kie scanner
-
newKieBuilder
Creates a new KieBuilder to build the KieModule contained in the given folder- Parameters:
rootFolder- rootFolder- Returns:
- new kie builder
-
newKieBuilder
Creates a new KieBuilder to build the KieModule contained in the given KieFileSystem- Returns:
- new kie builder
-
newKieBuilder
Creates a new KieBuilder to build the KieModule contained in the given KieFileSystem and using the given class loader- Returns:
- new kie builder
-
newReleaseId
Creates a new ReleaseId with the given groupId, artifactId and version- Parameters:
groupId- groupIdartifactId- artifactIdversion- version- Returns:
- new release id
-
newKieFileSystem
KieFileSystem newKieFileSystem()Creates a new KieFileSystem used to programmatically define the resources composing a KieModule- Returns:
- new kie file system
-
newKieModuleModel
KieModuleModel newKieModuleModel()Creates a new KieModuleModel to programmatically define a KieModule- Returns:
- new kie module model
-
newKieBaseConfiguration
KieBaseConfiguration newKieBaseConfiguration()Create a KieBaseConfiguration on which properties can be set.- Returns:
- new kiebase configuration
-
newKieBaseConfiguration
Create a KieBaseConfiguration on which properties can be set. Use the given properties file.- Parameters:
properties- properties- Returns:
- new kiebase configuration
-
newKieBaseConfiguration
Deprecated.The classLoader has to be defined when creating the KieContainer, so the one passed here will be just ignoredCreate a KieBaseConfiguration on which properties can be set. Use the given properties file and ClassLoader - either of which can be null.- Parameters:
properties- propertiesclassLoader- classLoader- Returns:
- new kiebase configuration
-
newKieSessionConfiguration
KieSessionConfiguration newKieSessionConfiguration()Create a KieSessionConfiguration on which properties can be set.- Returns:
- new kiesession configuration
-
newKieSessionConfiguration
Create a KieSessionConfiguration on which properties can be set.- Parameters:
properties- properties- Returns:
- new kiesession configuration
-
newKieSessionConfiguration
Create a KieSessionConfiguration on which properties can be set. Use the given properties file and ClassLoader - either of which can be null.- Parameters:
properties- propertiesclassLoader- classLoader- Returns:
- new kiesession configuration
-
newEnvironment
Environment newEnvironment()Instantiate and return an Environment- Returns:
- The Environment
-
get
Returns a reference to the KieServices singleton
-