Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
WalletCreator.java 1.03 KiB
package fucoin.wallet;

import akka.actor.ActorRef;
import akka.japi.Creator;
import fucoin.gui.WalletGuiControlImpl;

public class WalletCreator implements Creator<AbstractWallet> {
    private ActorRef preKnownNeighbour;
    private String walletName;
    private ActorRef remoteSuperVisorActor;
    private String preKnownNeighbourName;

    public WalletCreator(ActorRef preKnownNeighbour, String preKnownNeighbourName,
                         String walletName, ActorRef remoteSuperVisorActor) {
        this.preKnownNeighbour = preKnownNeighbour;
        this.preKnownNeighbourName = preKnownNeighbourName;
        this.walletName = walletName;
        this.remoteSuperVisorActor = remoteSuperVisorActor;

    }

    @Override
    public WalletImpl create() throws Exception {
        WalletImpl wallet = new WalletImpl(preKnownNeighbour, preKnownNeighbourName,
                walletName, remoteSuperVisorActor);

        WalletGuiControlImpl gui = new WalletGuiControlImpl(wallet);
        wallet.setGui(gui);
        return wallet;
    }
}