• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Positive类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中se.sics.kompics.Positive的典型用法代码示例。如果您正苦于以下问题:Java Positive类的具体用法?Java Positive怎么用?Java Positive使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Positive类属于se.sics.kompics包,在下文中一共展示了Positive类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: ThreePhaseGossip

import se.sics.kompics.Positive; //导入依赖的package包/类
public ThreePhaseGossip(RetryComponentDelegator delegator, Self self, Positive<VodNetwork> network, Positive<Timer> timer, VideoNeighbours neighbours, Map<Integer, EncodedSubPiece> subPieces) {
    // Algorithm specific
    // fanout f = ln(system size) + constant
    f = ((int) Math.log(500)) + 2;
    subPiecesToPropose = new HashSet<Integer>();
    subPiecesDelivered = new HashSet<EncodedSubPiece>();
    requestedSubPieces = new HashSet<Integer>();
    // References
    this.delegator = delegator;
    this.self = self;
    this.network = network;
    this.timer = timer;
    this.neighbours = neighbours;
    this.subPieces = subPieces;
    // Configuration
    ulBwCapacity = LSConfig.VIDEO_UPLOAD_CAPACITY; // in bytes
    dlBwCapacity = Integer.MAX_VALUE;
    uploaded = 0;
    downloaded = 0;
}
 
开发者ID:jimdowling,项目名称:gvod,代码行数:21,代码来源:ThreePhaseGossip.java


示例2: VideoNeighbours

import se.sics.kompics.Positive; //导入依赖的package包/类
public VideoNeighbours(RetryComponentDelegator delegator, Self self, Positive<VodNetwork> network, boolean source) {
    // Video references
    this.delegator = delegator;
    this.self = self;
    this.network = network;
    // Collections
    croupierSample = new ArrayList<VodDescriptor>();
    interAsSample = new ArrayList<VodDescriptor>();
    closeNeighbours = new ArrayList<VodAddress>();
    randomNeighbours = new ArrayList<VodAddress>();
    // Tools
    random = new Random(LSConfig.getSeed());
    comparator = new VideoComparator(self);
    // Inter-AS balancing -- if set to true a connection request
    // to a random peer is sent the next round
    incRandomIn = false;
    // Connection configuration and statistics
    maxOutConnectionsClose = LSConfig.VIDEO_MAX_OUT_CLOSE;
    maxOutConnectionsRandom = source ? LSConfig.VIDEO_SOURCE_MAX_OUT_RANDOM : LSConfig.VIDEO_MAX_OUT_RANDOM;
    ingoingClose = 0;
    ingoingRandom = 0;
    this.source = source;
    // Connection timeouts, only necessary for outgoing
    outgoingCloseTimeouts = new HashMap<VodAddress, Long>();
    outgoingRandomTimeouts = new HashMap<VodAddress, Long>();
}
 
开发者ID:jimdowling,项目名称:gvod,代码行数:27,代码来源:VideoNeighbours.java


示例3: RespawnerComponent

import se.sics.kompics.Positive; //导入依赖的package包/类
public RespawnerComponent(RespawnerInit init) {
    final Positive<Network> net = requires(Network.class);

    self = init.self;

    Handler<Start> startHandler = new Handler<Start>() {
        @Override
        public void handle(Start event) {
            System.out.println("Started (" + netAddr + ").");
            byte id = self.getId()[0];
            byte newId = (byte) (id + 1);
            if (newId < NUM_SPAWNS) {
                trigger(new StartVNode(self, netAddr, new byte[]{newId}, schema), net);
                TestUtil.submit(SPAWN_SENT);
            }
            trigger(new StopVNode(self, self), net);
        }
    };
    subscribe(startHandler, control);
}
 
开发者ID:CaracalDB,项目名称:CaracalDB,代码行数:21,代码来源:LauncherTest.java


示例4: report

import se.sics.kompics.Positive; //导入依赖的package包/类
/**
 *
 * @param component
 * @param network
 * @param selfAddress the client's address
 * @param portUsed by the client that is reporting the issue
 * @param target destination address for the issue being reported
 * @param success was the issue a problem or a success
 * @param timeTaken how long did the issue take?
 * @param msg textual description of the report
 */
public static void report(RetryComponentDelegator component, Positive<VodNetwork> network,
        VodAddress selfAddress, int portUsed, VodAddress target, boolean success, long timeTaken,
        String msg) {
    if (portUsed < 0 || portUsed > 65535) {
        throw new IllegalArgumentException("portUsed must be in the range 0..65535");
    }
    if (timeTaken < 0) {
        throw new IllegalArgumentException("timeTaken must be greater than 0.");
    }
    if (msg.length() > 65535) {
        throw new IllegalArgumentException("msg should be less than 65535 chars.");
    }
    NatReportMsg.NatReport nr = new NatReportMsg.NatReport(portUsed, target, success,
            timeTaken, msg);
    List<NatReportMsg.NatReport> nrs = new ArrayList<NatReportMsg.NatReport>();
    nrs.add(nr);
    Address bAddr = VodConfig.getBootstrapServer();
    if (bAddr != null) {
        VodAddress dest = ToVodAddr.bootstrap(bAddr);
        NatReportMsg evt = new NatReportMsg(selfAddress, dest, nrs);
        component.doTrigger(evt, network);
    }
}
 
开发者ID:jimdowling,项目名称:nat-traverser,代码行数:35,代码来源:NatReporter.java


示例5: ExtPort

import se.sics.kompics.Positive; //导入依赖的package包/类
public ExtPort(Positive<Timer> timerPort, Positive<Network> networkPort, Positive<CroupierPort> croupierPort,
  Negative<OverlayViewUpdatePort> viewUpdatePort) {
  this.networkPort = networkPort;
  this.timerPort = timerPort;
  this.croupierPort = croupierPort;
  this.viewUpdatePort = viewUpdatePort;
}
 
开发者ID:Decentrify,项目名称:id2210-vt17,代码行数:8,代码来源:AppMngrComp.java


示例6: ComponentBodyAdapter

import se.sics.kompics.Positive; //导入依赖的package包/类
ComponentBodyAdapter(ResolutionContext context, JDefinedClass clazz) {
    super(context, clazz);
    initBlock = clazz.instanceInit();
    handlerType = (JClass) context.unit._ref(Handler.class);
    posPortType = (JClass) context.unit._ref(Positive.class);
    negPortType = (JClass) context.unit._ref(Negative.class);
    componentType = (JClass) context.unit._ref(Component.class);
    initType = (JClass) context.unit._ref(Init.class);
}
 
开发者ID:kompics,项目名称:kola,代码行数:10,代码来源:ComponentBodyAdapter.java


示例7: VideoGossip

import se.sics.kompics.Positive; //导入依赖的package包/类
public VideoGossip(RetryComponentDelegator delegator, Self self, Positive<VodNetwork> network, Positive<Timer> timer, VideoNeighbours neighbours, Map<Integer, EncodedSubPiece> subPieceBuffer, Set<TimeoutId> timeoutIds, boolean source) {
    // Algorithm specific
    // fanout f = ln(system size) + constant
    //f = ((int) Math.log(500)) + 2;
    subPiecesToPropose = new HashSet<Integer>();
    requestedSubPieces = new HashSet<Integer>();
    // References
    this.delegator = delegator;
    this.self = self;
    this.network = network;
    this.timer = timer;
    this.neighbours = neighbours;
    this.subPiecesDelivered = subPieceBuffer;
    // Retransmission
    currentRequests = new HashMap<Integer, Integer>();
    piecesProviders = new HashMap<Integer, BlockingQueue<VodAddress>>();
    this.timeoutIds = timeoutIds;
    // Configuration
    if (source) {
        ulBwCapacity = LSConfig.VIDEO_SOURCE_UPLOAD_CAPACITY;
        f = 5;
    } else {
        ulBwCapacity = LSConfig.VIDEO_UPLOAD_CAPACITY; // in bytes
        f = 8;
    }
    dlBwCapacity = Integer.MAX_VALUE;
    uploaded = 0;
    downloaded = 0;
    highUploadWarning = false;
    this.source = source;
    random = new Random(LSConfig.getSeed());
}
 
开发者ID:jimdowling,项目名称:gvod,代码行数:33,代码来源:VideoGossip.java


示例8: SenderComponent

import se.sics.kompics.Positive; //导入依赖的package包/类
public SenderComponent(SenderInit init) {
    final Positive<Network> net = requires(Network.class);

    self = init.self;

    Handler<Start> startHandler = new Handler<Start>() {
        @Override
        public void handle(Start event) {
            System.out.println("Started (" + self + ").");
            trigger(new TestMsg(self, self), net);
            TestUtil.submit(MSG_SENT);
        }
    };
    subscribe(startHandler, control);
}
 
开发者ID:CaracalDB,项目名称:CaracalDB,代码行数:16,代码来源:LauncherTest.java


示例9: DataNetwork

import se.sics.kompics.Positive; //导入依赖的package包/类
public DataNetwork(Init init) {
    Component dataInterceptorC = create(DataStreamInterceptor.class, Init.NONE);
    Component networkC = init.hook.setupNetwork(proxy);
    init.hook.connectTimer(proxy, dataInterceptorC);
    Positive<Network> nettyPort = networkC.getPositive(Network.class);
    Negative<Network> interceptorPortReq = dataInterceptorC.getNegative(Network.class);
    Positive<Network> interceptorPortProv = dataInterceptorC.getPositive(Network.class);
    connect(nettyPort, interceptorPortReq, Channel.TWO_WAY);
    connect(interceptorPortProv, net, new DataSelector(), Channel.ONE_WAY_POS);
    connect(interceptorPortProv, net, new DataNotifySelector(), Channel.ONE_WAY_POS);
    connect(nettyPort, net, new NotDataSelector(), Channel.ONE_WAY_POS);
    connect(nettyPort, net, new NotDataNotifySelector(), Channel.ONE_WAY_POS);
    connect(nettyPort, net, Channel.ONE_WAY_NEG);
}
 
开发者ID:kompics,项目名称:kompics,代码行数:15,代码来源:DataNetwork.java


示例10: connect

import se.sics.kompics.Positive; //导入依赖的package包/类
public static VirtualNetworkChannel connect(Positive<Network> sourcePort, Negative<Network> deadLetterBox) {
    VirtualNetworkChannel vnc = new VirtualNetworkChannel(sourcePort, deadLetterBox);
    sourcePort.addChannel(vnc);
    deadLetterBox.addChannel(vnc);

    return vnc;
}
 
开发者ID:kompics,项目名称:kompics,代码行数:8,代码来源:VirtualNetworkChannel.java


示例11: ThreePhaseGossipRetransmission

import se.sics.kompics.Positive; //导入依赖的package包/类
public ThreePhaseGossipRetransmission(RetryComponentDelegator delegator, Self self, Positive<VodNetwork> network, Positive<Timer> timer, VideoNeighbours neighbours, Map<Integer, EncodedSubPiece> subPieceBuffer) {
    super(delegator, self, network, timer, neighbours, subPieceBuffer);
    currentRequests = new HashMap<Integer, Integer>();
}
 
开发者ID:jimdowling,项目名称:gvod,代码行数:5,代码来源:ThreePhaseGossipRetransmission.java


示例12: setTimer

import se.sics.kompics.Positive; //导入依赖的package包/类
void setTimer(Positive<Timer> timer) {
    this.timer = timer;
}
 
开发者ID:CaracalDB,项目名称:CaracalDB,代码行数:4,代码来源:ClientSharedComponents.java


示例13: getTimer

import se.sics.kompics.Positive; //导入依赖的package包/类
public Positive<Timer> getTimer() {
    return timer;
}
 
开发者ID:CaracalDB,项目名称:CaracalDB,代码行数:4,代码来源:ClientSharedComponents.java


示例14: setFailureDetector

import se.sics.kompics.Positive; //导入依赖的package包/类
void setFailureDetector(Positive<EventualFailureDetector> fd) {
    this.fd = fd;
}
 
开发者ID:CaracalDB,项目名称:CaracalDB,代码行数:4,代码来源:VirtualSharedComponents.java


示例15: setLookup

import se.sics.kompics.Positive; //导入依赖的package包/类
public void setLookup(Positive<LookupService> lookup) {
    this.lookup = lookup;
}
 
开发者ID:CaracalDB,项目名称:CaracalDB,代码行数:4,代码来源:VirtualSharedComponents.java


示例16: getLookup

import se.sics.kompics.Positive; //导入依赖的package包/类
public Positive<LookupService> getLookup() {
    return lookup;
}
 
开发者ID:CaracalDB,项目名称:CaracalDB,代码行数:4,代码来源:VirtualSharedComponents.java


示例17: setStore

import se.sics.kompics.Positive; //导入依赖的package包/类
public void setStore(Positive<Store> store) {
    this.store = store;
}
 
开发者ID:CaracalDB,项目名称:CaracalDB,代码行数:4,代码来源:VirtualSharedComponents.java


示例18: getStore

import se.sics.kompics.Positive; //导入依赖的package包/类
public Positive<Store> getStore() {
    return store;
}
 
开发者ID:CaracalDB,项目名称:CaracalDB,代码行数:4,代码来源:VirtualSharedComponents.java


示例19: getMaintenance

import se.sics.kompics.Positive; //导入依赖的package包/类
/**
 * @return the maintenance
 */
public Positive<MaintenanceService> getMaintenance() {
    return maintenance;
}
 
开发者ID:CaracalDB,项目名称:CaracalDB,代码行数:7,代码来源:VirtualSharedComponents.java


示例20: setMaintenance

import se.sics.kompics.Positive; //导入依赖的package包/类
/**
 * @param maintenance the maintenance to set
 */
public void setMaintenance(Positive<MaintenanceService> maintenance) {
    this.maintenance = maintenance;
}
 
开发者ID:CaracalDB,项目名称:CaracalDB,代码行数:7,代码来源:VirtualSharedComponents.java



注:本文中的se.sics.kompics.Positive类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java FieldInfosFormat类代码示例发布时间:2022-05-22
下一篇:
Java ColourSpace类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap