コード例 #1
0
ファイル: MeemUnbound.java プロジェクト: ekoliving/Meemplex
  private synchronized void doAddOutboundReference(
      Meem meem, Reference reference, boolean automaticRemove) {
    if (reference.getFacetIdentifier().equals("lifeCycleClient")) {
      addLifeCycleReference(reference, automaticRemove);
    } else if (meem != null) {
      meem.addOutboundReference(reference, automaticRemove);
    } else {
      ContentClient contentClient =
          MeemSystemWedge.getContentClientFromTarget(reference.getTarget());

      contentClient.contentFailed(
          "Cannot add reference to Meem in LifeCycleState of "
              + lastTransition.getCurrentState().getCurrentState());
    }
  }
コード例 #2
0
ファイル: MeemUnbound.java プロジェクト: ekoliving/Meemplex
  private void addLifeCycleReference(Reference reference, boolean automaticRemove) {
    Facet target = reference.getTarget();
    ContentClient contentClient = MeemSystemWedge.getContentClientFromTarget(target);

    if (target instanceof LifeCycleClient) {
      if (reference.isContentRequired()) {
        LifeCycleClient lifeCycleClient = (LifeCycleClient) target;
        lifeCycleClient.lifeCycleStateChanged(lastTransition);
      }

      contentClient.contentSent();

      if (!automaticRemove) {
        getLifeCycleClientRefs()
            .put(reference, (RequestStack) RequestTracker.getRequestStack().clone());
      }
    } else {
      contentClient.contentFailed("Target must be of type: " + LifeCycleClient.class);
    }

    getClient().startResolving(); // this needs to be done
  }