Package org.openl

Class OpenL


  • public class OpenL
    extends Object
    This class describes OpenL engine context abstraction that used during compilation process. The class OpenL implements both factory(static) methods for creating OpenL instances and actual OpenL functionality. Each instance of OpenL should be considered as a Language Configuration(LC). You may have as many LCs in your application as you want. Current OpenL architecture allows to have different OpenL configurations in separate class loaders, so they will not interfere with each other. It allows, for example, to have 2 LCs using different SAX or DOM parser implementation. The actual work is done by class OpenLConfigurator.
    Author:
    snshor
    See Also:
    OpenLConfigurator
    • Constructor Detail

      • OpenL

        public OpenL()
    • Method Detail

      • setConfig

        public static void setConfig​(OpenLConfigurator config)
        Change default OpenLConfigurator implementation to another.
        Parameters:
        config - new OpenLConfigurator
      • getInstance

        public static OpenL getInstance​(String name)
        Gets instance of OpenL with given name.
        Parameters:
        name - OpenL name
        Returns:
        instance of OpenL
        Throws:
        OpenLConfigurationException
      • getInstance

        public static OpenL getInstance​(String name,
                                        IUserContext userContext)
        Gets an instance of OpenL. Each instance is cached with name and user context as it's key. To remove cached instance use #remove method
        Parameters:
        name - IOpenL name, for example org.openl.java12.v101
        userContext - user context
        Returns:
        instance of IOpenL
        Throws:
        OpenLConfigurationException
        See Also:
        #remove, IUserContext
      • getInstance

        public static OpenL getInstance​(String name,
                                        IUserContext userContext,
                                        IOpenLBuilder builder)
        Gets an instance of OpenL. Each instance is cached with name and user context as it's key.
        Parameters:
        name - IOpenL name
        userContext - user context
        builder - IOpenLBuilder instance which used to build new instance of OpenL if that does not exist
        Returns:
        instance of IOpenL
        Throws:
        OpenLConfigurationException
        See Also:
        IUserContext
      • getName

        public String getName()
        Gets name of OpenL instance.
        Returns:
        name string
      • setName

        public void setName​(String name)
        Sets name of OpenL instance.
        Parameters:
        name - name string
      • getParser

        public IOpenParser getParser()
        Gets parser that configured for current OpenL instance.
        Returns:
        IOpenParser instance
      • setParser

        public void setParser​(IOpenParser parser)
        Sets parser to current OpenL instance.
        Parameters:
        parser - IOpenParser instance
      • getVm

        public IOpenVM getVm()
        Gets virtual machine which used during rules execution.
        Returns:
        IOpenVM instance
      • setVm

        public void setVm​(IOpenVM openVM)
        Sets virtual machine.
        Parameters:
        openVM - IOpenVM instance
      • getBinder

        public IOpenBinder getBinder()
        Gets binder that configured for current OpenL instance.
        Returns:
        IOpenBinder instance
      • setBinder

        public void setBinder​(IOpenBinder binder)
        Sets binder to current OpenL instance.
        Parameters:
        binder - IOpenBinder instance