Package org.openquark.cal.machine

Examples of org.openquark.cal.machine.ProgramResourceRepository


       
        // Calculate the new class size if:
        // - there are class files generated,
        // - there is a repository, and
        // - either force code regen is on, or the repository starts off empty.
        ProgramResourceRepository repository = workspaceManager.getRepository();
        boolean calcClassSize =
            getMachineType() == MachineType.LECC &&
            repository != null && (forceCodeRegen || repository.isEmpty());
       
        synchronized (this.workspaceManager) {
            CompilerMessageLogger ml = new MessageLogger();
           
            if (initialize) {
View Full Code Here


     */
    private SizeAndCount calcRepositorySize() {
        long size = 0;
        long count = 0;
       
        ProgramResourceRepository resourceRepository = getWorkspaceManager().getRepository();
        ModuleName[] repositoryModuleNames = resourceRepository.getModules();
        for (final ModuleName moduleName : repositoryModuleNames) {
            SizeAndCount moduleSizeAndCount = calcClassFileSize(new ProgramResourceLocator.Folder(moduleName, ResourcePath.EMPTY_PATH));
           
            size += moduleSizeAndCount.size;
            count += moduleSizeAndCount.count;
View Full Code Here

     * @param calServices the copy of BasicCALServices whose resources are to be cleaned up.
     * @param rootSuffix the suffix for the root output directory.
     */
    private static void conditionallyCleanupRuntime(BasicCALServices calServices, String rootSuffix) {
        if (ENABLE_RUNTIME_CLEANUP) {
            ProgramResourceRepository resourceRepository = calServices.getWorkspaceManager().getRepository();
            if (resourceRepository != null && !resourceRepository.isEmpty()) {
                ModuleName[] moduleNames = resourceRepository.getModules();

                String workspaceDirectoryID = calServices.getCALWorkspace().getWorkspaceID();
               
                  
                if (rootSuffix != null) {
View Full Code Here

    private static void writeModuleProgramResourcesToCar(WorkspaceManager workspaceManager, ModuleName moduleName, JarOutputStream jos, ProgramResourcePathMapper programResourcePathMapper) throws IOException {
       
        ResourcePath.Folder moduleFolderPath = (ResourcePath.Folder)programResourcePathMapper.getModuleResourcePath(moduleName);
        ProgramResourceLocator.Folder folderLocator = new ProgramResourceLocator.Folder(moduleName, ResourcePath.EMPTY_PATH);
       
        ProgramResourceRepository programResourceRepository = workspaceManager.getRepository();
        ProgramResourceLocator[] resourceLocators = programResourceRepository.getMembers(folderLocator);
       
        for (final ProgramResourceLocator resourceLocator : resourceLocators) {
            if (resourceLocator instanceof ProgramResourceLocator.File) {
               
                ProgramResourceLocator.File fileLocator = (ProgramResourceLocator.File)resourceLocator;
               
                String relativePath = moduleFolderPath.extendFile(resourceLocator.getName()).getPathStringMinusSlash();
               
                ZipEntry entry = new ZipEntry(relativePath);
               
                jos.putNextEntry(entry);
                InputStream inputStream = programResourceRepository.getContents(fileLocator)// this call throws IOException, and should not return null on error
                try {
                    FileSystemResourceHelper.transferData(inputStream, jos);
                } finally {
                    // We need to close the input stream explicitly or else we will be leaking file handles
                    inputStream.close();
View Full Code Here

    ProgramResourceRepository.Provider getProviderForCarAwareProgramResourceRepository(final ProgramResourceRepository.Provider baseProvider) {

        return new ProgramResourceRepository.Provider() {

            public ProgramResourceRepository getRepository(final MachineType machineType) {
                final ProgramResourceRepository baseRepository = baseProvider.getRepository(machineType);
                return new CarAwareProgramResourceRepository(baseRepository, new ProgramResourcePathMapper(machineType));
            }
        };
    }
View Full Code Here

TOP

Related Classes of org.openquark.cal.machine.ProgramResourceRepository

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.