Examples of CacheManager


Examples of de.sciss.io.CacheManager

    final File[]      f      = createCacheFileNames();
    if( f == null ) return null;

    final AudioFile[]    audioFiles  = fullScale.getAudioFiles();
    final AudioFileDescr  afdProto  = new AudioFileDescr();
    final CacheManager    cm      = PrefCacheManager.getInstance();
    final Span[]      fileSpans  = new Span[ audioFiles.length ];
    final AudioFile[]    cacheAFs  = new AudioFile[ audioFiles.length ];
    final String      ourCode    = AbstractApplication.getApplication().getMacOSCreator();
    final int[][]      channelMaps  = createCacheChannelMaps();
    AudioStake        result    = null;
    AudioFileDescr      afd;
    AudioFileCacheInfo    info;

    afdProto.type      = AudioFileDescr.TYPE_AIFF;
    afdProto.bitsPerSample  = 32;
    afdProto.sampleFormat  = AudioFileDescr.FORMAT_FLOAT;
    afdProto.rate      = decimHelps[ 0 ].rate; // getRate();
    afdProto.appCode    = ourCode;

    try {
      for( int i = 0; i < f.length; i++ ) {
        cm.removeFile( f[ i ]); // in case it existed
// System.out.println( "openCacheForWrite doing '" + f[ i ].getAbsolutePath() + "'" );
        afd        = new AudioFileDescr( afdProto );
        afd.channels  = channelMaps[ i ].length;
        // System.out.println( "channels = " + afd.channels );
        afd.file    = f[ i ];
View Full Code Here

Examples of de.sciss.io.CacheManager

  protected File[] createCacheFileNames()
  {
    final AudioFile[] audioFiles = fullScale.getAudioFiles();
    if( (audioFiles.length == 0) || (audioFiles[0] == null) ) return null;

    final CacheManager cm = PrefCacheManager.getInstance();
    if( !cm.isActive() ) return null;

    final File[] f = new File[ audioFiles.length ];
    for( int i = 0; i < f.length; i++ ) {
      f[i] = cm.createCacheFileName( IOUtil.setFileSuffix( audioFiles[i].getFile(), "fft" ));
    }
    return f;
  }
View Full Code Here

Examples of de.sciss.io.CacheManager

    // ---- init infrastructure ----
    // warning : reihenfolge is crucial
//    oscServer      = new OSCRoot( prefs.node( OSCRoot.DEFAULT_NODE ), 0x4549 );
    osc          = new OSCRouterWrapper( oscServer, this );
    final CacheManager cache = new PrefCacheManager( prefs.node( PrefCacheManager.DEFAULT_NODE ));
    superCollider    = new SuperColliderClient();

    init();
   
    // ---- listeners ----

    quitAfterSaveListener = new ProcessingThread.Listener() {
      public void processStarted( ProcessingThread.Event e ) { /* empty */ }

      // if the saving was successfull, we will call closeAll again
      public void processStopped( ProcessingThread.Event e )
      {
        if( e.isDone() ) {
          quit();
        }
      }
    };

    try {
      superCollider.init();
    }
    catch( IOException e1 ) {
      BasicWindowHandler.showErrorDialog( null, e1, "SuperColliderClient Initialization" );
      System.exit( 1 );
      return;
    }

//    scPlugInManager    = new SCPlugInManager( this );

    // ---- component views ----

    mainFrame    = new MainFrame();
    ((BasicWindowHandler) getWindowHandler()).setDefaultBorrower( mainFrame );
    final AppWindow ctrlRoom  = new ControlRoomFrame();
    final AppWindow observer  = new ObserverPalette();

    // means no preferences found, so
    // do some more default initializations
    // and display splash screen
    if( prefsVersion == 0.0 ) {
      ctrlRoom.setVisible( true );
      observer.setVisible( true );
      if( cache.getFolder().isDirectory() ) {
        cache.setActive( true );
      }
        new WelcomeScreen( this );
    }

    if( warnings != null ) {
View Full Code Here

Examples of dotaSoundEditor.Helpers.CacheManager

    //Delete scratch.wav and scratch.mp3 if they exist. Not 100% reliable
    //Should probably do this on load too, just to be nice
    private void formWindowClosing(java.awt.event.WindowEvent evt)//GEN-FIRST:event_formWindowClosing
    {//GEN-HEADEREND:event_formWindowClosing
        deleteScratchFiles();
        CacheManager cm = CacheManager.getInstance();
        try
        {
            cm.saveCache();
        }
        catch (IOException | SecurityException | URISyntaxException | NullPointerException ex)
        {
            JOptionPane.showMessageDialog(this, "Error: Unable to save scripts cache."
                    + "\nDetails: " + ex.getMessage(), "Error saving cache", JOptionPane.ERROR_MESSAGE);
View Full Code Here

Examples of info.archinnov.achilles.internal.statement.cache.CacheManager

        daoContext.setSelectPSs(selectPSMap);
        daoContext.setDeletePSs(deletePSMap);
        daoContext.setCounterQueryMap(counterQueryMap);
        daoContext.setClusteredCounterQueryMap(clusteredCounterQueriesMap);
        daoContext.setSession(session);
        daoContext.setCacheManager(new CacheManager(configContext.getPreparedStatementLRUCacheSize()));
        daoContext.setExecutorService(configContext.getExecutorService());

        return daoContext;
    }
View Full Code Here

Examples of javax.cache.CacheManager

    @Override
    public boolean close(ClassLoader classLoader, String name) throws CachingShutdownException {
        String tenantDomain = Util.getTenantDomain();
        Map<String, CacheManager> cacheManagers = globalCacheManagerMap.get(tenantDomain);
        CacheManager cacheManager;
        if (cacheManagers != null) {
            cacheManager = cacheManagers.get(name);
            cacheManager.shutdown();
            return true;
        }
        return false;
    }
View Full Code Here

Examples of javax.cache.CacheManager

        PrivilegedCarbonContext cc = PrivilegedCarbonContext.getThreadLocalCarbonContext();
        cc.setTenantDomain("foo.com");
        cc.setTenantId(1);

        CacheManager cacheManager = Caching.getCacheManagerFactory().getCacheManager("test");
        cache = cacheManager.getCache(cacheName);
    }
View Full Code Here

Examples of javax.cache.CacheManager

            PrivilegedCarbonContext.startTenantFlow();
            PrivilegedCarbonContext cc = PrivilegedCarbonContext.getThreadLocalCarbonContext();
            cc.setTenantDomain("wso2.com");
            cc.setTenantId(1);

            CacheManager cacheManager =
                    Caching.getCacheManagerFactory().getCacheManager(cacheManagerName);
            Cache<String, Integer> cache1 = cacheManager.getCache(cacheName);
            cache1.put(key1, sampleValue);
            cache1.put(key2, sampleValue);
            cache1 = cacheManager.getCache(cacheName);
            assertEquals(sampleValue, cache1.get(key1));
            checkCacheSize(cache1, 2);
        } finally {
            PrivilegedCarbonContext.endTenantFlow();
        }

        // Tenant ibm.com
        try {
            PrivilegedCarbonContext.startTenantFlow();
            PrivilegedCarbonContext cc = PrivilegedCarbonContext.getThreadLocalCarbonContext();
            cc.setTenantDomain("ibm.com");
            cc.setTenantId(2);

            CacheManager cacheManager =
                    Caching.getCacheManagerFactory().getCacheManager(cacheManagerName);
            Cache<String, Integer> cache1 = cacheManager.getCache(cacheName);
            cache1.put(key1, sampleValue);
            cache1 = cacheManager.getCache(cacheName);
            assertEquals(sampleValue, cache1.get(key1));

            checkCacheSize(cache1, 1);
            cache1 = cacheManager.getCache(cacheName);
            cache1.remove(key1);
            cache1 = cacheManager.getCache(cacheName);
            checkCacheSize(cache1, 0);
        } finally {
            PrivilegedCarbonContext.endTenantFlow();
        }
    }
View Full Code Here

Examples of javax.cache.CacheManager

            PrivilegedCarbonContext.startTenantFlow();
            PrivilegedCarbonContext cc = PrivilegedCarbonContext.getThreadLocalCarbonContext();
            cc.setTenantDomain("apple.com");
            cc.setTenantId(1);

            CacheManager cacheManager = Caching.getCacheManager(); // Default CacheManager
            Cache<String, Integer> cache1 = cacheManager.getCache(cacheName);
            cache1.put(key1, sampleValue);
            cache1.put(key2, sampleValue);
            cache1 = cacheManager.getCache(cacheName);
            assertEquals(sampleValue, cache1.get(key1));
            checkCacheSize(cache1, 2);
        } finally {
            PrivilegedCarbonContext.endTenantFlow();
        }

        // Tenant orange.com
        try {
            PrivilegedCarbonContext.startTenantFlow();
            PrivilegedCarbonContext cc = PrivilegedCarbonContext.getThreadLocalCarbonContext();
            cc.setTenantDomain("orange.com");
            cc.setTenantId(2);

            CacheManager cacheManager = Caching.getCacheManager(); // Default CacheManager
            Cache<String, Integer> cache1 = cacheManager.getCache(cacheName);
            cache1.put(key1, sampleValue);
            cache1 = cacheManager.getCache(cacheName);
            assertEquals(sampleValue, cache1.get(key1));

            checkCacheSize(cache1, 1);
            cache1 = cacheManager.getCache(cacheName);
            cache1.remove(key1);
            cache1 = cacheManager.getCache(cacheName);
            checkCacheSize(cache1, 0);
        } finally {
            PrivilegedCarbonContext.endTenantFlow();
        }
    }
View Full Code Here

Examples of javax.cache.CacheManager

            PrivilegedCarbonContext.startTenantFlow();
            PrivilegedCarbonContext cc = PrivilegedCarbonContext.getThreadLocalCarbonContext();
            cc.setTenantDomain("wso2.org");
            cc.setTenantId(4);

            CacheManager cacheManager = Caching.getCacheManager(); // Default CacheManager
            Cache<String, Integer> cache = cacheManager.<String, Integer>createCacheBuilder(cacheName).
                    setExpiry(CacheConfiguration.ExpiryType.MODIFIED, new CacheConfiguration.Duration(TimeUnit.SECONDS, 10)).
                    setStoreByValue(false).build();

            cache.put(key, value);
            assertEquals(cache.get(key).intValue(), value);
        } finally {
            PrivilegedCarbonContext.endTenantFlow();
        }

        // Tenant afkham.org
        try {
            PrivilegedCarbonContext.startTenantFlow();
            PrivilegedCarbonContext cc = PrivilegedCarbonContext.getThreadLocalCarbonContext();
            cc.setTenantDomain("afkham.org");
            cc.setTenantId(5);

            CacheManager cacheManager = Caching.getCacheManager(); // Default CacheManager
            Cache<String, Integer> cache = cacheManager.<String, Integer>createCacheBuilder(cacheName).
                    setExpiry(CacheConfiguration.ExpiryType.MODIFIED, new CacheConfiguration.Duration(TimeUnit.SECONDS, 10)).
                    setStoreByValue(false).build();
            cache.put(key, value);
            assertEquals(cache.get(key).intValue(), value);
        } finally {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.