Skip to content
Snippets Groups Projects
WalletCreator.java 921 B
Newer Older
Michael Kmoch's avatar
Michael Kmoch committed
package fucoin;

Michael Kmoch's avatar
Michael Kmoch committed
import akka.actor.ActorRef;
import akka.japi.Creator;
Michael Kmoch's avatar
Michael Kmoch committed
import fucoin.gui.IWalletGuiControle;
import fucoin.gui.WalletGui;

Michael Kmoch's avatar
Michael Kmoch committed
public class WalletCreator implements Creator<Wallet> {
Michael Kmoch's avatar
Michael Kmoch committed
	private ActorRef preknownNeighbour;
	private String walletName;
	private ActorRef remoteSuperVisorActor;
	private String preknownNeighbourName;
Michael Kmoch's avatar
Michael Kmoch committed
	public WalletCreator(ActorRef preknownNeighbour, String preknownNeighbourName, String walletName, ActorRef remoteSuperVisorActor) {
Michael Kmoch's avatar
Michael Kmoch committed
		this.preknownNeighbour=preknownNeighbour;
Michael Kmoch's avatar
Michael Kmoch committed
		this.preknownNeighbourName=preknownNeighbourName;
		this.walletName=walletName;
		this.remoteSuperVisorActor=remoteSuperVisorActor;
		
Michael Kmoch's avatar
Michael Kmoch committed
	}

	@Override
	public Wallet create() throws Exception {
Michael Kmoch's avatar
Michael Kmoch committed
		Wallet wallet = new Wallet(preknownNeighbour,preknownNeighbourName, walletName,remoteSuperVisorActor);
Michael Kmoch's avatar
Michael Kmoch committed
		IWalletGuiControle gui = new WalletGui(wallet);
		wallet.setGui(gui);
Michael Kmoch's avatar
Michael Kmoch committed
		return wallet;
	}