public TransactionMetadata unwrap(ModelNode node) { if (node == null) return null; TransactionMetadata transaction = new TransactionMetadata(); transaction.setAssociatedSession(node.get(ASSOCIATED_SESSION).asString()); transaction.setCreatedTime(node.get(CREATED_TIME).asLong()); transaction.setScope(node.get(SCOPE).asString()); transaction.setId(node.get(ID).asString()); unwrapDomain(transaction, node); return transaction; }
public ModelNode wrap(TransactionMetadata object, ModelNode transaction) { if (object == null) return null; transaction.get(ASSOCIATED_SESSION).set(object.getAssociatedSession()); transaction.get(CREATED_TIME).set(object.getCreatedTime()); transaction.get(SCOPE).set(object.getScope()); transaction.get(ID).set(object.getId()); wrapDomain(object, transaction); return transaction; }
public TransactionMetadata unwrap(ModelNode node) { if (node == null) return null; TransactionMetadata transaction = new TransactionMetadata(); transaction.setAssociatedSession(node.get(ASSOCIATED_SESSION).asString()); transaction.setCreatedTime(node.get(CREATED_TIME).asLong()); transaction.setScope(node.get(SCOPE).asString()); transaction.setId(node.get(ID).asString()); unwrapDomain(transaction, node); return transaction; }
public ModelNode wrap(TransactionMetadata object, ModelNode transaction) { if (object == null) return null; transaction.get(ASSOCIATED_SESSION).set(object.getAssociatedSession()); transaction.get(CREATED_TIME).set(object.getCreatedTime()); transaction.get(SCOPE).set(object.getScope()); transaction.get(ID).set(object.getId()); wrapDomain(object, transaction); return transaction; }
@Override public Collection<TransactionMetadata> getTransactions() { Set<TransactionContext> txnSet = Collections.newSetFromMap(new IdentityHashMap<TransactionContext, Boolean>()); synchronized (this.transactions) { txnSet.addAll(this.transactions.threadToTransactionContext.values()); txnSet.addAll(this.transactions.xidToTransactionContext.values()); } Collection<TransactionMetadata> result = new ArrayList<TransactionMetadata>(txnSet.size()); for (TransactionContext transactionContext : txnSet) { if (transactionContext.getTransactionType() == Scope.NONE) { continue; } TransactionMetadata txnImpl = new TransactionMetadata(); txnImpl.setAssociatedSession(transactionContext.getThreadId()); txnImpl.setCreatedTime(transactionContext.getCreationTime()); txnImpl.setScope(transactionContext.getTransactionType().toString()); txnImpl.setId(transactionContext.getTransactionId()); result.add(txnImpl); } return result; }
@Override public Collection<TransactionMetadata> getTransactions() { Set<TransactionContext> txnSet = Collections.newSetFromMap(new IdentityHashMap<TransactionContext, Boolean>()); synchronized (this.transactions) { txnSet.addAll(this.transactions.threadToTransactionContext.values()); txnSet.addAll(this.transactions.xidToTransactionContext.values()); } Collection<TransactionMetadata> result = new ArrayList<TransactionMetadata>(txnSet.size()); for (TransactionContext transactionContext : txnSet) { if (transactionContext.getTransactionType() == Scope.NONE) { continue; } TransactionMetadata txnImpl = new TransactionMetadata(); txnImpl.setAssociatedSession(transactionContext.getThreadId()); txnImpl.setCreatedTime(transactionContext.getCreationTime()); txnImpl.setScope(transactionContext.getTransactionType().toString()); txnImpl.setId(transactionContext.getTransactionId()); result.add(txnImpl); } return result; }
@Override public Collection<TransactionMetadata> getTransactions() { Set<TransactionContext> txnSet = Collections.newSetFromMap(new IdentityHashMap<TransactionContext, Boolean>()); synchronized (this.transactions) { txnSet.addAll(this.transactions.threadToTransactionContext.values()); txnSet.addAll(this.transactions.xidToTransactionContext.values()); } Collection<TransactionMetadata> result = new ArrayList<TransactionMetadata>(txnSet.size()); for (TransactionContext transactionContext : txnSet) { if (transactionContext.getTransactionType() == Scope.NONE) { continue; } TransactionMetadata txnImpl = new TransactionMetadata(); txnImpl.setAssociatedSession(transactionContext.getThreadId()); txnImpl.setCreatedTime(transactionContext.getCreationTime()); txnImpl.setScope(transactionContext.getTransactionType().toString()); txnImpl.setId(transactionContext.getTransactionId()); result.add(txnImpl); } return result; }