Introduce io.bitsquare.offer.tomp2p package

This commit is contained in:
Chris Beams 2014-11-06 15:20:05 +01:00
parent 57f2b43845
commit 467f76fd76
No known key found for this signature in database
GPG Key ID: 3D214F8F5BC5ED73
4 changed files with 46 additions and 7 deletions

View File

@ -24,6 +24,7 @@ import io.bitsquare.gui.GuiModule;
import io.bitsquare.msg.DefaultMessageModule;
import io.bitsquare.msg.MessageModule;
import io.bitsquare.offer.OfferModule;
import io.bitsquare.offer.tomp2p.TomP2POfferModule;
import io.bitsquare.persistence.Persistence;
import io.bitsquare.settings.Settings;
import io.bitsquare.trade.TradeModule;
@ -97,9 +98,7 @@ public class BitsquareModule extends AbstractBitsquareModule {
return new TradeModule(properties);
}
protected OfferModule offerModule() {
return new OfferModule(properties);
}
protected OfferModule offerModule() { return new TomP2POfferModule(properties); }
protected GuiModule guiModule() {
return new GuiModule(properties, primaryStage);

View File

@ -21,14 +21,16 @@ import io.bitsquare.AbstractBitsquareModule;
import java.util.Properties;
public class OfferModule extends AbstractBitsquareModule {
public abstract class OfferModule extends AbstractBitsquareModule {
public OfferModule(Properties properties) {
protected OfferModule(Properties properties) {
super(properties);
}
@Override
protected void configure() {
bind(OfferRepository.class).to(TomP2POfferRepository.class).asEagerSingleton();
bind(OfferRepository.class).to(offerRepository()).asEagerSingleton();
}
protected abstract Class<? extends OfferRepository> offerRepository();
}

View File

@ -0,0 +1,36 @@
/*
* This file is part of Bitsquare.
*
* Bitsquare is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or (at
* your option) any later version.
*
* Bitsquare is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
* License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
*/
package io.bitsquare.offer.tomp2p;
import io.bitsquare.AbstractBitsquareModule;
import io.bitsquare.offer.OfferModule;
import io.bitsquare.offer.OfferRepository;
import java.util.Properties;
public class TomP2POfferModule extends OfferModule {
public TomP2POfferModule(Properties properties) {
super(properties);
}
@Override
public Class<? extends OfferRepository> offerRepository() {
return TomP2POfferRepository.class;
}
}

View File

@ -15,9 +15,11 @@
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
*/
package io.bitsquare.offer;
package io.bitsquare.offer.tomp2p;
import io.bitsquare.msg.P2PNode;
import io.bitsquare.offer.Offer;
import io.bitsquare.offer.OfferRepository;
import io.bitsquare.util.task.FaultHandler;
import io.bitsquare.util.task.ResultHandler;