Package org.kie.api.runtime
Interface KieContainer
public interface KieContainer
A container for all the KieBases of a given KieModule
-
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Disposes all the KieSessions created in this KieContainer.Returns the ClassLoader used by this KieContainerReturns the default KieBase in this KieContainer.getKieBase(String kBaseName) Returns the KieBase with the given name in this KieContainer.getKieBaseModel(String kBaseName) Returns the KieBaseModel for the KieBase with the given nameReturns the names of all the KieBases available in this KieContainerReturns the KieSessionConfiguration of the default KieSession for this KieContainergetKieSessionConfiguration(String kSessionName) Returns the KieSessionConfiguration of the KieSession with the given name for this KieContainergetKieSessionModel(String kSessionName) Returns the KieSessionModel for the KieSession with the given namegetKieSessionNamesInKieBase(String kBaseName) Returns the names of all the KieSessions defined in this KieContainer for the given KieBaseReturns the ReleaseId of the KieModule wrapped by this KieContainernewKieBase(String kBaseName, KieBaseConfiguration conf) Creates a new KieBase with the given name using the given configuration.Creates a new default KieBase using the given configuration.Creates the default KieSession for this KieContainernewKieSession(String kSessionName) Creates the KieSession with the given name for this KieContainernewKieSession(String kSessionName, Environment environment) Creates the KieSession with the given name for this KieContainer using the given EnvironmentnewKieSession(String kSessionName, Environment environment, KieSessionConfiguration conf) Creates the KieSession with the given name for this KieContainer using the given Environment and configurationnewKieSession(String kSessionName, KieSessionConfiguration conf) Creates the KieSession with the given name for this KieContainer with the given configurationnewKieSession(Environment environment) Creates the defaultKieSessionfor this KieContainer using the given EnvironmentnewKieSession(Environment environment, KieSessionConfiguration conf) Creates the default KieSession for this KieContainer with the given configuration and EnvironmentCreates the default KieSession for this KieContainer with the given configurationnewKieSessionsPool(int initialSize) Creates a newKieContainerSessionsPoolstoring the sessions created from this KieContainer.Creates the default StatelessKieSession for this KieContainernewStatelessKieSession(String kSessionName) Creates the StatelessKieSession with the given name for this KieContainernewStatelessKieSession(String kSessionName, KieSessionConfiguration conf) Creates the StatelessKieSession with the given name for this KieContainer using the given configurationCreates the default StatelessKieSession for this KieContainer using the given configurationupdateToVersion(ReleaseId version) Updates this KieContainer to a KieModule with the given fixed ReleaseId (e.g.verify()Builds all the KieBase in the KieModule wrapped by this KieContainer and return te Results of this building processBuilds the KieBases with the given name(s) in the KieModule wrapped by this KieContainer and return the Results of this building process
-
Method Details
-
dispose
void dispose()Disposes all the KieSessions created in this KieContainer. If this KieContainer's containerId was registered with the KieServices, it will free the ID and unregister it from KieServices. If existing, dispose all JMX resources associated with this KieContainer. -
getReleaseId
ReleaseId getReleaseId()Returns the ReleaseId of the KieModule wrapped by this KieContainer -
verify
Results verify()Builds all the KieBase in the KieModule wrapped by this KieContainer and return te Results of this building process -
verify
Builds the KieBases with the given name(s) in the KieModule wrapped by this KieContainer and return the Results of this building process -
updateToVersion
Updates this KieContainer to a KieModule with the given fixed ReleaseId (e.g. com.acme:acme-rules:1.0.0.Final). The new release id should not contain the placeholder versions like LATEST or RELEASE as that will not work as expected. The container will not automatically find and resolve the "latest" version and will keep the old one in place. -
getKieBaseNames
Collection<String> getKieBaseNames()Returns the names of all the KieBases available in this KieContainer -
getKieSessionNamesInKieBase
Returns the names of all the KieSessions defined in this KieContainer for the given KieBase -
getKieBase
KieBase getKieBase()Returns the default KieBase in this KieContainer. The returned KieBase will be managed by this KieContainer and then it will be updated when the KieContainer itself will be updated to a newer version of the KieModule.- Throws:
RuntimeException- if this KieContainer doesn't have any default KieBase- See Also:
-
getKieBase
Returns the KieBase with the given name in this KieContainer. The returned KieBase will be managed by this KieContainer and then it will be updated when the KieContainer itself will be updated to a newer version of the KieModule.- Throws:
RuntimeException- if this KieContainer doesn't have any KieBase with the given name
-
newKieBase
Creates a new default KieBase using the given configuration. The returned KieBase will be detached from this KieContainer and then will NOT be updated when the KieContainer itself will be updated to a newer version of the KieModule.- Throws:
RuntimeException- if this KieContainer doesn't have any default KieBase- See Also:
-
newKieBase
Creates a new KieBase with the given name using the given configuration. The returned KieBase will be detached from this KieContainer and then will NOT be updated when the KieContainer itself will be updated to a newer version of the KieModule.- Throws:
RuntimeException- if this KieContainer doesn't have any KieBase with the given name
-
newKieSessionsPool
Creates a newKieContainerSessionsPoolstoring the sessions created from this KieContainer. Don't forget toKieSessionsPool.shutdown()the pool when you are done.- Parameters:
initialSize- the initial size of sessions in the pool- Returns:
- created
KieContainerSessionsPool
-
newKieSession
KieSession newKieSession()Creates the default KieSession for this KieContainer- Throws:
RuntimeException- if this KieContainer doesn't have any default KieSession- See Also:
-
newKieSession
Creates the default KieSession for this KieContainer with the given configuration- Throws:
RuntimeException- if this KieContainer doesn't have any default KieSession- See Also:
-
newKieSession
Creates the defaultKieSessionfor this KieContainer using the given Environment- Throws:
RuntimeException- if this KieContainer doesn't have any default KieSession- See Also:
-
newKieSession
Creates the default KieSession for this KieContainer with the given configuration and Environment- Throws:
RuntimeException- if this KieContainer doesn't have any default KieSession- See Also:
-
newKieSession
Creates the KieSession with the given name for this KieContainer- Throws:
RuntimeException- if this KieContainer doesn't have any KieSession with the given name
-
newKieSession
Creates the KieSession with the given name for this KieContainer using the given Environment- Throws:
RuntimeException- if this KieContainer doesn't have any KieSession with the given name
-
newKieSession
Creates the KieSession with the given name for this KieContainer with the given configuration- Throws:
RuntimeException- if this KieContainer doesn't have any KieSession with the given name
-
newKieSession
KieSession newKieSession(String kSessionName, Environment environment, KieSessionConfiguration conf) Creates the KieSession with the given name for this KieContainer using the given Environment and configuration- Throws:
RuntimeException- if this KieContainer doesn't have any KieSession with the given name
-
newStatelessKieSession
StatelessKieSession newStatelessKieSession()Creates the default StatelessKieSession for this KieContainer- Throws:
RuntimeException- if this KieContainer doesn't have any default StatelessKieSession- See Also:
-
newStatelessKieSession
Creates the default StatelessKieSession for this KieContainer using the given configuration- Throws:
RuntimeException- if this KieContainer doesn't have any default StatelessKieSession- See Also:
-
newStatelessKieSession
Creates the StatelessKieSession with the given name for this KieContainer- Throws:
RuntimeException- if this KieContainer doesn't have any StatelessKieSession with the given name
-
newStatelessKieSession
Creates the StatelessKieSession with the given name for this KieContainer using the given configuration- Throws:
RuntimeException- if this KieContainer doesn't have any StatelessKieSession with the given name
-
getClassLoader
ClassLoader getClassLoader()Returns the ClassLoader used by this KieContainer -
getKieSessionConfiguration
KieSessionConfiguration getKieSessionConfiguration()Returns the KieSessionConfiguration of the default KieSession for this KieContainer -
getKieSessionConfiguration
Returns the KieSessionConfiguration of the KieSession with the given name for this KieContainer -
getKieBaseModel
Returns the KieBaseModel for the KieBase with the given name -
getKieSessionModel
Returns the KieSessionModel for the KieSession with the given name
-