コード例 #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());
 }