Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
WalletCreator.java 694 B
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;

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

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

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