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


Java AxisConfiguration.setClusteringAgent方法代码示例

本文整理汇总了Java中org.apache.axis2.engine.AxisConfiguration.setClusteringAgent方法的典型用法代码示例。如果您正苦于以下问题:Java AxisConfiguration.setClusteringAgent方法的具体用法?Java AxisConfiguration.setClusteringAgent怎么用?Java AxisConfiguration.setClusteringAgent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.axis2.engine.AxisConfiguration的用法示例。


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

示例1: testMemberContextOperations

import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
public final void testMemberContextOperations() throws Exception {
    AxisConfiguration axisConfiguration = new AxisConfiguration();
    axisConfiguration.setClusteringAgent(null);

    ServiceReferenceHolder.getInstance().setDistributedObjectProvider(new HazelcastDistributedObjectProvider());
    ServiceReferenceHolder.getInstance().setAxisConfiguration(axisConfiguration);

    CloudControllerContext.unitTest = true;
    CloudControllerContext cloudControllerContext = CloudControllerContext.getInstance();

    Thread t1 = new Thread(new MemberAdder(cloudControllerContext));
    t1.start();
    t1.join();
    assertEquals(2, cloudControllerContext.getMemberContextsOfClusterId("cluster-1").size());

    Thread t2 = new Thread(new MemberRemover(cloudControllerContext));
    t2.start();
    t2.join();
    assertEquals(1, cloudControllerContext.getMemberContextsOfClusterId("cluster-1").size());
}
 
开发者ID:apache,项目名称:stratos,代码行数:21,代码来源:CloudControllerContextTest.java

示例2: testUpdateKubCluster

import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
public void testUpdateKubCluster() throws Exception {	

		KubernetesMaster km1 = new KubernetesMaster();
		km1.setPrivateIPAddress(MASTER_IP_1);
				
		KubernetesCluster cluster = new KubernetesCluster();
		cluster.setClusterId(CLUSTER_ID);
		cluster.setKubernetesMaster(km1);		
		
		AxisConfiguration axisConfiguration = new AxisConfiguration();
        axisConfiguration.setClusteringAgent(null);

        ServiceReferenceHolder.getInstance().setDistributedObjectProvider(new HazelcastDistributedObjectProvider());
        ServiceReferenceHolder.getInstance().setAxisConfiguration(axisConfiguration);

        CloudControllerContext.unitTest = true;
        CloudControllerContext ctx = CloudControllerContext.getInstance();
		assertNotNull(ctx);		
		ctx.addKubernetesCluster(cluster);		
		
		KubernetesClusterContext kubClusterContext = new KubernetesClusterContext(CLUSTER_ID, MASTER_IP_1, MASTER_PORT, LOWER_PORT, UPPER_PORT);
		CloudControllerContext.getInstance().addKubernetesClusterContext(kubClusterContext);
		
		KubernetesMaster km2 = new KubernetesMaster();
		km2.setPrivateIPAddress(MASTER_IP_2);
		
		KubernetesCluster newCluster = new KubernetesCluster();
		newCluster.setClusterId(CLUSTER_ID);
		newCluster.setKubernetesMaster(km2);		
		
		// Get cluster context and update
		CloudControllerContext.getInstance().updateKubernetesCluster(newCluster);
        KubernetesClusterContext kubClusterContextUpdated = CloudControllerContext.getInstance().getKubernetesClusterContext(CLUSTER_ID);
        
        // Update necessary parameters of kubClusterContext using the updated kubCluster
        kubClusterContextUpdated.updateKubClusterContextParams(newCluster);            
        CloudControllerContext.getInstance().updateKubernetesClusterContext(kubClusterContext);
                
        // Get updated values and assert
        assertEquals("testhostname2" , CloudControllerContext.getInstance().getKubernetesClusterContext(CLUSTER_ID).getMasterIp());
        assertNotSame("testhostname1" , CloudControllerContext.getInstance().getKubernetesClusterContext(CLUSTER_ID).getMasterIp());
	}
 
开发者ID:apache,项目名称:stratos,代码行数:43,代码来源:KubernetesClusterContextTest.java


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