Example #1
0
  public void addDependency(
      Facet facet, DependencyAttribute dependencyAttribute, LifeTime lifeTime) {
    Client client = getClient();
    synchronized (client) {
      if (!client.isDone()) {
        queuedMeemProxy.addDependency(facet, dependencyAttribute, lifeTime);
        return;
      }
    }

    doAddDependency(meem, facet, dependencyAttribute, lifeTime);
  }
  /**
   * Set up a dependency between a meem and a hyperspace-referenced meem.
   *
   * @param meem The dependent meem.
   * @param path The path to the meem to depend on.
   * @param target the target facet
   * @param source The source facet
   */
  protected void setDependency(Meem meem, String path, String target, String source) {

    MeemPath meemPath = MeemPath.spi.create(Space.HYPERSPACE, myHyperSpacePath + "/" + path);

    // TODO make an AddressFilter
    Filter filter = null;

    DependencyAttribute attr =
        new DependencyAttribute(
            DependencyType.STRONG, Scope.DISTRIBUTED, meemPath, target, filter, true);

    if (DEBUG) {
      logger.log(
          Level.INFO, "Adding dependency: " + meem + "." + source + " -> " + path + "." + target);
    }

    // XXX
    // DependencyHandler dependencyHandler = (DependencyHandler)
    // MeemUtility.spi.get().getTarget(meem, "dependencyHandler", DependencyHandler.class);
    // dependencyHandler.addDependency(source, attr, LifeTime.PERMANENT);

    meem.addDependency(source, attr, LifeTime.PERMANENT);
  }
Example #3
0
 private synchronized void doAddDependency(
     Meem meem, Facet facet, DependencyAttribute dependencyAttribute, LifeTime lifeTime) {
   meem.addDependency(facet, dependencyAttribute, lifeTime);
 }