SingleServingGosuClassLoader( GosuClassLoader parent ) { super( parent.getActualLoader() ); _parent = parent; if( CommonServices.getPlatformHelper().isInIDE() ) { //## todo: uncomment //throw new IllegalStateException( "Class loading with single-serving loader is probably wrong in the IDE" ); } }
public static ExecutionMode get() { return _mode == null ? (_mode = CommonServices.getPlatformHelper().getExecutionMode()) : _mode; } public static void clear() {
@Override public boolean isPathIgnored( String sourceFile ) { return CommonServices.getPlatformHelper().isPathIgnored( sourceFile ); } }
public void saveTypeNames() { final File ideaCorruptionMarkerFile = CommonServices.getPlatformHelper().getIDEACorruptionMarkerFile(); if (ideaCorruptionMarkerFile.exists()) { // clean typenames cache deleteIndexFile(); return; } File indexFile = CommonServices.getPlatformHelper().getIndexFile(getId()); PrintWriter writer = null; try { Set<String> allTypeNames = getAllTypeNames(); writer = new PrintWriter(new FileWriter(indexFile)); for (CharSequence typeName : allTypeNames) { writer.println(typeName); } } catch (IOException e) { throw new RuntimeException("Error while saving Gosu Type Index for " + this); } finally { try { writer.close(); } catch (Throwable e) { } } }
protected void deleteIndexFile() { File indexFile = CommonServices.getPlatformHelper().getIndexFile(getId()); try { indexFile.delete(); } catch (Exception e) { } return; }
public void refresh(IModule module) { // dlank: should an exception be thrown if the server is not in dev mode? pushModule(module); TypeSystem.lock(); try { if (module instanceof IJreModule) { dumpMaps(); } ++_iRefreshChecksum; ++_iSingleRefreshChecksum; getGlobalModuleTypeLoader().refreshed(); ((Module)module).getModuleTypeLoader().refreshed(); CommonServices.getPlatformHelper().refresh(module); fireRefreshed(); ((Module)module).getModuleTypeLoader().getTypeRefFactory().clearCaches(); _defaultTypes = null; } finally { TypeSystem.unlock(); popModule(module); } }
protected boolean shouldCacheTypeNames() { return CommonServices.getPlatformHelper().shouldCacheTypeNames(); } }
public void saveTypeNames() { final File ideaCorruptionMarkerFile = CommonServices.getPlatformHelper().getIDEACorruptionMarkerFile(); if (ideaCorruptionMarkerFile.exists()) { // clean typenames cache deleteIndexFile(); return; } File indexFile = CommonServices.getPlatformHelper().getIndexFile(getId()); PrintWriter writer = null; try { Set<String> allTypeNames = getAllTypeNames(); writer = new PrintWriter(new FileWriter(indexFile)); for (CharSequence typeName : allTypeNames) { writer.println(typeName); } } catch (IOException e) { throw new RuntimeException("Error while saving Gosu Type Index for " + this); } finally { try { writer.close(); } catch (Throwable e) { } } }
protected void deleteIndexFile() { File indexFile = CommonServices.getPlatformHelper().getIndexFile(getId()); try { indexFile.delete(); } catch (Exception e) { } return; }
public void refresh(IModule module) { // dlank: should an exception be thrown if the server is not in dev mode? pushModule(module); TypeSystem.lock(); try { if (module instanceof IJreModule) { dumpMaps(); } ++_iRefreshChecksum; ++_iSingleRefreshChecksum; getGlobalModuleTypeLoader().refreshed(); ((Module)module).getModuleTypeLoader().refreshed(); CommonServices.getPlatformHelper().refresh(module); fireRefreshed(); ((Module)module).getModuleTypeLoader().getTypeRefFactory().clearCaches(); _defaultTypes = null; } finally { TypeSystem.unlock(); popModule(module); } }
protected boolean shouldCacheTypeNames() { return CommonServices.getPlatformHelper().shouldCacheTypeNames(); } }
protected GosuParser getOrCreateParser(CompiledGosuClassSymbolTable symbolTable) { if( _parser != null ){ return _parser; } else { GosuParser parser = createParser(symbolTable); if (CommonServices.getPlatformHelper().isInIDE()) { _parser = parser; } return parser; } }
private void processDirectory(PackageToClassPathEntryTreeMap node, IFileSystemGosuClassRepository.ClassPathEntry entry, IDirectory path) { if (_excludedPath.contains(path)) { return; } IDirectory entryPath = entry.getPath(); if (entryPath.equals(path) || !CommonServices.getPlatformHelper().isPathIgnored(entryPath.relativePath(path))) { List<? extends IDirectory> dirs = path.listDirs(); for (IDirectory dir : dirs) { if (isValidDirectory(dir)) { PackageToClassPathEntryTreeMap child = node.createChildForDir(entry, dir.getName()); processDirectory(child, entry, dir); } } } }
public void updateSource( String source ) { _sourceFingerprint = CommonServices.getPlatformHelper().getExecutionMode() == ExecutionMode.IDE ? new FP64(source).getRawFingerprint() // only really matters inside an IDE : source.length(); }
public Set<String> loadTypeNames() { File indexFile = CommonServices.getPlatformHelper().getIndexFile(getId()); if (indexFile.exists()) { LineNumberReader reader = null; try { reader = new LineNumberReader(new FileReader(indexFile)); Set<String> names = new HashSet<String>(); for (String typeName = reader.readLine(); typeName != null; typeName = reader.readLine()) { names.add(typeName); } return names; } catch (IOException e) { // will return null } finally { try { reader.close(); } catch (Throwable e) { } } } return null; }
CommonServices.getPlatformHelper().refresh(null);
private static Iterable<? extends IFile> getSchemaLocationsFiles(IModule module) { if (CommonServices.getPlatformHelper().isInIDE()) { module = TypeSystem.getGlobalModule(); } Set<IFile> result = new LinkedHashSet<IFile>(); result.addAll(findAllFiles("config/xml/schemalocations.xml", module.getRoots())); // XML module itself now has this file inside "sources path" result.addAll(findAllFiles("xml/schemalocations.xml", module.getSourcePath())); return result; }
private void processDirectory(PackageToClassPathEntryTreeMap node, IFileSystemGosuClassRepository.ClassPathEntry entry, IDirectory path) { IDirectory entryPath = entry.getPath(); if (entryPath.equals(path) || !CommonServices.getPlatformHelper().isPathIgnored(entryPath.relativePath(path))) { List<? extends IDirectory> dirs = path.listDirs(); for (IDirectory dir : dirs) { if (isValidDirectory(dir)) { PackageToClassPathEntryTreeMap child = node.createChildForDir(entry, dir.getName()); processDirectory(child, entry, dir); } } } }
IClassFileStatement classFileStatement = ((IClassStatement)classElement).getClassFileStatement(); classElement = classFileStatement == null ? classElement : classFileStatement; ExecutionMode mode = CommonServices.getPlatformHelper().getExecutionMode(); for( IParseIssue issue : classElement.getParseIssues() )
public Set<String> loadTypeNames() { File indexFile = CommonServices.getPlatformHelper().getIndexFile(getId()); if (indexFile.exists()) { LineNumberReader reader = null; try { reader = new LineNumberReader(new FileReader(indexFile)); Set<String> names = new HashSet<String>(); for (String typeName = reader.readLine(); typeName != null; typeName = reader.readLine()) { names.add(typeName); } return names; } catch (IOException e) { // will return null } finally { try { reader.close(); } catch (Throwable e) { } } } return null; }