Ejemplo n.º 1
0
  @Override
  public ISubscriptionState onMessageDbFound(AbstractMessageDataBase msgDB) {
    try {
      DataType requestedType = getMemType();
      if (requestedType == null && getSubscription().getRequestedDataType() != null) {
        instance =
            msgDB.acquireInstance(
                msgClassName, getMode(), getSubscription().getRequestedDataType());
      } else {
        instance = msgDB.acquireInstance(msgClassName, getMode(), requestedType);
      }

      this.type = instance.getType();
      getSubscription().notifyResolved();
      return new InactiveState(instance, msgDB, this);
    } catch (Exception e) {
      // Yes we do need to log this
      OseeLog.log(
          UnresolvedState.class,
          Level.SEVERE,
          "problems acquring instance for " + getMsgClassName());
      getSubscription().notifyInvalidated();
      return this;
    }
  }
Ejemplo n.º 2
0
 @Override
 public Message getMessage() {
   return instance != null ? instance.getMessage() : null;
 }