private static UidWrapper makeWrapper(ActionBean parent, AbstractRecord rec, String beanType) { UidWrapper w = new UidWrapper( parent._uidWrapper.getBrowser(), beanType, rec.type(), rec.getClass().getName(), rec.order(), false); // TODO look up the hander for rec.type() and use that to create the wrapper w.setName(parent.getName() + ",puid=" + rec.order().fileStringForm()); return w; }
public boolean activate() { if (!activated && rec != null) try { activated = rec.activate(); } catch (Exception e) { activated = false; tsLogger.logger.warn("Activate of " + rec + " failed: " + e.getMessage()); } return activated; }
@Override public String getHeuristicStatus() { Object heuristicInformation = rec.value(); HeuristicStatus hs; if (heuristicInformation != null && heuristicInformation instanceof HeuristicInformation) { HeuristicInformation hi = (HeuristicInformation) heuristicInformation; hs = HeuristicStatus.intToStatus(hi.getHeuristicType()); } else { hs = HeuristicStatus.UNKNOWN; } return hs.name(); }
public StringBuilder toString(String prefix, StringBuilder sb) { prefix += "\t"; if (parent != null && rec != null) { sb.append('\n').append(prefix).append(parent.getUid(rec)); sb.append('\n').append(prefix).append(listType.toString()); sb.append('\n').append(prefix).append(rec.type()); sb.append('\n').append(prefix).append(parent.getCreationTime()); sb.append('\n').append(prefix).append(parent.getAgeInSeconds()); } else { sb.append('\n').append(prefix).append(_uidWrapper.getName()); } return sb; }
public boolean removeFromList(RecordList rl) { if (rl != null && rl.size() > 0 && rec != null) { boolean forgotten = rec.forgetHeuristic(); boolean removeAllowed = arjPropertyManager.getObjectStoreEnvironmentBean().isIgnoreMBeanHeuristics(); if (forgotten || removeAllowed) { // remove the transaction log for the record if (rl.remove(rec)) { removed = true; return true; } } } return false; }
public void init(ActionBean parent, AbstractRecord rec, ParticipantStatus listType) { this.parent = parent; this.rec = rec; this.listType = listType; _uidWrapper.setName(parent.getName() + ",puid=" + rec.order().fileStringForm()); }
public String getType() { return rec == null ? "uninitialised" : rec.type(); }