예제 #1
0
 public RemoteDomainProvider() {
   // equivalent to this(false) but without IOException
   super(CACHE_FILE_NAME);
   disableCache();
   scop = ScopFactory.getSCOP();
   pdp = new RemotePDPProvider();
 }
예제 #2
0
  /**
   * initialize this provider with caching enabled
   *
   * @param cache
   * @throws IOException
   */
  public RemoteDomainProvider(boolean cache) throws IOException {
    super(CACHE_FILE_NAME);

    if (!cache) {
      disableCache();
      // } else if ( serializedCache.keySet().size() < 20000){
    } else {
      // always load the representative assignments from server...
      // this makes sure we always have the latest assignments
      loadRepresentativeDomainAssignments();
    }

    scop = ScopFactory.getSCOP();
    pdp = new RemotePDPProvider(cache);
  }
예제 #3
0
  /**
   * Send a signal to the cache that the system is shutting down. Notifies underlying
   * SerializableCache instances to flush themselves...
   */
  public void notifyShutdown() {
    // System.out.println(" AtomCache got notify shutdown..");
    if (pdpprovider != null) {
      if (pdpprovider instanceof RemotePDPProvider) {
        RemotePDPProvider remotePDP = (RemotePDPProvider) pdpprovider;
        remotePDP.flushCache();
      }
    }

    // todo: use a SCOP implementation that is backed by SerializableCache
    ScopDatabase scopInstallation = ScopFactory.getSCOP();
    if (scopInstallation != null) {
      if (scopInstallation instanceof CachedRemoteScopInstallation) {
        CachedRemoteScopInstallation cacheScop = (CachedRemoteScopInstallation) scopInstallation;
        cacheScop.flushCache();
      }
    }
  }
예제 #4
0
 /**
  * Returns the representation of a {@link ScopDomain} as a BioJava {@link Structure} object.
  *
  * @param scopId a SCOP Id
  * @return a Structure object
  * @throws IOException
  * @throws StructureException
  */
 public Structure getStructureForDomain(String scopId) throws IOException, StructureException {
   return getStructureForDomain(scopId, ScopFactory.getSCOP());
 }
예제 #5
0
 /**
  * Returns the representation of a {@link ScopDomain} as a BioJava {@link Structure} object.
  *
  * @param domain a SCOP domain
  * @return a Structure object
  * @throws IOException
  * @throws StructureException
  */
 public Structure getStructureForDomain(ScopDomain domain) throws IOException, StructureException {
   return getStructureForDomain(domain, ScopFactory.getSCOP());
 }