当前位置: 首页>>代码示例>>Java>>正文


Java ScribeMultiClient类代码示例

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


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

示例1: before

import rice.p2p.scribe.ScribeMultiClient; //导入依赖的package包/类
@Before
public void before() throws Exception {
    scribeClient = mock(ScribeMultiClient.class);
    topic = mock(Topic.class);
    id = mock(Id.class);
    topicId = mock(Id.class);
    endpoint = mock(Endpoint.class);
    scribeContent = mock(KoalaScribeContent.class);
    applicationContext = mock(ApplicationContext.class);
    wrappedScribeContentMessage = new WrappedScribeContentMessage(mock(NodeHandle.class), topic, WrappedScribeContentMessageType.ANYCAST, EntityMethod.UPDATE, "json", "transaction-id");

    koalaIdFactory = mock(KoalaIdFactory.class);
    when(koalaIdFactory.buildIdFromToString(TOPIC_ID)).thenReturn(topicId);

    scribe = spy(new KoalaScribeImpl(setupPastryNode(), applicationContext));
    scribe.setKoalaIdFactory(koalaIdFactory);

    messageDeserializer = scribe.getEndpoint().getDeserializer();
}
 
开发者ID:barnyard,项目名称:pi,代码行数:20,代码来源:KoalaScribeImplTest.java

示例2: testOnApplicationStarting

import rice.p2p.scribe.ScribeMultiClient; //导入依赖的package包/类
@Test
public void testOnApplicationStarting() {
    // setup
    setupTopics();
    Topic topic = mock(Topic.class);
    when(aScribe.subscribeToTopic(isA(String.class), isA(ScribeMultiClient.class))).thenReturn(topic);

    when(koalaIdUtils.isIdClosestToMe(eq(nodeIdFull), eq(leafNodeHandles), isA(Id.class), eq(NodeScope.AVAILABILITY_ZONE))).thenReturn(false).thenReturn(true);

    // act
    volumeManagerApplication.onApplicationStarting();

    // assert
    assertTrue(this.volumeManagerApplication.getSubscribedTopics().contains(createVolumeTopic));
    assertTrue(this.volumeManagerApplication.getSubscribedTopics().contains(deleteVolumeTopic));
    assertTrue(this.volumeManagerApplication.getSubscribedTopics().contains(detachVolumeTopic));
    assertTrue(this.volumeManagerApplication.getSubscribedTopics().contains(attachVolumeTopic));
    assertTrue(this.volumeManagerApplication.getSubscribedTopics().contains(createSnapshotTopic));
    assertTrue(this.volumeManagerApplication.getSubscribedTopics().contains(deleteSnapshotTopic));

    verify(volumeManagerQueueManager).createVolumeApplicationWatchers(nodeIdFull);
}
 
开发者ID:barnyard,项目名称:pi,代码行数:23,代码来源:VolumeManagerApplicationTest.java

示例3: subscribeToTopic

import rice.p2p.scribe.ScribeMultiClient; //导入依赖的package包/类
public Topic subscribeToTopic(String topicName, ScribeMultiClient scribeClient) {
    LOG.debug(String.format("subscribeToTopic(%s, %s)", topicName, scribeClient));

    Topic topic = createTopic(topicName);
    subscribe(topic, scribeClient);
    return topic;
}
 
开发者ID:barnyard,项目名称:pi,代码行数:8,代码来源:KoalaScribeImpl.java

示例4: setupTopics

import rice.p2p.scribe.ScribeMultiClient; //导入依赖的package包/类
private void setupTopics() {
    createVolumeTopic = new Topic(koalaIdFactory.buildId(koalaIdFactory.buildPId(PiTopics.CREATE_VOLUME.getPiLocation()).forLocalScope(PiTopics.CREATE_VOLUME.getNodeScope())));
    deleteVolumeTopic = new Topic(koalaIdFactory.buildId(koalaIdFactory.buildPId(PiTopics.DELETE_VOLUME.getPiLocation()).forLocalScope(PiTopics.DELETE_VOLUME.getNodeScope())));
    attachVolumeTopic = new Topic(koalaIdFactory.buildId(koalaIdFactory.buildPId(PiTopics.ATTACH_VOLUME.getPiLocation()).forLocalScope(PiTopics.ATTACH_VOLUME.getNodeScope())));
    detachVolumeTopic = new Topic(koalaIdFactory.buildId(koalaIdFactory.buildPId(PiTopics.DETACH_VOLUME.getPiLocation()).forLocalScope(PiTopics.DETACH_VOLUME.getNodeScope())));
    createSnapshotTopic = new Topic(koalaIdFactory.buildId(koalaIdFactory.buildPId(PiTopics.CREATE_SNAPSHOT.getPiLocation()).forLocalScope(PiTopics.CREATE_SNAPSHOT.getNodeScope())));
    deleteSnapshotTopic = new Topic(koalaIdFactory.buildId(koalaIdFactory.buildPId(PiTopics.DELETE_SNAPSHOT.getPiLocation()).forLocalScope(PiTopics.CREATE_SNAPSHOT.getNodeScope())));

    when(aScribe.subscribeToTopic(eq(PiTopics.CREATE_VOLUME.getUrl()), isA(ScribeMultiClient.class))).thenReturn(createVolumeTopic);
    when(aScribe.subscribeToTopic(eq(PiTopics.DELETE_VOLUME.getUrl()), isA(ScribeMultiClient.class))).thenReturn(deleteVolumeTopic);
    when(aScribe.subscribeToTopic(eq(PiTopics.ATTACH_VOLUME.getUrl()), isA(ScribeMultiClient.class))).thenReturn(attachVolumeTopic);
    when(aScribe.subscribeToTopic(eq(PiTopics.DETACH_VOLUME.getUrl()), isA(ScribeMultiClient.class))).thenReturn(detachVolumeTopic);
    when(aScribe.subscribeToTopic(eq(PiTopics.CREATE_SNAPSHOT.getUrl()), isA(ScribeMultiClient.class))).thenReturn(createSnapshotTopic);
    when(aScribe.subscribeToTopic(eq(PiTopics.DELETE_SNAPSHOT.getUrl()), isA(ScribeMultiClient.class))).thenReturn(deleteSnapshotTopic);
}
 
开发者ID:barnyard,项目名称:pi,代码行数:16,代码来源:VolumeManagerApplicationTest.java

示例5: before

import rice.p2p.scribe.ScribeMultiClient; //导入依赖的package包/类
@Before
public void before() {
    KoalaIdFactory koalaIdFactory = new KoalaIdFactory(99, 99);
    koalaIdFactory.setKoalaPiEntityFactory(new KoalaPiEntityFactory());
    imageManager.setKoalaIdFactory(koalaIdFactory);
    imageManager.setScribe(koalaScribeImpl);

    when(koalaScribeImpl.subscribeToTopic(anyString(), any(ScribeMultiClient.class))).thenReturn(topic);

    imageManager.setActivationCheckPeriodSecs(123);
    imageManager.setStartTimeout(456);

    when(koalaIdUtils.isIdClosestToMe(eq(nodeIdFull), eq(leafNodeHandles), isA(Id.class), eq(NodeScope.AVAILABILITY_ZONE))).thenReturn(false).thenReturn(true);
}
 
开发者ID:barnyard,项目名称:pi,代码行数:15,代码来源:ImageManagerApplicationTest.java

示例6: subscribe

import rice.p2p.scribe.ScribeMultiClient; //导入依赖的package包/类
@Override
public void subscribe(PId topicId, ScribeMultiClient listener) {
    subscribeInvoked = true;
}
 
开发者ID:barnyard,项目名称:pi,代码行数:5,代码来源:InstanceManagerApplicationTest.java

示例7: unsubscribe

import rice.p2p.scribe.ScribeMultiClient; //导入依赖的package包/类
@Override
public void unsubscribe(PId topicId, ScribeMultiClient listener) {
    unsubscribeInvoked = true;
}
 
开发者ID:barnyard,项目名称:pi,代码行数:5,代码来源:InstanceManagerApplicationTest.java

示例8: subscribe

import rice.p2p.scribe.ScribeMultiClient; //导入依赖的package包/类
/**
 * To subscribe to a topic use instead {@link KoalaPastryScribeApplicationBase#subscribe(PId)}
 */
@Deprecated
public void subscribe(PiLocation atopic, ScribeMultiClient listener) {
    PId topicPId = getKoalaIdFactory().buildPId(atopic.getUrl()).forLocalScope(atopic.getNodeScope());
    this.subscribe(topicPId, listener);
}
 
开发者ID:barnyard,项目名称:pi,代码行数:9,代码来源:KoalaPastryScribeApplicationBase.java

示例9: unsubscribe

import rice.p2p.scribe.ScribeMultiClient; //导入依赖的package包/类
/**
 * To unsubscribe to a topic use instead {@link KoalaPastryScribeApplicationBase#unsubscribe(PId)}
 */
@Deprecated
public void unsubscribe(PiLocation atopic, ScribeMultiClient listener) {
    PId topicPId = getKoalaIdFactory().buildPId(atopic.getUrl()).forLocalScope(atopic.getNodeScope());
    this.unsubscribe(topicPId, listener);
}
 
开发者ID:barnyard,项目名称:pi,代码行数:9,代码来源:KoalaPastryScribeApplicationBase.java

示例10: subscribe

import rice.p2p.scribe.ScribeMultiClient; //导入依赖的package包/类
@Deprecated
void subscribe(PiLocation atopic, ScribeMultiClient listener);
 
开发者ID:barnyard,项目名称:pi,代码行数:3,代码来源:KoalaPastryScribeApplication.java

示例11: unsubscribe

import rice.p2p.scribe.ScribeMultiClient; //导入依赖的package包/类
@Deprecated
void unsubscribe(PiLocation atopic, ScribeMultiClient listener);
 
开发者ID:barnyard,项目名称:pi,代码行数:3,代码来源:KoalaPastryScribeApplication.java

示例12: shouldHandlSuccess

import rice.p2p.scribe.ScribeMultiClient; //导入依赖的package包/类
@Test
public void shouldHandlSuccess() {
    superNodeApplication.subscribe(mock(PId.class), mock(ScribeMultiClient.class));
}
 
开发者ID:barnyard,项目名称:pi,代码行数:5,代码来源:SuperNodeApplicationBaseTest.java

示例13: subscribe

import rice.p2p.scribe.ScribeMultiClient; //导入依赖的package包/类
public void subscribe(Topic topic, ScribeMultiClient client, RawScribeContent content, NodeHandle hint); 
开发者ID:barnyard,项目名称:pi,代码行数:2,代码来源:RawScribe.java

示例14: subscribe

import rice.p2p.scribe.ScribeMultiClient; //导入依赖的package包/类
public void subscribe(Topic topic, ScribeMultiClient client, ScribeContent content, NodeHandle hint); 
开发者ID:barnyard,项目名称:pi,代码行数:2,代码来源:JavaScribe.java

示例15: subscribe

import rice.p2p.scribe.ScribeMultiClient; //导入依赖的package包/类
public void subscribe(Collection<Topic> nodeWasParent, ScribeMultiClient client, RawScribeContent content, NodeHandle hint); 
开发者ID:barnyard,项目名称:pi,代码行数:2,代码来源:MaintainableScribe.java


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