Package sc.layer

Class LayeredSystem

  • All Implemented Interfaces:
    IDynamicSystem, INameContext, IRDynamicSystem, LayerConstants, IClassResolver

    public class LayeredSystem
    extends java.lang.Object
    implements LayerConstants, INameContext, IRDynamicSystem, IClassResolver
    The layered system manages the collection of layers or modules in an application. The layers can be in one of two states: inactive, for reading and editing project files or active, for compiling and running the system. Each layer contains a slice of application code - a single tree organized in a hierarchical name space of definitions. Definitions create classes, objects, or modify classes or objects. These layers are merged together to create the current application's program state.

    The program state can be processed to produce Java code, then compiled to produce .class files. This class has a main method which implements command line functionality to process and compile Java files.

    The last layer in the layer stack is considered the primary 'build layer', which is used to store the compiled result. You can also specify additional layers to include in the application ahead of the primary layer. All of the layers extended by these layers are expanded, duplicates are removed and the list is sorted into dependency order producing the list of layers that define the application's initial state. Typically the last layer is the last one you specify on the command line, unless you specify an additional layer which depends on that layer (in this case, specifying the last layer is redundant anyway since it's picked up automatically when you include a layer which extends it).

    The layered system is used at build time to generate the class path for the compiler, find source files to be compiled, and manage the compilation process. Tools also use the layered system to read and manage program elements, and (eventually) interpret layers. Generated applications typically do not depend on the layered system unless they need to interpret code, use the command line interpreter, or other tools to edit the program.

    The layered system has a main for processing and compiling applications. The processing phase generates Java code as needed for any language extensions encountered and places these files into the build directory. At any given time, the layered system is modifying files in a single build directory. By default, this is the directory named build in the top-level layer's directory. This goes counter to standard Java convention which is to have src and build directories at the same level. In this approach, a layer is completely self-contained in a single directory reducing the need for Jar files in making it easy to compartmentalize components. For large java projects, you can also build layers with traditional Java project file organizations. The framework lets you copy, override, and replace files and generates a corresponding traditional Java project. It's straightforward to import an existing project, and split it apart into more reusable layers which can then be reassembled into broader configurations.

    If a Java file does not use any language extensions it can optionally be copied to the build directory along with the generated code so that you have one complete source directory with all source, or it can be compiled directly from where it lives in the source tree. After generating any Java files, any modified files are then compiled using a standard java compiler.

    See the usage() method for details on options. Note that the LayeredSystem is also used in two other contexts - in the dynamic runtime and when using a program editor such as an IDE or dynamic application editing system.

    When you run an application which uses the dynamic runtime, the LayeredSystem serves the same purposes. It compiles the compiled layers, and then manages the interpretation of the dynamic layers. Dynamic layers are stored at the end of the 'layers' list, always after the compiled layers.

    For an IDE, typically the LayeredSystem is constructed by the IDE to form a StrataCode project. The LayeredSystem provides the ability to manage a set of inactiveLayers, which it lazily populates as layers are required to satisfy editing operations. It maintains a type index for all of the layers in the layer path so it can still do global structured editing operations without having to parse all of the source to satisfy "find usages" type queries or walk backwards in the type inheritance tree.

    LayeredSystems can optionally have "peer LayeredSystems" which represent the set of layers for a separate process, possibly in a separate runtime. This is helpful both when using an IDE because we have models of all of the processes and can combine them or separate them as needed. It's helpful in the code-generation phase because we have knowledge of the overlapping parts of the model, and can access the meta-data from both versions when compiling the code - e.g. the initSyncProperties feature.

    TODO: this is a large class with potential for improved organization BuildConfig - stored as 'config' in both LayeredSystem and Layers. So change system.registerFilePatternProcessor to config.register... same for addPostBuildCommand etc. TypeIndex (buildReverseTypeIndex and maybe more code related to this feature), BuildState (preInitModels, initModels, etc), TypeCache (typesByName, innerTypeCache, subTypesByType, ...), RuntimeState (instancesByType, objectNameIndex, ) PackageIndex (packageIndex)

    Unfortunately it's probably never going to be small... there's a lot of code to customize and manage at the system level. Once you understand the keywords to search for, you can find the chunks of code dealing with that feature as it's somewhat modularized by location in the file. So far, it's been ok to maintain this way except when IntelliJ gets slow during editing.

    If we required scc to build, we could separate aspects of the LayeredSystem into layers (e.g. sync, data binding, schtml support, inactive, active) and use StrataCode to build itself into different versions that support the same or subsets of the current public API. We could build up functionality via sub-classes like CoreSystem (for all of the basic info and apis used in the layer definition file), LayeredSystem for the rest.

    • Field Detail

      • scSourcePath

        public static java.lang.String scSourcePath
        When you are running with the source to StrataCode, instead of just with sc.jar point this to the source root - i.e. the dir which holds coreRuntime, fullRuntime, and sc
      • defaultLayeredSystem

        public static LayeredSystem defaultLayeredSystem
      • disableDefaultLayeredSystem

        public static boolean disableDefaultLayeredSystem
      • contextLoaderSystemName

        public static java.lang.String contextLoaderSystemName
        If there's a specific layered system which should set the context class loader, set this property to it's process identity (see getProcessIdent())
      • layers

        public java.util.List<Layer> layers
        Stores the set of layers in the current application for build or run
      • inactiveLayers

        public java.util.ArrayList<Layer> inactiveLayers
      • peerSystems

        public java.util.ArrayList<LayeredSystem> peerSystems
        The list of other LayeredSystems that are part of the same application. They are for managing code in a separate process that's part of the same application, possibly in another runtime like Javascript.
      • mainSystem

        public LayeredSystem mainSystem
        For any group of LayeredSystems, there's always a 'main' one which kicks things off. It first loads all of the layers, then creates the peerSystems required.
      • peerMode

        public boolean peerMode
        Set to true when this system is in a peer
      • specifiedLayers

        public java.util.List<Layer> specifiedLayers
        The list of layers originally specified by the user.
      • buildLayer

        public Layer buildLayer
      • currentBuildLayer

        public Layer currentBuildLayer
      • lastCompiledLayer

        public Layer lastCompiledLayer
      • lastLayer

        public Layer lastLayer
      • layerIndex

        public java.util.Map<java.lang.String,​Layer> layerIndex
      • layerFileIndex

        public java.util.Map<java.lang.String,​Layer> layerFileIndex
      • layerPathIndex

        public java.util.Map<java.lang.String,​Layer> layerPathIndex
      • layerPath

        public java.lang.String layerPath
      • layerPathDirs

        public java.util.List<> layerPathDirs
      • rootClassPath

        public java.lang.String rootClassPath
      • classPath

        public java.lang.String classPath
      • userClassPath

        public java.lang.String userClassPath
      • processedFileIndex

        public java.util.Map<java.lang.String,​IFileProcessorResult> processedFileIndex
        Works in parallel to modelIndex for the files which are not parsed, so we know when they were last modified to do incremental refreshes of them.
      • modelsToPostBuild

        public java.util.LinkedHashMap<java.lang.String,​sc.layer.LayeredSystem.ModelToPostBuild> modelsToPostBuild
      • layerDynStartPos

        public int layerDynStartPos
      • anyErrors

        public boolean anyErrors
        Have any errors occurred in this system since it's been running?
      • runtimeLibsDir

        public java.lang.String runtimeLibsDir
      • runtimeSrcDir

        public java.lang.String runtimeSrcDir
      • strataCodeLibsDir

        public java.lang.String strataCodeLibsDir
      • systemCompiled

        public boolean systemCompiled
      • buildingSystem

        public boolean buildingSystem
      • needsRefresh

        public boolean needsRefresh
      • initializingLayers

        public boolean initializingLayers
      • runClassStarted

        public boolean runClassStarted
      • allTypesProcessed

        public boolean allTypesProcessed
      • useRuntimeReflection

        public boolean useRuntimeReflection
      • usePropertyMappers

        public boolean usePropertyMappers
      • useIndexSetForArrays

        public boolean useIndexSetForArrays
      • includeSrcInClassPath

        public boolean includeSrcInClassPath
      • needsDynamicRuntime

        public boolean needsDynamicRuntime
      • processDefinition

        public IProcessDefinition processDefinition
        Each LayeredSystem stores the layers for one process. This holds the configuration info for that process.
      • activeDataSources

        public java.util.List<DBDataSource> activeDataSources
      • inactiveDataSources

        public java.util.List<DBDataSource> inactiveDataSources
      • defaultDataSource

        public DBDataSource defaultDataSource
        Set this to support @DBTypeSettings with no dataSourceName, to more easily aggregate components into one default db without having to set all of the types individually
      • defaultDBProvider

        public sc.lang.sql.DBProvider defaultDBProvider
      • inactiveDBProviders

        public java.util.Map<java.lang.String,​sc.lang.sql.DBProvider> inactiveDBProviders
      • activeDBProviders

        public java.util.Map<java.lang.String,​sc.lang.sql.DBProvider> activeDBProviders
      • serverName

        public java.lang.String serverName
      • serverPort

        public int serverPort
        The hostname for accessing this system
      • serverEnabled

        public boolean serverEnabled
        The port for accessing this system
      • disabledRuntimes

        public java.util.ArrayList<java.lang.String> disabledRuntimes
        A user configurable list of runtime names which are ignored
      • disabledLayers

        public java.util.ArrayList<Layer> disabledLayers
      • runtimePrefix

        public java.lang.String runtimePrefix
      • systemInstalled

        public boolean systemInstalled
        Set to true when we've detected that the layers have been installed properly.
      • typesAreObjects

        public boolean typesAreObjects
        TODO - remove this
      • enableRemoteMethods

        public boolean enableRemoteMethods
        When processing more than one runtime, should the remote runtime be able to resolve methods against this system? Typically true for servers, false for browsers.
      • syncEnabled

        public boolean syncEnabled
        Is synchronization enabled for this runtime?
      • fileProcessors

        public java.util.HashMap<java.lang.String,​IFileProcessor[]> fileProcessors
      • filePatterns

        public java.util.LinkedHashMap<java.util.regex.Pattern,​IFileProcessor> filePatterns
      • typeGroupDeps

        public java.util.List<sc.layer.TypeGroupDep> typeGroupDeps
      • lastRefreshTime

        public long lastRefreshTime
      • lastChangedModelTime

        public long lastChangedModelTime
      • sysStartTime

        public long sysStartTime
      • modelsHaveChanged

        public boolean modelsHaveChanged
      • inactiveRuntime

        public boolean inactiveRuntime
        Set to true for cases where we create a runtime purely for representing inactive types - e.g. the documentation. In that case, no active layers are populated
      • messageHandler

        public IMessageHandler messageHandler
        Register an optional error handler for all system errors
      • vmParameters

        public java.util.List<VMParameter> vmParameters
      • postBuildProcessing

        public boolean postBuildProcessing
        Flag set when doing the postBuild process - for those cases where you might need different behavior when generating a static file versus one when the server loads
      • layerResolveContext

        public boolean layerResolveContext
        When restoring serialized layered components, we need to lookup a thread-local layered system and be able to know we are doing layerResolves - to swap the name space to that of the layer.
      • dbTypeDescriptors

        public java.util.Map<java.lang.String,​BaseTypeDescriptor> dbTypeDescriptors
        When building, stores the current mapping of type-name to DBTypeDescriptor, so that we can assemble the reference graph as it's being built for source and compiled classes
      • allLayerIndex

        public java.util.LinkedHashMap<java.lang.String,​LayerIndexInfo> allLayerIndex
      • newLayers

        public java.util.List<Layer> newLayers
      • buildDir

        public java.lang.String buildDir
        The current buildDir - i.e. the build dir for the last layer in the list
      • commonBuildDir

        public java.lang.String commonBuildDir
        The build dir is set to the last compiled layer in the list and not changed as new layers are added
      • commonBuildLayer

        public Layer commonBuildLayer
      • buildSrcDir

        public java.lang.String buildSrcDir
      • buildDirFile

        public buildDirFile
      • buildSrcDirFile

        public buildSrcDirFile
      • buildClassesDir

        public java.lang.String buildClassesDir
        Set to the directory where classes are stored
      • coreBuildLayer

        public Layer coreBuildLayer
        Used to hold dyn stubs we need to build to process and create the layers - i.e. before the build layer is defined
      • newLayerDir

        public java.lang.String newLayerDir
      • strataCodeMainDir

        public java.lang.String strataCodeMainDir
      • strataCodeConfPath

        public java.util.List<java.lang.String> strataCodeConfPath
      • strataCodeInstallDir

        public java.lang.String strataCodeInstallDir
      • layersFilePathPrefix

        public java.lang.String layersFilePathPrefix
        Set to "layers" or "../layers" when we are running in the StrataCode main/bin directories. In this case we look for and by default install the layers folder next to the bin directory
      • lastBuiltLayer

        public Layer lastBuiltLayer
      • lastStartedLayer

        public Layer lastStartedLayer
      • lastModelsStartedLayer

        public Layer lastModelsStartedLayer
      • lastInitedInactiveLayer

        public Layer lastInitedInactiveLayer
      • defaultAnnotationProcessors

        public java.util.HashMap<java.lang.String,​IAnnotationProcessor> defaultAnnotationProcessors
      • instancesByType

        public java.util.HashMap<java.lang.String,​WeakIdentityHashMap<java.lang.Object,​java.lang.Boolean>> instancesByType
        Keeps track of all of the active instances for dynamic types (when enabled)
      • innerToOuterIndex

        public WeakIdentityHashMap<java.lang.Object,​java.lang.Object> innerToOuterIndex
      • objectNameIndex

        public WeakIdentityHashMap<java.lang.Object,​java.lang.String> objectNameIndex
      • subTypesByType

        public java.util.HashMap<java.lang.String,​java.util.HashMap<java.lang.String,​java.lang.Boolean>> subTypesByType
        Stores the type-name to sub-type map for the active types - used for runtime update etc. Also see subTypeIndex - for IDE-level indexing that spans active and inactive types.
      • staleCompiledModel

        public boolean staleCompiledModel
        At least one change has been made to the compiled types since the system was recompiled - essentially means you need to restart to pick up those changes
      • staleCompiledInfo

        public java.util.ArrayList<java.lang.String[]> staleCompiledInfo
      • buildInterrupted

        public boolean buildInterrupted
        Set to true when the build itself was interrupted. In this case, we may lose track of src files in the build and should do a clean build to ensure everything gets picked up.
      • excludedFiles

        public java.util.List<java.lang.String> excludedFiles
        Set of patterns to ignore any layer src or class directory, using Java's regex language
      • excludedPaths

        public java.util.List<java.lang.String> excludedPaths
        Normalized paths relative to the layer directory that are excluded from processing
      • staleClassLoader

        public boolean staleClassLoader
        Set to true when we've removed layers. Currently do not update the class loaders so once we remove a layer, we might not get the class we expect since the old layer's buildDir is in the way
      • globalDynLock

        public static java.util.concurrent.locks.ReentrantReadWriteLock globalDynLock
        This is the lock we use to access the layered system. It's static now because otherwise we'd need to synchronize the cross-talk between LayeredSystem classes when dealing with more than one runtime.
      • allOrNoneFinalPackages

        public java.util.TreeSet<java.lang.String> allOrNoneFinalPackages
      • overrideFinalPackages

        public java.util.TreeSet<java.lang.String> overrideFinalPackages
      • systemLayerModelPackages

        public static java.util.HashSet<java.lang.String> systemLayerModelPackages
        These are packages which do not check for source definitions during the resolution of a layer definition file
      • syncInited

        public boolean syncInited

        public static final ProcessDefinition INVALID_PROCESS_SENTINEL

        public static final TypeDeclaration INVALID_TYPE_DECLARATION_SENTINEL
      • nestLevel

        public static int nestLevel
      • readLocked

        public static volatile int readLocked
      • writeLocked

        public static volatile int writeLocked
      • debugLockStack

        public static volatile java.lang.String debugLockStack
      • currentLockThreadName

        public static volatile java.lang.String currentLockThreadName
      • lockAcquireTime

        public static volatile long lockAcquireTime
    • Constructor Detail

      • LayeredSystem

        public LayeredSystem​(java.util.List<java.lang.String> initLayerNames,
                             java.util.List<java.lang.String> explicitDynLayers,
                             java.lang.String layerPathNames,
                             Options options,
                             IProcessDefinition useProcessDefinition,
                             LayeredSystem parentSystem,
                             boolean startInterpreter,
                             IExternalModelIndex extModelIndex,
                             SystemContext sysContext)
    • Method Detail

      • addDBTypeDescriptor

        public void addDBTypeDescriptor​(java.lang.String typeName,
                                        BaseTypeDescriptor dtd)
      • getDBTypeDescriptor

        public DBTypeDescriptor getDBTypeDescriptor​(java.lang.String typeName)
      • getBaseTypeDescriptor

        public BaseTypeDescriptor getBaseTypeDescriptor​(java.lang.String typeName)
      • getDBTypeDescriptorFromTableName

        public DBTypeDescriptor getDBTypeDescriptorFromTableName​(java.lang.String tableName)
      • buildReverseTypeIndex

        public void buildReverseTypeIndex​(boolean clear)
      • refreshReverseTypeIndex

        public void refreshReverseTypeIndex()
      • getAllNames

        public java.util.Set<java.lang.String> getAllNames()
      • setMessageHandler

        public void setMessageHandler​(IMessageHandler handler)
      • isErrorViewed

        public boolean isErrorViewed​(java.lang.String error,
                                     SrcEntry srcEnt,
                                     ISemanticNode node)
      • isWarningViewed

        public boolean isWarningViewed​(java.lang.String warning,
                                       SrcEntry srcEnt,
                                       ISemanticNode node)
      • clearActiveLayers

        public void clearActiveLayers​(boolean clearPeers)
      • activateLayers

        public void activateLayers​(java.util.List<java.lang.String> allLayerNames,
                                   java.util.List<java.lang.String> dynLayers)
        Provides the complete list of layer names and a separate list of 'recursive dyn layers' - i.e. the subset of allLayerNames that should be explicitly made dynamic.
      • getTransformedModelForType

        public JavaModel getTransformedModelForType​(java.lang.String typeName,
                                                    IRuntimeProcessor proc)
      • getInheritedDefinitionProcessors

        public java.util.ArrayList<IDefinitionProcessor> getInheritedDefinitionProcessors​(BodyTypeDeclaration type)
        Performance Note: this is inside of a pretty tight inner loop - find all annotation processors that affect every type in a type hierarchy so we are careful not to allocate too much memory.
      • setAnnotationMergeMode

        public static void setAnnotationMergeMode​(java.lang.String annotationTypeName,
                                                  java.lang.String attributeValue,
                                                  AnnotationMergeMode mode)
      • getAnnotationMergeMode

        public static AnnotationMergeMode getAnnotationMergeMode​(java.lang.String annotationTypeName,
                                                                 java.lang.String attributeValue)
      • getTypeIndexDir

        public java.lang.String getTypeIndexDir()
      • getTypeIndexBaseDir

        public java.lang.String getTypeIndexBaseDir()
      • getTypeIndexDir

        public java.lang.String getTypeIndexDir​(java.lang.String typeIndexIdent)
      • getProcessIdent

        public java.lang.String getProcessIdent()
      • getTypeIndexIdent

        public java.lang.String getTypeIndexIdent()
        LayeredSystems have the ability to potentially share a type index but for now we are using the per-process id.
      • addAllTypeDeclarations

        public void addAllTypeDeclarations​(java.lang.String typeName,
                                           java.util.ArrayList<java.lang.Object> res,
                                           boolean openAllLayers,
                                           boolean openTypes)
        For the IDE specifically. when open types is true, returns TypeDeclaration or TypeIndexEntry instances. When openTypes is false, rather than reading the file, it will return the SrcEntry if the file is not already in the cache.
      • disableLayer

        public void disableLayer​(Layer layer)
        Moves the layer into the list of disabled layers.
      • updateTypeNames

        public void updateTypeNames​(java.lang.String packageName,
                                    java.util.Map<java.lang.String,​TypeDeclaration> oldDefinedTypes,
                                    java.util.Map<java.lang.String,​TypeDeclaration> newDefinedTypes)
      • updateTypeName

        public void updateTypeName​(java.lang.String oldFullName,
                                   java.lang.String newFullName,
                                   boolean active,
                                   boolean updatePeers)
      • removeTypeName

        public void removeTypeName​(java.lang.String oldFullName,
                                   boolean active,
                                   boolean updatePeers)
      • fileRenamed

        public void fileRenamed​(SrcEntry oldSrcEnt,
                                SrcEntry newSrcEnt,
                                boolean updatePeers)
      • getAssignmentsToProperty

        public java.util.ArrayList<> getAssignmentsToProperty​(VariableDefinition varDef,
                                                                                           Layer refLayer,
                                                                                           boolean openLayers,
                                                                                           boolean checkPeers)
      • addTagPackageDirectory

        public void addTagPackageDirectory​(java.lang.String name,
                                           Layer definedInLayer,
                                           int priority)
      • getStrataCodeDir

        public java.lang.String getStrataCodeDir​(java.lang.String dirName)
        The current project directory
      • getStrataCodeHomeDir

        public java.lang.String getStrataCodeHomeDir​(java.lang.String dirName)
        Used for storing information shared between projects
      • getStrataCodeConfDir

        public java.lang.String getStrataCodeConfDir​(java.lang.String fileName)
      • getNeedsSync

        public boolean getNeedsSync()
      • hasSyncPeerTypeDeclaration

        public boolean hasSyncPeerTypeDeclaration​(BodyTypeDeclaration type)
      • installSystem

        public boolean installSystem()
      • performExitCleanup

        public void performExitCleanup()
      • destroySystem

        public void destroySystem()
      • addRuntime

        public void addRuntime​(Layer fromLayer,
                               IRuntimeProcessor proc)
        Called from a Layer's start method to install a new runtime which that layer requires. A proc value of "null" means to require the default "java" runtime. A LayeredSystem is created for each runtime. Each LayeredSystem haa one runtimeProcessor (or null).
      • getActiveLayeredSystem

        public LayeredSystem getActiveLayeredSystem​(java.lang.String runtimeName)
        Use this to find the LayeredSystem to debug for the given runtime (or null for the 'java' runtime0
      • getActiveLayeredSystems

        public java.util.List<LayeredSystem> getActiveLayeredSystems()
      • hasActiveRuntime

        public boolean hasActiveRuntime​(java.lang.String name)
      • getProcessDefinition

        public IProcessDefinition getProcessDefinition​(java.lang.String runtimeName,
                                                       java.lang.String procName,
                                                       boolean restore)
      • getOrRestoreRuntime

        public IRuntimeProcessor getOrRestoreRuntime​(java.lang.String name)
      • getRuntimePrefix

        public java.lang.String getRuntimePrefix()
        When there's more than one runtime, need to prefix the src, classes with the runtime name
      • getRuntimeName

        public java.lang.String getRuntimeName()
      • getProcessName

        public java.lang.String getProcessName()
      • getProcessLabel

        public java.lang.String getProcessLabel()
      • getBuildInfoFile

        public java.lang.String getBuildInfoFile()
      • getDynTypeIndexFile

        public java.lang.String getDynTypeIndexFile()
      • getServerEnabled

        public boolean getServerEnabled()
      • getServerURL

        public java.lang.String getServerURL()
      • getURLForPath

        public java.lang.String getURLForPath​(URLPath urlPath)
      • testPatternMatches

        public boolean testPatternMatches​(java.lang.String value)
      • getSyncSystems

        public java.util.List<LayeredSystem> getSyncSystems()
        By default we sync against one layered system for each runtime, unless the process opts out of the default sync profile for that runtime.
      • getMainLayeredSystem

        public LayeredSystem getMainLayeredSystem()
      • isMainSystem

        public boolean isMainSystem()
      • getPeerLayeredSystem

        public LayeredSystem getPeerLayeredSystem​(java.lang.String processIdent)
      • getNeedsAnonymousConversion

        public boolean getNeedsAnonymousConversion()
      • staleModelDependencies

        public boolean staleModelDependencies​(java.lang.String typeName)
        Once we've reloaded a type, we may have added dependencies on that type which were lost after we flushed the type cache. On the positive, the reverse deps are now fresh so all we have to do is to reload them.
      • flushClassCache

        public void flushClassCache​(java.lang.String typeName)
      • getStrataCodeRuntimePath

        public java.lang.String getStrataCodeRuntimePath​(RuntimeModuleType moduleType,
                                                         boolean src)
      • getRuntimeRootInfo

        public sc.layer.LayeredSystem.RuntimeRootInfo getRuntimeRootInfo​(boolean includeDyn)
        Locates the StrataCode runtime in the system paths so that we can use this to ensure generated scripts pick up the sc libraries
      • getLayerPathNames

        public java.lang.String getLayerPathNames()
      • getLayerNames

        public java.lang.String getLayerNames()
      • saveModelInfo

        public void saveModelInfo()
        Called after any models are saved so we update the BuildInfo to correspond to the annotations or changes made in the models
      • isClassLoaded

        public boolean isClassLoaded​(java.lang.String className)
      • addSystemClassDir

        public void addSystemClassDir​(java.lang.String dir)
        Allows frameworks the ability to add to the system's classpath. For example, GWT requires the core source libraries in the system classpath so it uses this method to add a new directory
      • updateBuildClassLoader

        public void updateBuildClassLoader​(java.lang.ClassLoader loader)
      • setCurrent

        public static void setCurrent​(LayeredSystem sys)
      • getSystemClass

        public java.lang.String getSystemClass​(java.lang.String name)
      • findMatchingGlobalNames

        public boolean findMatchingGlobalNames​(Layer fromLayer,
                                               Layer refLayer,
                                               java.lang.String prefix,
                                               java.util.Set<java.lang.String> candidates,
                                               boolean retFullTypeName,
                                               boolean srcOnly,
                                               boolean annotTypes,
                                               int max)
      • getTypeIndexEntry

        public TypeIndexEntry getTypeIndexEntry​(java.lang.String filePath)
        Returns the first TypeIndexEntry available for a given file path - does not initialize the type index or create layers. Does not check active layers. This is used for determining the icons in the file menu which happens early on in the initialization of the IDE.
      • addAllNamesForLayerTypeIndex

        public void addAllNamesForLayerTypeIndex​(LayerTypeIndex index)
        Called to append all of the names in the given layer into the all names list (so we don't have to refresh the "allNames" list when updating the LayerListIndex)
      • addAllNamesForIndexEntry

        public void addAllNamesForIndexEntry​(java.lang.String typeName,
                                             TypeIndexEntry newEntry)
      • findMatchingGlobalNames

        public boolean findMatchingGlobalNames​(Layer fromLayer,
                                               Layer refLayer,
                                               java.lang.String prefix,
                                               java.lang.String prefixPkg,
                                               java.lang.String prefixBaseName,
                                               java.util.Set<java.lang.String> candidates,
                                               boolean retFullTypeName,
                                               boolean srcOnly,
                                               boolean annotTypes,
                                               int max)
        This method is used by the IDE to retrieve names for code-completion, name-lookup, etc.
      • addPreBuildCommand

        public void addPreBuildCommand​(BuildPhase phase,
                                       Layer layer,
                                       java.lang.String... args)
        Adds commands that are executed just before the supplied phase. The commands can include StrataCode template strings. In that case, the current object is the LayeredSystem. This gives you access to the buildInfo, buildDir, etc. An annotation might add elements to a type group and then your command can evaluate the file names for those types.
      • addPreBuildCommand

        public void addPreBuildCommand​(java.lang.String checkTypeGroup,
                                       BuildPhase phase,
                                       Layer layer,
                                       java.lang.String... args)
        Like addPreBuildCommand but takes a typeGroup name to check to determine when to run this command on an incremental build. If members of the type group have changed, the command is re-run. If not then the command is not re-run.
      • addPostProcessCommand

        public void addPostProcessCommand​(BuildPhase phase,
                                          Layer layer,
                                          java.lang.String... args)
        Run the command after after the transformation phase is complete, before files are compiled and packaged
      • addPostBuildCommand

        public void addPostBuildCommand​(BuildPhase phase,
                                        Layer layer,
                                        java.lang.String... args)
        Adds commands that are executed just after the supplied phase. Args can be templates like addPreBuildCommand.
      • addPostBuildCommand

        public void addPostBuildCommand​(java.lang.String checkTypeGroup,
                                        Layer layer,
                                        BuildPhase phase,
                                        java.lang.String... args)
        Adds commands that are executed just after the supplied phase. Args can be templates like addPreBuildCommand.
      • addRunCommand

        public void addRunCommand​(java.lang.String... args)
        Adds commands that are executed just after the supplied phase. Args can be templates like addPreBuildCommand.
      • addTestCommand

        public void addTestCommand​(java.lang.String... args)
        Adds commands that are executed just after the supplied phase. Args can be templates like addPreBuildCommand.
      • getInnerCFClass

        public java.lang.Object getInnerCFClass​(java.lang.String fullTypeName,
                                                java.lang.String cfTypeName,
                                                java.lang.String name)
      • getCompiledClassWithPathName

        public java.lang.Class getCompiledClassWithPathName​(java.lang.String pathName)
      • getRuntimeType

        public java.lang.Object getRuntimeType​(java.lang.String fullTypeName)
        Not only does this fetch the type, it guarantees the statics have been initialized.
      • getCompiledClass

        public java.lang.Class getCompiledClass​(java.lang.String fullTypeName)
        Specified by:
        getCompiledClass in interface IClassResolver
      • isSTypeObject

        public boolean isSTypeObject​(java.lang.Object obj)
        Treats dynamic types as objects, not actual types. Used to allow serializing types as normal objects across the wire in the dynamic runtime.
        Specified by:
        isSTypeObject in interface IDynamicSystem
      • isTypeObject

        public boolean isTypeObject​(java.lang.Object obj)
        Part of the IDynamicModel interface - identifies the type we use to identify dynamic types
        Specified by:
        isTypeObject in interface IDynamicSystem
      • getReturnType

        public java.lang.Object getReturnType​(java.lang.Object method)
        Specified by:
        getReturnType in interface IDynamicSystem
      • getParameterTypes

        public java.lang.Object[] getParameterTypes​(java.lang.Object dynMethod)
        Specified by:
        getParameterTypes in interface IDynamicSystem
      • isAssignableFrom

        public boolean isAssignableFrom​(java.lang.Object type1,
                                        java.lang.Object type2)
        Specified by:
        isAssignableFrom in interface IDynamicSystem
      • getAnnotation

        public java.lang.Object getAnnotation​(java.lang.Object def,
                                              java.lang.Class annotClass)
        Specified by:
        getAnnotation in interface IDynamicSystem
      • getAnnotationByName

        public java.lang.Object getAnnotationByName​(java.lang.Object def,
                                                    java.lang.String annotName)
        Specified by:
        getAnnotationByName in interface IDynamicSystem
      • getMethods

        public java.lang.Object[] getMethods​(java.lang.Object type,
                                             java.lang.String methodName)
        Specified by:
        getMethods in interface IDynamicSystem
      • invokeMethod

        public java.lang.Object invokeMethod​(java.lang.Object obj,
                                             java.lang.Object method,
                                             java.lang.Object[] argValues)
        Specified by:
        invokeMethod in interface IDynamicSystem
      • getMethodName

        public java.lang.String getMethodName​(java.lang.Object method)
        Specified by:
        getMethodName in interface IDynamicSystem
      • getPropertyName

        public java.lang.String getPropertyName​(java.lang.Object prop)
        Specified by:
        getPropertyName in interface IDynamicSystem
      • getPropertyType

        public java.lang.Object getPropertyType​(java.lang.Object prop)
        Specified by:
        getPropertyType in interface IDynamicSystem
      • evalCast

        public java.lang.Object evalCast​(java.lang.Object type,
                                         java.lang.Object value)
        Specified by:
        evalCast in interface IDynamicSystem
      • isInstance

        public boolean isInstance​(java.lang.Object typeObj,
                                  java.lang.Object dstObj)
        Specified by:
        isInstance in interface IDynamicSystem
      • getAnnotationValue

        public java.lang.Object getAnnotationValue​(java.lang.Object settings,
                                                   java.lang.String s)
        Specified by:
        getAnnotationValue in interface IDynamicSystem
      • getAnnotationValue

        public java.lang.Object getAnnotationValue​(java.lang.Object typeObj,
                                                   java.lang.String annotName,
                                                   java.lang.String valueName)
        Specified by:
        getAnnotationValue in interface IDynamicSystem
      • getInheritedAnnotationValue

        public java.lang.Object getInheritedAnnotationValue​(java.lang.Object typeObj,
                                                            java.lang.String annotName,
                                                            java.lang.String valueName)
        Specified by:
        getInheritedAnnotationValue in interface IDynamicSystem
      • getInheritedScopeName

        public java.lang.String getInheritedScopeName​(java.lang.Object typeObj)
        Returns the scope name for this class, inherited from base-classes. Use this method for runtime types only, not inactive types
        Specified by:
        getInheritedScopeName in interface IDynamicSystem
      • registerCodeUpdateListener

        public void registerCodeUpdateListener​(ICodeUpdateListener type)
      • notifyCodeUpdateListeners

        public void notifyCodeUpdateListeners()
      • applySyncLayer

        public boolean applySyncLayer​(java.lang.String language,
                                      java.lang.String destName,
                                      java.lang.String scopeName,
                                      java.lang.String codeString,
                                      boolean applyRemoteReset,
                                      boolean allowCodeEval,
                                      BindingContext ctx)
        Specified by:
        applySyncLayer in interface IDynamicSystem
      • newInnerInstance

        public java.lang.Object newInnerInstance​(java.lang.Object typeObj,
                                                 java.lang.Object outerObj,
                                                 java.lang.String constrSig,
                                                 java.lang.Object[] params)
        Specified by:
        newInnerInstance in interface IDynamicSystem
      • isArray

        public boolean isArray​(java.lang.Object type)
        Specified by:
        isArray in interface IDynamicSystem
      • getComponentType

        public java.lang.Object getComponentType​(java.lang.Object arrayType)
        Specified by:
        getComponentType in interface IDynamicSystem
      • getPropertyAnnotationValue

        public java.lang.Object getPropertyAnnotationValue​(java.lang.Object type,
                                                           java.lang.String propName,
                                                           java.lang.String annotName,
                                                           java.lang.String attName)
        Specified by:
        getPropertyAnnotationValue in interface IDynamicSystem
      • removeTypeChangeListener

        public void removeTypeChangeListener​(ITypeChangeListener type)
      • removeCodeUpdateListener

        public void removeCodeUpdateListener​(ICodeUpdateListener type)
      • getStaticProperty

        public java.lang.Object getStaticProperty​(java.lang.Object object,
                                                  java.lang.String propertyName)
        Specified by:
        getStaticProperty in interface IDynamicSystem
      • setStaticProperty

        public void setStaticProperty​(java.lang.Object object,
                                      java.lang.String propertyName,
                                      java.lang.Object valueToSet)
        Specified by:
        setStaticProperty in interface IDynamicSystem
      • createInstance

        public java.lang.Object createInstance​(java.lang.Object typeObj,
                                               java.lang.String constrSig,
                                               java.lang.Object[] params)
        Specified by:
        createInstance in interface IDynamicSystem
      • createInnerInstance

        public java.lang.Object createInnerInstance​(java.lang.Object typeObj,
                                                    java.lang.Object outerObj,
                                                    java.lang.String constrSig,
                                                    java.lang.Object[] params)
        Specified by:
        createInnerInstance in interface IDynamicSystem
      • getAllMethods

        public java.lang.Object[] getAllMethods​(java.lang.Object typeObj,
                                                java.lang.String modifier,
                                                boolean hasModifier)
        Specified by:
        getAllMethods in interface IDynamicSystem
      • getEnclosingType

        public java.lang.Object getEnclosingType​(java.lang.Object memberType,
                                                 boolean instOnly)
        Specified by:
        getEnclosingType in interface IDynamicSystem
      • main

        public static void main​(java.lang.String[] args)
      • commandLineEnabled

        public boolean commandLineEnabled()
      • initSync

        public void initSync()
      • buildSystem

        public boolean buildSystem​(java.util.List<java.lang.String> includeFiles,
                                   boolean newLayersOnly,
                                   boolean separateLayersOnly)
        Builds the system. The newLayersOnly option looks for changed files only. separateLayersOnly will only build layers with the buildSeparate=true option. That mode is typically run first - to build all separate layers, so their compiled results can be used for building the normal layers. You can specify the list of includeFiles to build a subset of files if you know exactly what needs to be processed and transformed but that mode is really only used for testing purposes and may not generate an accurate build.
      • buildCompleted

        public void buildCompleted​(boolean doPeers)
      • addTemporaryLayer

        public void addTemporaryLayer​(java.lang.String prefix,
                                      boolean runMain)
      • getDefaultEditorContext

        public EditorContext getDefaultEditorContext()
      • addLayers

        public void addLayers​(java.lang.String[] initLayerNames,
                              boolean makeDynamic,
                              ExecutionContext ctx)
      • addLayer

        public void addLayer​(Layer layer,
                             ExecutionContext ctx,
                             boolean runMain,
                             boolean setPackagePrefix,
                             boolean saveModel,
                             boolean makeBuildLayer,
                             boolean build,
                             boolean isActive,
                             boolean cleanBuildDir,
                             sc.layer.LayerParamInfo lpi)
      • createLayer

        public Layer createLayer​(java.lang.String layerName,
                                 java.lang.String layerPackage,
                                 java.lang.String[] extendsNames,
                                 boolean isDynamic,
                                 boolean isPublic,
                                 boolean isTransparent,
                                 boolean isActive,
                                 boolean saveLayer)
      • getLayerFile

        public getLayerFile​(java.lang.String layerName)
      • getLayerFileInDir

        public getLayerFileInDir​(java.lang.String layerDir,
                                              java.lang.String layerPathName)
      • findLayerDefFileInPath

        public java.lang.String findLayerDefFileInPath​(java.lang.String layerPathName,
                                                       java.lang.String relDir,
                                                       java.lang.String relPath)
        This works like findLayerInPath but only returns the path name of a valid layerDef file.
      • registerLayer

        public void registerLayer​(Layer layer)
      • registerInactiveLayer

        public void registerInactiveLayer​(Layer layer)
      • initInactiveLayer

        public void initInactiveLayer​(Layer layer)
      • lookupActiveLayer

        public Layer lookupActiveLayer​(java.lang.String fullTypeName,
                                       boolean checkPeers,
                                       boolean skipExcluded)
      • lookupInactiveLayer

        public Layer lookupInactiveLayer​(java.lang.String layerName,
                                         boolean checkPeers,
                                         boolean skipExcluded)
        Provide skipExcluded = false unless you want to return null if the layer is excluded
      • lookupLayerSync

        public Layer lookupLayerSync​(java.lang.String fullTypeName,
                                     boolean checkPeers,
                                     boolean skipExcluded)
      • lookupLayer

        public Layer lookupLayer​(java.lang.String fullTypeName,
                                 boolean checkPeers,
                                 boolean skipExcluded)
      • deregisterLayer

        public void deregisterLayer​(Layer layer,
                                    boolean removeFromSpecified)
      • findLayerByName

        public Layer findLayerByName​(java.lang.String relPath,
                                     java.lang.String layerName)
      • findInactiveLayerByName

        public Layer findInactiveLayerByName​(java.lang.String relPath,
                                             java.lang.String layerName,
                                             boolean openLayers)
      • getLayerByName

        public Layer getLayerByName​(java.lang.String layerName)
      • getLayerByTypeName

        public Layer getLayerByTypeName​(java.lang.String layerTypeName)
        layer package prefix + layer name for the UI lookup
      • getLayerByPath

        public Layer getLayerByPath​(java.lang.String layerPath,
                                    boolean checkPeers)
        Uses the normalizes path name, i.e. "/" even on windows
      • getLayerByDirName

        public Layer getLayerByDirName​(java.lang.String layerPath)
        Uses the "." name of the layer as we found it in the layer path. Does not include the layer's package prefix like the full layerName
      • getDepsClassPath

        public java.lang.String getDepsClassPath()
        This is the classpath of the current external dependencies, including all class-path entries added for all layers. Not including the system classpath which StrataCode was started with (unless those directories are added again in a layer)
      • getClassPathForLayer

        public java.lang.String getClassPathForLayer​(Layer startLayer,
                                                     boolean includeBuildDir,
                                                     java.lang.String useBuildDir,
                                                     boolean addSysClassPath)
      • isValidLayersDir

        public boolean isValidLayersDir​(java.lang.String dirName)
        TODO: can we remove this and instead rely on the stricter StrataCode directory organization (in initStratCodeDir0 for identifying a layer directory?
      • addLayerPathDir

        public void addLayerPathDir​(java.lang.String dirName)
      • getNewLayerDir

        public java.lang.String getNewLayerDir()
      • getUndoDirPath

        public java.lang.String getUndoDirPath()
      • getLayerPath

        public java.lang.String getLayerPath()
      • getFilesInPackage

        public java.util.Set<java.lang.String> getFilesInPackage​(java.lang.String packageName)
      • isValidPackage

        public boolean isValidPackage​(java.lang.String packageName)
      • getPackageNames

        public java.util.Set<java.lang.String> getPackageNames()
      • getSrcTypeNames

        public java.util.Set<java.lang.String> getSrcTypeNames​(java.util.List<Layer> listOfLayers,
                                                               boolean prependLayerPrefix,
                                                               boolean includeInnerTypes,
                                                               boolean restrictToLayer,
                                                               boolean includeImports)
      • getSrcTypeNames

        public java.util.Set<java.lang.String> getSrcTypeNames​(boolean prependLayerPrefix,
                                                               boolean includeInnerTypes,
                                                               boolean restrictToLayer,
                                                               boolean includeImports,
                                                               boolean activeLayers)
      • refreshTypeIndex

        public boolean refreshTypeIndex()
        To pick up any new source directories or layers added you can call this
      • initTypeIndex

        public boolean initTypeIndex()
        This is called on the main layered system. It will enable the type index on all peer systems.
      • saveTypeIndexChanges

        public void saveTypeIndexChanges()
      • cleanInactiveCache

        public void cleanInactiveCache()
      • buildLayerTypeIndex

        public LayerTypeIndex buildLayerTypeIndex​(java.lang.String layerName,
                                                  long startTime)
      • rebuildLayersTypeIndex

        public boolean rebuildLayersTypeIndex​(java.util.ArrayList<Layer> rebuildLayers,
                                              long startTime)
      • addLayerToRebuildTypeIndex

        public boolean addLayerToRebuildTypeIndex​(java.lang.String layerName,
                                                  java.util.ArrayList<Layer> layersToRebuild,
                                                  long startTime)
      • getTypeIndexFileName

        public java.lang.String getTypeIndexFileName​(java.lang.String layerName)
      • getTypeIndexFileName

        public java.lang.String getTypeIndexFileName​(java.lang.String typeIndexIdent,
                                                     java.lang.String layerName)
      • readTypeIndexFile

        public LayerTypeIndex readTypeIndexFile​(java.lang.String layerName)
      • readTypeIndexFile

        public LayerTypeIndex readTypeIndexFile​(java.lang.String typeIndexIdent,
                                                java.lang.String layerName)
      • removeTypeIndexFile

        public void removeTypeIndexFile​(java.lang.String typeIndexIdent,
                                        java.lang.String layerName)
      • reportMessage

        public void reportMessage​(MessageType type,
                                  java.lang.CharSequence... args)
      • sysDetails

        public void sysDetails​(java.lang.CharSequence... args)
      • verbose

        public void verbose​(java.lang.CharSequence... args)
      • info

        public void info​(java.lang.CharSequence... args)
      • error

        public void error​(java.lang.CharSequence... args)
      • warning

        public void warning​(java.lang.CharSequence... args)
      • restartAllOnFirstChange

        public boolean restartAllOnFirstChange​(Layer genLayer)
      • isChangedModel

        public boolean isChangedModel​(JavaModel cachedModel,
                                      Layer genLayer,
                                      boolean incrCompile,
                                      boolean processJava)
      • generateCode

        public LayeredSystem.GenerateCodeStatus generateCode​(Layer genLayer,
                                                             java.util.List<java.lang.String> includeFiles,
                                                             BuildPhase phase,
                                                             boolean separateOnly)
        This operation processes each file generating any Java files necessary for language extensions. Various options can be provided to control how this generation is performed. The list of includeFiles specifies a subset of files to process - useful for debugging generator problems mainly. We run this method over the set of BuildPhases - prepare and process. That gives each source file a chance to be manipulated in each phase. We might generate some additional files to process in the prepare phase which are then processed in the process phase. Returns true if everything worked, and false if there were any errors.
      • startLayers

        public void startLayers​(Layer genLayer)
        This gets called on the layer just before generateCode. There are two cases... we make a first pass through all "buildSeparate=true" layers that are not the buildLayer. For those, we start and build the entire layer. For the rest, we'll wait to start them till the second pass. This way, those layers "start" methods can depend on classes which were compiled during the first pass. On the second pass, we are given the buildLayer and now start anything not already started.
      • processLayers

        public void processLayers​(Layer genLayer)
      • setFixedSystemClassLoader

        public void setFixedSystemClassLoader​(java.lang.ClassLoader loader)
      • setAutoSystemClassLoader

        public void setAutoSystemClassLoader​(java.lang.ClassLoader loader)
      • loadClass

        public java.lang.Class loadClass​(java.lang.String className)
        Specified by:
        loadClass in interface IDynamicSystem
      • resolveMethod

        public java.lang.Object resolveMethod​(java.lang.Object type,
                                              java.lang.String methodName,
                                              java.lang.Object returnType,
                                              java.lang.String paramSig)
        Specified by:
        resolveMethod in interface IDynamicSystem
      • cleanTypeCache

        public void cleanTypeCache()
      • flushTypeCache

        public void flushTypeCache()
      • refreshBoundTypes

        public java.util.List<JavaModel> refreshBoundTypes​(int flags,
                                                           boolean active)
      • addAllFiles

        public void addAllFiles​(Layer layer,
                                java.util.Set<SrcEntry> toGenerate,
                                java.util.Set<SrcEntry> allGenerated,
                                java.util.Set<java.lang.String> allGeneratedTypes,
                                java.lang.String srcDirName,
                                java.lang.String srcPath,
                                BuildPhase phase,
                                sc.layer.BuildState bd,
                                java.lang.String srcRootName)
      • needsGeneration

        public boolean needsGeneration​(java.lang.String fileName,
                                       Layer fromLayer,
                                       BuildPhase phase)
      • registerPatternFileProcessor

        public void registerPatternFileProcessor​(java.lang.String pattern,
                                                 IFileProcessor processor)
      • removeFileProcessor

        public void removeFileProcessor​(java.lang.String ext,
                                        Layer fromLayer)
      • registerPatternFileProcessor

        public void registerPatternFileProcessor​(java.lang.String pat,
                                                 IFileProcessor processor,
                                                 Layer fromLayer)
      • registerFileProcessor

        public void registerFileProcessor​(java.lang.String ext,
                                          IFileProcessor processor,
                                          Layer fromLayer)
      • cleanupLayerFileProcessors

        public void cleanupLayerFileProcessors()
      • getFileProcessorForExtension

        public IFileProcessor getFileProcessorForExtension​(java.lang.String ext)
      • getFileProcessorForExtension

        public IFileProcessor getFileProcessorForExtension​(java.lang.String ext,
                                                           java.lang.String fileName,
                                                           boolean abs,
                                                           Layer srcLayer,
                                                           BuildPhase phase,
                                                           boolean generatedFile,
                                                           boolean includeDisabled)
      • getFileProcessorForFileName

        public IFileProcessor getFileProcessorForFileName​(java.lang.String fileName,
                                                          Layer fromLayer,
                                                          BuildPhase phase)
      • getFileProcessorForFileName

        public IFileProcessor getFileProcessorForFileName​(java.lang.String fileName,
                                                          java.lang.String absFileName,
                                                          Layer fromLayer,
                                                          BuildPhase phase,
                                                          boolean generatedFile,
                                                          boolean includeDisabled)
      • parseSrcFile

        public java.lang.Object parseSrcFile​(SrcEntry srcEnt,
                                             boolean reportErrors)
      • parseSrcBuffer

        public java.lang.Object parseSrcBuffer​(SrcEntry srcEnt,
                                               boolean enablePartialValues,
                                               java.lang.String buffer,
                                               boolean dummy,
                                               boolean doInit)
        For IDE-like operations where we need to parse a file but using the current-in memory copy for fast model validation. This method should not alter the runtime code model
      • reparseSrcBuffer

        public java.lang.Object reparseSrcBuffer​(SrcEntry srcEnt,
                                                 ILanguageModel oldModel,
                                                 boolean enablePartialValues,
                                                 java.lang.String buffer,
                                                 boolean dummy,
                                                 boolean doInit)
        For IDE-like operations where we need to parse a file but using the current-in memory copy for fast model validation. This method should not alter the runtime code model
      • parseSrcFile

        public java.lang.Object parseSrcFile​(SrcEntry srcEnt,
                                             boolean isLayer,
                                             boolean checkPeers,
                                             boolean enablePartialValues,
                                             boolean reportErrors,
                                             boolean temporary,
                                             boolean doInit)
      • getCachedModelByPath

        public ILanguageModel getCachedModelByPath​(java.lang.String absFileName,
                                                   boolean active)
      • hasAnnotatedModel

        public boolean hasAnnotatedModel​(SrcEntry srcEnt)
      • clearBeingLoadedModel

        public void clearBeingLoadedModel​(SrcEntry srcEnt)
      • addCachedModel

        public void addCachedModel​(ILanguageModel model)
      • scheduleRefresh

        public void scheduleRefresh()
      • refreshRuntimes

        public SystemRefreshInfo refreshRuntimes​(boolean active)
        This call will update the models in all of the runtimes for either active or inactive types. Even if you specify active, this will not rebuild the active layers.
      • refreshClassCache

        public void refreshClassCache()
        For CFClasses and cached null references we can quickly refresh the contents. Not currently trying to refresh java.lang.Class instances in the compiledClassCache since those are synchronized with the class loader and so cannot be as easily refreshed
      • refreshSystem

        public SystemRefreshInfo refreshSystem​(boolean refreshPeers,
                                               boolean active)
      • refreshJS

        public java.lang.CharSequence refreshJS​(long fromTime)
        Refreshes the system for the javascript client. Returns the JS to eval on the client to do the refresh over there. This will at the same time update the server.
      • rebuildAll

        public void rebuildAll()
      • rebuild

        public boolean rebuild()
      • clearBuildAllFiles

        public void clearBuildAllFiles()
      • rebuild

        public boolean rebuild​(boolean forceBuild)
      • rebuildSystem

        public void rebuildSystem()
      • resetBuild

        public void resetBuild​(boolean doPeers)
      • refreshChangedModels

        public java.util.List<Layer.ModelUpdate> refreshChangedModels​(UpdateInstanceInfo updateInfo,
                                                                      boolean active)
        Looks for changes to any source files. This is a global operation and is pretty slow... eventually we'll hook into a file system watcher like Java7 or the fsnotifier program from intelliJ which lets you monitor file system changes incrementally. TODO: instead of using a file watcher, how about just calling this at most once every few seconds?
      • refresh

        public java.lang.Object refresh​(SrcEntry srcEnt,
                                        ExecutionContext ctx)
        Refreshes one file and applies the changes immediately
      • refresh

        public java.lang.Object refresh​(SrcEntry srcEnt,
                                        ExecutionContext ctx,
                                        UpdateInstanceInfo info,
                                        boolean active)
        Refreshes one file and batches the changes into the supplied UpdateInstanceInfo arg
      • refreshFile

        public void refreshFile​(SrcEntry srcEnt,
                                Layer fromLayer,
                                boolean active)
      • parseSrcType

        public java.lang.Object parseSrcType​(SrcEntry srcEnt,
                                             Layer fromLayer,
                                             boolean isLayer,
                                             boolean reportErrors)
      • addNewDirectory

        public void addNewDirectory​(java.lang.String dirPath)
      • checkRemovedDirectory

        public boolean checkRemovedDirectory​(java.lang.String dirPath)
        Checks if the directory has been removed and if so, updates the indexes
      • doRemoveLayers

        public void doRemoveLayers()
      • notifyModelAdded

        public void notifyModelAdded​(JavaModel model)
      • notifyInnerTypeRemoved

        public void notifyInnerTypeRemoved​(BodyTypeDeclaration innerType)
      • addNewModelListener

        public void addNewModelListener​(IModelListener l)
      • removeNewModelListener

        public boolean removeNewModelListener​(IModelListener l)
      • hasNewModelListener

        public boolean hasNewModelListener​(IModelListener l)
      • loadInstanceFromFile

        public java.lang.Object loadInstanceFromFile​(java.lang.String fileName,
                                                     java.lang.String relFileName)
        Creates an object instance from a .sc file that is not part of a layer, i.e. the global dependencies object Parses the file, inits and starts the component, creates an instance with those properties and returns that instance. This instance is not put into any type index - it is not referenceable by other code
      • modelUpdated

        public void modelUpdated​(ILanguageModel newModel)
        When making changes to a model which don't actually create a new model, we may need to update the layer - e.g. update the imports in the layer which is done here
      • removeModel

        public void removeModel​(ILanguageModel model,
                                boolean removeTypes)
      • getAnnotatedLanguageModel

        public ILanguageModel getAnnotatedLanguageModel​(SrcEntry srcEnt,
                                                        boolean activeOrInactive)
      • addTypesByName

        public void addTypesByName​(Layer layer,
                                   java.lang.String packagePrefix,
                                   java.util.Map<java.lang.String,​TypeDeclaration> newTypes,
                                   Layer fromLayer)
        Adds the types defined in the specified layer to a global index. If the type is overridden by and the overridding type is there, it is skipped.
      • removeTypesByName

        public void removeTypesByName​(Layer layer,
                                      java.lang.String packagePrefix,
                                      java.util.Map<java.lang.String,​TypeDeclaration> newTypes,
                                      Layer fromLayer)
      • typeWasReloaded

        public boolean typeWasReloaded​(java.lang.String fullTypeName)
      • findTypesByRootName

        public java.util.List<BodyTypeDeclaration> findTypesByRootName​(java.lang.String innerTypeName)
      • findTypesByRootMatchingPrefix

        public java.util.List<BodyTypeDeclaration> findTypesByRootMatchingPrefix​(java.lang.String prefix)
      • addTypeDeclaration

        public void addTypeDeclaration​(java.lang.String fullTypeName,
                                       BodyTypeDeclaration toAdd)
      • addTypeByName

        public void addTypeByName​(Layer layer,
                                  java.lang.String fullTypeName,
                                  TypeDeclaration toAdd,
                                  Layer fromLayer)
      • removeTypeByName

        public void removeTypeByName​(Layer layer,
                                     java.lang.String fullTypeName,
                                     TypeDeclaration toRem,
                                     Layer fromLayer)
      • getLastStartedPosition

        public int getLastStartedPosition()
      • getFilesForType

        public java.util.List<SrcEntry> getFilesForType​(java.lang.String typeName)
      • getCachedTypeDeclaration

        public TypeDeclaration getCachedTypeDeclaration​(java.lang.String typeName,
                                                        Layer fromLayer,
                                                        Layer srcLayer,
                                                        boolean updateFrom,
                                                        boolean anyTypeInLayer,
                                                        Layer refLayer,
                                                        boolean innerTypes)
      • getLiveDynamicTypes

        public boolean getLiveDynamicTypes​(java.lang.String typeName)
      • isCompiledFinalLayerType

        public boolean isCompiledFinalLayerType​(java.lang.String typeName)
      • getCanUseCompiledType

        public boolean getCanUseCompiledType​(java.lang.String typeName)
      • getTypeForCompile

        public java.lang.Object getTypeForCompile​(java.lang.String typeName,
                                                  Layer fromLayer,
                                                  boolean prependPackage,
                                                  boolean notHidden,
                                                  boolean srcOnly,
                                                  Layer refLayer,
                                                  boolean layerResolve)
        This is an optimization on top of getSrcTypeDeclaration - if the model is not changed and we are not going from a layer use the compiled version
      • getSrcTypeDeclaration

        public TypeDeclaration getSrcTypeDeclaration​(java.lang.String typeName,
                                                     Layer refLayer)
        This is a simple version of this method to use for getting the inactive or active TypeDeclaration for the given refLayer. You'll get the most specific one if there's more than one layer.
      • getSrcTypeDeclaration

        public TypeDeclaration getSrcTypeDeclaration​(java.lang.String typeName,
                                                     Layer fromLayer,
                                                     boolean prependPackage)
      • getSrcTypeDeclaration

        public TypeDeclaration getSrcTypeDeclaration​(java.lang.String typeName,
                                                     Layer fromLayer,
                                                     boolean prependPackage,
                                                     boolean notHidden)
      • getSrcTypeDeclaration

        public java.lang.Object getSrcTypeDeclaration​(java.lang.String typeName,
                                                      Layer fromLayer,
                                                      boolean prependPackage,
                                                      boolean notHidden,
                                                      boolean srcOnly)
      • getTypeFromCache

        public TypeDeclaration getTypeFromCache​(java.lang.String typeName,
                                                Layer fromLayer,
                                                boolean prependPackage)
      • getSrcTypeDeclaration

        public java.lang.Object getSrcTypeDeclaration​(java.lang.String typeName,
                                                      Layer fromLayer,
                                                      boolean prependPackage,
                                                      boolean notHidden,
                                                      boolean srcOnly,
                                                      Layer refLayer,
                                                      boolean layerResolve)
      • getSrcTypeDeclaration

        public java.lang.Object getSrcTypeDeclaration​(java.lang.String typeName,
                                                      Layer fromLayer,
                                                      boolean prependPackage,
                                                      boolean notHidden,
                                                      boolean srcOnly,
                                                      Layer refLayer,
                                                      boolean layerResolve,
                                                      boolean rootTypeOnly,
                                                      boolean includeEnums)
        Retrieves a type declaration, usually the source definition with a given type name. If fromLayer != null, it retrieves only types defines below fromLayer (not including fromLayer). If prependPackage is true, the name is resolved like a Java type name. If it is false, it is resolved like a file system path - where the type's package is not used in the type name. If not hidden is true, do not return any types which are marked as hidden - i.e. not visible in the editor. In some configurations this mode is used for the addDyn calls so that we do not bother loading for source you are not going to change. The srcOnly flag is t if you need a TypeDeclaration - and cannot deal with a final class. If refLayer is supplied, it refers to the referring layer. It's not ordinarily used in an active application but for an inactive layer, it changes how the lookup is performed. rootTypeOnly = true to skip inner types includeEnums = true to return enumerated constant values - i.e. the EnumConstant instance used for when we modify enums
      • hasAnyTypeDeclaration

        public boolean hasAnyTypeDeclaration​(java.lang.String typeName)
        Returns false if there's no entry with this name - explicitly without parsing it if it's not already loaded
      • getUseCompiledForFinal

        public boolean getUseCompiledForFinal()
        When buildAllFiles is true, do not bother with the optimization for using compiled types
      • getTypeDeclaration

        public java.lang.Object getTypeDeclaration​(java.lang.String typeName)
      • getTypeDeclaration

        public java.lang.Object getTypeDeclaration​(java.lang.String typeName,
                                                   boolean srcOnly,
                                                   Layer refLayer,
                                                   boolean layerResolve)
      • getRuntimeTypeDeclaration

        public java.lang.Object getRuntimeTypeDeclaration​(java.lang.String typeName)
      • evalTemplate

        public java.lang.String evalTemplate​(java.lang.Object paramObj,
                                             java.lang.String typeName,
                                             java.lang.Class paramClass,
                                             Layer refLayer,
                                             boolean layerResolve)
      • getTemplate

        public Template getTemplate​(java.lang.String typeName,
                                    java.lang.String suffix,
                                    java.lang.Class paramClass,
                                    Layer fromLayer,
                                    Layer refLayer,
                                    boolean layerResolve)
      • removeFromInnerTypeCache

        public java.lang.Object removeFromInnerTypeCache​(java.lang.String typeName)
      • getCompiledType

        public java.lang.Object getCompiledType​(java.lang.String fullTypeName)
      • getRelativeTypeDeclaration

        public java.lang.Object getRelativeTypeDeclaration​(java.lang.String typeName,
                                                           java.lang.String packagePrefix,
                                                           Layer fromLayer,
                                                           boolean prependPackage,
                                                           Layer refLayer,
                                                           boolean layerResolve,
                                                           boolean srcOnly)
      • parseInactiveFile

        public java.lang.Object parseInactiveFile​(SrcEntry srcEnt)
      • parseActiveFile

        public java.lang.Object parseActiveFile​(SrcEntry srcEnt)
      • getImportDecl

        public ImportDeclaration getImportDecl​(Layer fromLayer,
                                               Layer refLayer,
                                               java.lang.String typeName)
        Auto imports are resolved by searching through the layer hierarchy from the layer which originates the reference
      • getLayerImport

        public ImportDeclaration getLayerImport​(java.lang.String typeName)
      • addLayerImport

        public void addLayerImport​(java.lang.String importedName,
                                   boolean isStatic)
        Use this to add an import that will only be valid for processing all layer definition files.
      • isImported

        public boolean isImported​(java.lang.String srcTypeName)
      • getImportedStaticType

        public java.lang.Object getImportedStaticType​(java.lang.String name,
                                                      Layer fromLayer,
                                                      Layer refLayer)
      • addAutoImport

        public void addAutoImport​(Layer srcLayer,
                                  java.lang.String typeName,
                                  ImportDeclaration importDecl)
        The autoImports are created each time we reference a type that is not explicitly imported during the start process on the original model. Because of the lazy way in which models get loaded and resolved I don't think we can rely on imports being added in the right order. And yet, it will be important that a later layer be able to override the import in a previous layer.
      • getSrcFileFromTypeName

        public SrcEntry getSrcFileFromTypeName​(java.lang.String typeName,
                                               boolean srcOnly,
                                               Layer fromLayer,
                                               boolean prependPackage,
                                               java.lang.String suffix)
      • getSrcFileFromTypeName

        public SrcEntry getSrcFileFromTypeName​(java.lang.String typeName,
                                               boolean srcOnly,
                                               Layer fromLayer,
                                               boolean prependPackage,
                                               java.lang.String suffix,
                                               Layer refLayer,
                                               boolean layerResolve)
        Returns the Java file that defines this type. If srcOnly is false, it will also look for the file which defines the class if no Java file is found. You can use that mode to get the file which defines the type for dependency purposes.
      • getSrcFileFromRelativeTypeName

        public SrcEntry getSrcFileFromRelativeTypeName​(java.lang.String typeName,
                                                       java.lang.String packagePrefix,
                                                       boolean srcOnly,
                                                       Layer fromLayer,
                                                       boolean prependPackage,
                                                       Layer refLayer,
                                                       boolean layerResolve)
        Returns the Java file that defines this type. If srcOnly is false, it will also look for the file which defines the class if no Java file is found. You can use that mode to get the file which defines the type for dependency purposes.
      • getClassWithPathName

        public java.lang.Object getClassWithPathName​(java.lang.String pathName)
      • getClassWithPathName

        public java.lang.Object getClassWithPathName​(java.lang.String pathName,
                                                     Layer refLayer,
                                                     boolean layerResolve,
                                                     boolean alwaysCheckInnerTypes,
                                                     boolean forceClass)
      • getClassWithPathName

        public java.lang.Object getClassWithPathName​(java.lang.String pathName,
                                                     Layer refLayer,
                                                     boolean layerResolve,
                                                     boolean alwaysCheckInnerTypes,
                                                     boolean forceClass,
                                                     boolean compiledOnly)
      • toBeCompiled

        public boolean toBeCompiled​(java.lang.String typeName,
                                    Layer refLayer,
                                    boolean layerResolve)
        Returns true for any types which are defined by src in layers that have yet to be compiled. We can't load these as class files before they are compiled or we'll blow up. A better way to fix this would be to eliminate all getClass(typeName) calls for a type which exists in this state but that may be difficult so this is a stop-gap way of avoiding the same thing. Right now, the key problem is JavaModel.findTypeDeclaration call to getClass when it can't find it as a relative type.
      • isEnumType

        public boolean isEnumType​(java.lang.Object type)
        Specified by:
        isEnumType in interface IDynamicSystem
      • getEnumConstant

        public java.lang.Object getEnumConstant​(java.lang.Object typeObj,
                                                java.lang.String enumConstName)
        Specified by:
        getEnumConstant in interface IDynamicSystem
      • getExtendsType

        public java.lang.Object getExtendsType​(java.lang.Object type)
        Specified by:
        getExtendsType in interface IDynamicSystem
      • getClass

        public java.lang.Object getClass​(java.lang.String className,
                                         boolean forceClass)
        The core method to use to retrieve a compiled class from the system. It will use either of two mechanisms to get the class definition - read it using the ClassLoader or it will find the file and parse the .class file into a lightweight data structure - CFClass. If you require a true runtime class, provide forceClass=true.
      • getClassFromCFName

        public java.lang.Object getClassFromCFName​(java.lang.String cfName,
                                                   java.lang.String className)
        Note: cfName here is normalized since it comes from the class file
      • getClassFromClassFileName

        public java.lang.Object getClassFromClassFileName​(java.lang.String classFileName,
                                                          java.lang.String className)
      • resolveRuntimeName

        public java.lang.Object resolveRuntimeName​(java.lang.String name,
                                                   boolean create,
                                                   boolean returnTypes)
        Specified by:
        resolveRuntimeName in interface IDynamicSystem
      • resolveName

        public java.lang.Object resolveName​(java.lang.String name,
                                            boolean create)
      • resolveName

        public java.lang.Object resolveName​(java.lang.String name,
                                            boolean create,
                                            boolean returnTypes)
        Specified by:
        resolveName in interface INameContext
      • resolveName

        public java.lang.Object resolveName​(java.lang.String name,
                                            boolean create,
                                            Layer refLayer,
                                            boolean layerResolve,
                                            boolean returnTypes)
      • findType

        public java.lang.Object findType​(java.lang.String typeName)
        Specified by:
        findType in interface IDynamicSystem
      • findTypeWithLoader

        public java.lang.Object findTypeWithLoader​(java.lang.String typeName,
                                                   java.lang.ClassLoader loader)
        Specified by:
        findTypeWithLoader in interface IDynamicSystem
      • isObject

        public boolean isObject​(java.lang.Object obj)
        Specified by:
        isObject in interface IDynamicSystem
      • getObjectName

        public java.lang.String getObjectName​(java.lang.Object obj,
                                              java.util.Map<java.lang.Object,​java.lang.String> objectIds,
                                              java.util.Map<java.lang.String,​java.lang.Integer> typeIdCounts)
        Specified by:
        getObjectName in interface IDynamicSystem
      • isRootedObject

        public boolean isRootedObject​(java.lang.Object obj)
        Can we reach this instance via a path name from a root type.
        Specified by:
        isRootedObject in interface IDynamicSystem
      • addGlobalObject

        public void addGlobalObject​(java.lang.String name,
                                    java.lang.Object obj)
      • acquireDynLock

        public void acquireDynLock​(boolean readOnly)
      • releaseDynLock

        public void releaseDynLock​(boolean readOnly)
      • ensureLocked

        public void ensureLocked()
      • getDynReadLock

        public java.util.concurrent.locks.Lock getDynReadLock()
      • getDynWriteLock

        public java.util.concurrent.locks.Lock getDynWriteLock()
      • addDynInnerObject

        public void addDynInnerObject​(java.lang.String typeName,
                                      java.lang.Object inst,
                                      java.lang.Object outer)
        Specified by:
        addDynInnerObject in interface IDynamicSystem
      • addDynInnerInstance

        public void addDynInnerInstance​(java.lang.String typeName,
                                        java.lang.Object inst,
                                        java.lang.Object outer)
        Specified by:
        addDynInnerInstance in interface IDynamicSystem
      • getTypeName

        public java.lang.String getTypeName​(java.lang.Object type,
                                            boolean includeDims)
        Specified by:
        getTypeName in interface IDynamicSystem
      • getOuterInstance

        public java.lang.Object getOuterInstance​(java.lang.Object inst)
      • addDynObject

        public void addDynObject​(java.lang.String typeName,
                                 java.lang.Object inst)
        Specified by:
        addDynObject in interface IDynamicSystem
      • addDynInstance

        public void addDynInstance​(java.lang.String typeName,
                                   java.lang.Object inst)
        Specified by:
        addDynInstance in interface IDynamicSystem
      • addDynInstanceInternal

        public void addDynInstanceInternal​(java.lang.String typeName,
                                           java.lang.Object inst,
                                           Layer refLayer)
      • removeDynInstance

        public boolean removeDynInstance​(java.lang.String typeName,
                                         java.lang.Object inst)
      • dispose

        public void dispose​(java.lang.Object obj)
        Called to remove the object from the dynamic type system. Though we use weak storage for these instances, it's faster to get rid of them when you are done. Use DynUtil.dispose to also remove the bindings.
        Specified by:
        dispose in interface IDynamicSystem
      • getNumInnerTypeLevels

        public int getNumInnerTypeLevels​(java.lang.Object type)
        Walks up the object hierarchy until we hit a class or go off the top.
        Specified by:
        getNumInnerTypeLevels in interface IDynamicSystem
      • getOuterObject

        public java.lang.Object getOuterObject​(java.lang.Object obj)
        Specified by:
        getOuterObject in interface IDynamicSystem
      • getPackageName

        public java.lang.String getPackageName​(java.lang.Object type)
        Specified by:
        getPackageName in interface IDynamicSystem
      • hasInstancesOfType

        public boolean hasInstancesOfType​(java.lang.String typeName)
        Returns true if there are any instances of this type or instances of sub-types
      • getInstancesOfType

        public java.util.Iterator<java.lang.Object> getInstancesOfType​(java.lang.String typeName)
      • getSubTypeNamesOfType

        public java.util.Iterator<java.lang.String> getSubTypeNamesOfType​(TypeDeclaration type)
      • getSubTypesOfType

        public java.util.Iterator<BodyTypeDeclaration> getSubTypesOfType​(BodyTypeDeclaration type,
                                                                         Layer refLayer,
                                                                         boolean openLayers,
                                                                         boolean checkPeers,
                                                                         boolean includeModifiedTypes,
                                                                         boolean cachedOnly)
        Returns the sub-types of the specified type. If activeOnly is true, only those types active in this system are checked. If activeOnly is false and checkPeers is true, the type name is used to find sub-types in the peer systems as well.
      • addTypeGroupDependency

        public void addTypeGroupDependency​(Layer forLayer,
                                           java.lang.String relFileName,
                                           java.lang.String typeName,
                                           java.lang.String typeGroupName)
        Some files depend on the contents of a type group. The layer which defines this file right now must manually add the file to this list during layer initialization. Unless we are building all files, we'll check each entry in this list to see if the type group contents have changed since we last built the file. If so, we add the file to the list of files that need to be processed.
      • isDynamicRuntime

        public boolean isDynamicRuntime()
      • setStaleCompiledModel

        public void setStaleCompiledModel​(boolean val,
                                          java.lang.String... reason)
      • getStaleCompiledModel

        public boolean getStaleCompiledModel()
      • getStaleInfo

        public java.lang.String getStaleInfo()
      • getShortStaleInfo

        public java.lang.String getShortStaleInfo()
      • hasDynamicLayers

        public boolean hasDynamicLayers()
      • refreshType

        public void refreshType​(java.lang.String typeName)
        Specified by:
        refreshType in interface IDynamicSystem
      • getObjChildren

        public java.lang.Object[] getObjChildren​(java.lang.Object inst,
                                                 java.lang.String scopeName,
                                                 boolean create)
        Specified by:
        getObjChildren in interface IDynamicSystem
      • getObjChildrenNames

        public java.lang.String[] getObjChildrenNames​(java.lang.Object typeObj,
                                                      java.lang.String scopeName)
        Specified by:
        getObjChildrenNames in interface IDynamicSystem
      • getObjChildrenTypes

        public java.lang.Object[] getObjChildrenTypes​(java.lang.Object typeObj,
                                                      java.lang.String scopeName)
        Specified by:
        getObjChildrenTypes in interface IDynamicSystem
      • hasModifier

        public boolean hasModifier​(java.lang.Object def,
                                   java.lang.String modifier)
        Specified by:
        hasModifier in interface IDynamicSystem
      • needsExtDynType

        public boolean needsExtDynType​(java.lang.Object typeObj)
      • restart

        public void restart()
        Use this to an 'scc' started process to restart - exits with an exit code that signals the script to re-run the command using the arguments passed to this 'scc' process uing the restart file command-line arg passed in by the scc script
      • getRestartArgs

        public java.lang.String getRestartArgs()
      • getCanRestart

        public boolean getCanRestart()
      • getInactiveLayer

        public Layer getInactiveLayer​(java.lang.String layerPath,
                                      boolean openLayer,
                                      boolean checkPeers,
                                      boolean enabled,
                                      boolean skipExcluded)
        Retrieves a Layer instance given the layer name - i.e. (it also accepts the path group/name). If checkPeers = true, you may receive a layer in a runtime (that is lazily created the first time it's needed). For enabled: Pass in true unless you explicitly do not want to enable the layer. Enabling the layer adds it to to the classpath so types in the layer can be starte so types in the layer can be started For skipExcluded: pass in true unless you want to get the excluded layer from this runtime which we create temporarily to bootstrap layers in other runtimes. We first create the Layer in the original runtime to see if it's excluded or not. If so, we remove from the list.
      • getActiveOrInactiveLayerByPathSync

        public Layer getActiveOrInactiveLayerByPathSync​(java.lang.String layerPath,
                                                        java.lang.String prefix,
                                                        boolean openLayer,
                                                        boolean checkPeers,
                                                        boolean enabled)
      • getActiveOrInactiveLayerByPath

        public Layer getActiveOrInactiveLayerByPath​(java.lang.String layerPath,
                                                    java.lang.String prefix,
                                                    boolean openLayer,
                                                    boolean checkPeers,
                                                    boolean enabled)
      • getInactiveLayerByPath

        public Layer getInactiveLayerByPath​(java.lang.String layerPath,
                                            java.lang.String prefix,
                                            boolean openLayer,
                                            boolean enabled)
      • getAnnotatedLayerModel

        public JavaModel getAnnotatedLayerModel​(java.lang.String layerPath,
                                                java.lang.String prefix)
      • getAllLayerIndex

        public java.util.Map<java.lang.String,​LayerIndexInfo> getAllLayerIndex()
      • getAllIndexLayer

        public Layer getAllIndexLayer​(java.lang.String layerName)
      • excludedFile

        public boolean excludedFile​(java.lang.String fileName,
                                    java.lang.String prefix)
      • removeGlobalObject

        public java.lang.Object removeGlobalObject​(java.lang.String typeName)
      • getCompiledOnly

        public boolean getCompiledOnly()
      • toString

        public java.lang.String toString()
        toString in class java.lang.Object
      • isGlobalScope

        public boolean isGlobalScope​(java.lang.String scopeName)
      • getSrcEntryForPath

        public SrcEntry getSrcEntryForPath​(java.lang.String pathName,
                                           boolean activeLayers,
                                           boolean openLayer)
      • getLoadClassesInRuntime

        public boolean getLoadClassesInRuntime()
        Avoid loading classes or initing dynamic types for the JS runtime because it's not really active
      • getUseContextClassLoader

        public boolean getUseContextClassLoader()
      • registerDefaultAnnotationProcessor

        public void registerDefaultAnnotationProcessor​(java.lang.String annotationTypeName,
                                                       IAnnotationProcessor processor)
      • getAnnotationProcessor

        public IAnnotationProcessor getAnnotationProcessor​(Layer refLayer,
                                                           java.lang.String annotName)
      • getScopeProcessor

        public getScopeProcessor​(Layer refLayer,
                                                            java.lang.String scopeName)
      • needsSync

        public boolean needsSync​(java.lang.Object type)
        Specified by:
        needsSync in interface IDynamicSystem
      • getScopeAlias

        public java.lang.String getScopeAlias​(Layer refLayer,
                                              java.lang.String scopeName)
      • getHasSystemErrors

        public boolean getHasSystemErrors()
      • addVMParameter

        public void addVMParameter​(java.lang.String paramName,
                                   java.lang.String value)
        Add parameters to the virtual machine to run this program. Each parameter is given a name so that it can be overridden. For options like -mx the name should be the option itself as I'm sure Java doesn't want more than one of those.
      • getVMParameters

        public java.lang.String getVMParameters()
      • isRuntimeDisabled

        public boolean isRuntimeDisabled​(java.lang.String runtimeName)
      • isRuntimeActivated

        public boolean isRuntimeActivated​(java.lang.String runtimeName)
      • isProcessActivated

        public boolean isProcessActivated​(java.lang.String processName)
      • isDisabled

        public boolean isDisabled()
      • isParseable

        public boolean isParseable​(java.lang.String fileName)
      • addGlobalImports

        public boolean addGlobalImports​(boolean isLayerModel,
                                        java.lang.String prefixPackageName,
                                        java.lang.String prefixBaseName,
                                        java.util.Set<java.lang.String> candidates,
                                        int max)
      • getSameLayerFromRemote

        public Layer getSameLayerFromRemote​(Layer layer)
      • getPeerLayerFromRemote

        public Layer getPeerLayerFromRemote​(Layer layer)
      • getCoreBuildLayer

        public Layer getCoreBuildLayer()
      • dumpCacheStats

        public java.lang.StringBuilder dumpCacheStats()
      • dumpCacheSummary

        public void dumpCacheSummary​(java.lang.StringBuilder sb,
                                     boolean includePeers)
      • getNumModelsInCache

        public int getNumModelsInCache()
        Returns the total number of models currently in the cache - as an estimate to determine when to clean the cache
      • getSrcPathBuildPrefix

        public java.lang.String getSrcPathBuildPrefix​(java.lang.String srcPathType)
        Returns the prefix to prepend onto files generated for the given srcPathType (e.g. 'web', 'config', etc.)
      • applyModelChange

        public void applyModelChange​(ILanguageModel model,
                                     boolean changed)
      • updatePeerModels

        public void updatePeerModels​(boolean doPeers)
      • updateModelInPeers

        public void updateModelInPeers​(ILanguageModel model)
      • getRunFromDir

        public java.lang.String getRunFromDir()
      • removeDynListener

        public void removeDynListener​(IDynListener listener)
      • fetchRemoteTypeDeclaration

        public void fetchRemoteTypeDeclaration​(java.lang.String typeName,
                                               IResponseListener resp)
      • getSrcTypeDeclaration

        public BodyTypeDeclaration getSrcTypeDeclaration​(java.lang.String typeName)
      • runtimeInitialized

        public void runtimeInitialized()
      • waitForRuntime

        public boolean waitForRuntime​(long timeout)
      • isDefaultSystem

        public boolean isDefaultSystem()
      • getInactiveIndexLayers

        public java.util.List<Layer> getInactiveIndexLayers()
        Returns the complete set of inactive layers - returns the more complete inactiveLayer entry or the one from the type index if the inactive layer is not loaded yet
      • getCurrentInactiveLayers

        public java.util.List<Layer> getCurrentInactiveLayers()
      • clearCaches

        public void clearCaches()
      • isInitRuntime

        public boolean isInitRuntime​(IRuntimeProcessor proc)
        Returns true for the IRuntimeProcessor which defines the process which should initialize the other processes.
      • getCompiledFiles

        public java.util.List<java.lang.String> getCompiledFiles​(java.lang.String lang,
                                                                 java.lang.String typeName)
        This method is used by BuildInit hooks to inject the set of compile files into generated script tags or other similar patterns for other languages
      • addDataSource

        public void addDataSource​(DBDataSource newDataSource,
                                  Layer definedInLayer)
      • getDBProvider

        public sc.lang.sql.DBProvider getDBProvider​(java.lang.String provider,
                                                    Layer refLayer)
      • getDataSource

        public DBDataSource getDataSource​(java.lang.String dataSourceName,
                                          boolean active)
      • addDBProvider

        public void addDBProvider​(sc.lang.sql.DBProvider provider,
                                  Layer definedInLayer)