public void setUp() throws Exception {
		log.trace("Node2::setUp()");
		context = NodeTool.createContext("/META-INF/spring/node22.xml");
		
		// Paxos Group B
		leaderB = (PaxosLeader) context.getBean("protocolBL");
		followerB = (PaxosFollower) context.getBean("protocolB2");
		followerB.addListener(new ProposalListener() {
			LockManager lock = new LockManager();
			
			@Override
			public void notify(long id, Operation operation) {
				log.debug("notified Paxos Group B");
				if(operation instanceof PaxosPrepareOperation) {
					log.debug("prepare PGB");
					// prepare
					try {
						lock.lock(operation.getId());
						participantB.acceptPrepare(((PaxosPrepareOperation) operation).transactionId);
					} catch(Exception e) {
						participantB.declinePrepare(((PaxosPrepareOperation) operation).transactionId);
					}
				}  else if(operation instanceof PaxosAbortOperation) {
					log.debug("abort PGB");
					// abort
					lock.unlock();
					participantB.abortTransaction(((PaxosAbortOperation) operation).transactionId);
				} else if(operation instanceof PaxosWriteOperation) {
					log.debug("write PGB");
					// commit
					try {
						statsStore.append(((PaxosWriteOperation) operation).getString());
					} catch (Exception e) {
						// should not happen
						log.error("could not write to file store");
					}
					lock.unlock();
					participantB.commitTransaction(((PaxosWriteOperation) operation).transactionId);
				} else if(operation instanceof PaxosReadOperation) {
					log.debug("read PGB");
					// commit
					String result;
					try {
						result = statsStore.read();
					} catch (Exception e) {
						// should not happen
						log.error("could not read file store");
						result = "[ERROR]";
					}
					lock.unlock();
					participantB.commitTransaction(((PaxosReadOperation) operation).transactionId, new ReadOperationResult(operation, result));
				} else {
					log.error("unknown operation {}", operation.getId());
				}
			}
		});
		
		// Two Phase Commit
		participantB = (TwoPhaseCommitParticipant) context.getBean("protocolTpcB");
		participantB.setExecutor(new TransactionExecutor() {
			@Override
			public void prepare(long id, Operation operation) {
				leaderB.addProposal(new PaxosPrepareOperation(operation.getId(), id));
			}
			public void commit(long id, Operation operation) {
				if(operation instanceof WriteOperation) {
					leaderB.addProposal(new PaxosWriteOperation(operation.getId(), id, ((WriteOperation) operation).getString()));
				} else if(operation instanceof ReadOperation) {
					leaderB.addProposal(new PaxosReadOperation(operation.getId(), id));
				}
			}
			@Override
			public void abort(long id, Operation operation) {
				leaderB.addProposal(new PaxosAbortOperation(operation.getId(), id));
			}
		});
		
	}