Class DefaultRuleEngineContainerRegistry

    • Constructor Detail

      • DefaultRuleEngineContainerRegistry

        public DefaultRuleEngineContainerRegistry()
    • Method Detail

      • setActiveContainer

        public void setActiveContainer​(org.kie.api.builder.ReleaseId releaseId,
                                       org.kie.api.runtime.KieContainer rulesContainer)
        Adds another active container, identified by release, to a repository. Note: Depending on the flag set via setKeepOnlyOneContainerVersion(boolean) (OOTB this is set via the property ruleengine.containerregistry.keep.only.one.module.version) this call will also remove all other KieContainer instances of the same groupId and artifactId (essentially all previously deployed versions of the same rule module).
        Specified by:
        setActiveContainer in interface RuleEngineContainerRegistry<org.kie.api.builder.ReleaseId,​org.kie.api.runtime.KieContainer>
        Parameters:
        releaseId - knowledge base container module release identifier
        rulesContainer - knowledge base container instance
      • getActiveContainer

        public org.kie.api.runtime.KieContainer getActiveContainer​(org.kie.api.builder.ReleaseId releaseId)
        Description copied from interface: RuleEngineContainerRegistry
        Retrieve knowledge base container reference, identified by release id
        Specified by:
        getActiveContainer in interface RuleEngineContainerRegistry<org.kie.api.builder.ReleaseId,​org.kie.api.runtime.KieContainer>
        Parameters:
        releaseId - knowledge base container module release identifier
        Returns:
        knowledge base container instance
      • lookupForDeployedRelease

        public java.util.Optional<org.kie.api.builder.ReleaseId> lookupForDeployedRelease​(java.lang.String... releaseTokens)
        Description copied from interface: RuleEngineContainerRegistry
        Lookup for a deployed knowledge base container release id by partial release id tokens (e.g. group id and artifact id)
        Specified by:
        lookupForDeployedRelease in interface RuleEngineContainerRegistry<org.kie.api.builder.ReleaseId,​org.kie.api.runtime.KieContainer>
        Parameters:
        releaseTokens - knowledge base container module release identifier
        Returns:
        optional of container release id
      • removeActiveContainer

        public org.kie.api.runtime.KieContainer removeActiveContainer​(org.kie.api.builder.ReleaseId releaseHolder)
        Description copied from interface: RuleEngineContainerRegistry
        Remove knowledge base container identified by release id
        Specified by:
        removeActiveContainer in interface RuleEngineContainerRegistry<org.kie.api.builder.ReleaseId,​org.kie.api.runtime.KieContainer>
        Parameters:
        releaseHolder - knowledge base container module release identifier
        Returns:
        removed knowledge base container instance, null if not found
      • isLockedForReading

        public boolean isLockedForReading()
        Description copied from interface: RuleEngineContainerRegistry
        Check if the registry is locked for reading
        Specified by:
        isLockedForReading in interface RuleEngineContainerRegistry<org.kie.api.builder.ReleaseId,​org.kie.api.runtime.KieContainer>
        Returns:
        true if the registry is in the state locked for reading
      • isLockedForWriting

        public boolean isLockedForWriting()
        Description copied from interface: RuleEngineContainerRegistry
        Check if the registry is locked for writing
        Specified by:
        isLockedForWriting in interface RuleEngineContainerRegistry<org.kie.api.builder.ReleaseId,​org.kie.api.runtime.KieContainer>
        Returns:
        true if the registry is in the state locked for writing
      • setup

        @PostConstruct
        public void setup()
      • setConcurrentMapFactory

        public void setConcurrentMapFactory​(ConcurrentMapFactory concurrentMapFactory)
      • getReadWriteLock

        protected java.util.concurrent.locks.ReadWriteLock getReadWriteLock()
      • getReadLock

        protected java.util.concurrent.locks.Lock getReadLock()
      • getWriteLock

        protected java.util.concurrent.locks.Lock getWriteLock()
      • isKeepOnlyOneContainerVersion

        protected boolean isKeepOnlyOneContainerVersion()
      • setKeepOnlyOneContainerVersion

        public void setKeepOnlyOneContainerVersion​(boolean keepOnlyOneContainerVersion)
      • removeAllPreviousVersions

        protected void removeAllPreviousVersions​(org.kie.api.builder.ReleaseId newReleaseId)
      • isPreviousReleaseId

        protected boolean isPreviousReleaseId​(org.kie.api.builder.ReleaseId newReleaseId,
                                              org.kie.api.builder.ReleaseId oldReleaseId)