Java Code Examples for org.apache.axis2.engine.AxisConfiguration#getClusteringAgent()

The following examples show how to use org.apache.axis2.engine.AxisConfiguration#getClusteringAgent() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AutoscalerContext.java    From attic-stratos with Apache License 2.0 6 votes vote down vote up
private AutoscalerContext() {
    // Check clustering status
    AxisConfiguration axisConfiguration = ServiceReferenceHolder.getInstance().getAxisConfiguration();
    if ((axisConfiguration != null) && (axisConfiguration.getClusteringAgent() != null)) {
        clustered = true;
    }

    // Initialize distributed object provider
    distributedObjectProvider = ServiceReferenceHolder.getInstance().getDistributedObjectProvider();

    if (applicationContextMap == null) {
        applicationContextMap = distributedObjectProvider.getMap(AS_APPLICATION_ID_TO_APPLICATION_CTX_MAP);//new ConcurrentHashMap<String, ApplicationContext>();
    }
    setClusterMonitors(distributedObjectProvider.getMap(AS_CLUSTER_ID_TO_CLUSTER_MONITOR_MAP));
    setApplicationMonitors(distributedObjectProvider.getMap(AS_APPLICATION_ID_TO_APPLICATION_MONITOR_MAP));
    pendingApplicationMonitors = distributedObjectProvider.getList(AS_PENDING_APPLICATION_MONITOR_LIST);//new ArrayList<String>();
    applicationIdToNetworkPartitionAlgorithmContextMap =
            distributedObjectProvider.getMap(AS_APPLICATIOIN_ID_TO_NETWORK_PARTITION_ALGO_CTX_MAP);
}
 
Example 2
Source File: StratosManagerContext.java    From attic-stratos with Apache License 2.0 6 votes vote down vote up
private StratosManagerContext() {
    // Initialize clustering status
    AxisConfiguration axisConfiguration = ServiceReferenceHolder.getInstance().getAxisConfiguration();
    if ((axisConfiguration != null) && (axisConfiguration.getClusteringAgent() != null)) {
        clustered = true;
    }

    // Initialize distributed object provider
    distributedObjectProvider = ServiceReferenceHolder.getInstance().getDistributedObjectProvider();

    // Get maps from distributed object provider
    cartridgeTypeToCartridgeGroupsMap = distributedObjectProvider.getMap(SM_CARTRIDGE_TYPE_TO_CARTIDGE_GROUPS_MAP);
    cartridgeTypeToApplicationsMap = distributedObjectProvider.getMap(SM_CARTRIDGE_TYPE_TO_APPLICATIONS_MAP);
    cartridgeGroupToCartridgeSubGroupsMap = distributedObjectProvider
            .getMap(SM_CARTRIDGE_GROUP_TO_CARTIDGE_GROUPS_MAP);
    cartridgeGroupToApplicationsMap = distributedObjectProvider.getMap(SM_CARTRIDGE_GROUP_TO_APPLICATIONS_MAP);

    // Update context from the registry
    updateContextFromRegistry();
}
 
Example 3
Source File: ClusterAdmin.java    From carbon-commons with Apache License 2.0 5 votes vote down vote up
private ClusteringAgent getClusteringAgent() throws AxisFault {
    AxisConfiguration axisConfig =
            MessageContext.getCurrentMessageContext().
                    getConfigurationContext().getAxisConfiguration();
    ClusteringAgent clusterManager = axisConfig.getClusteringAgent();
    if (clusterManager == null) {
        handleException("ClusteringAgent not enabled in axis2.xml file");
    }
    return clusterManager;
}
 
Example 4
Source File: CloudControllerContext.java    From attic-stratos with Apache License 2.0 5 votes vote down vote up
private CloudControllerContext() {
    // Check clustering status
    AxisConfiguration axisConfiguration = ServiceReferenceHolder.getInstance().getAxisConfiguration();
    if ((axisConfiguration != null) && (axisConfiguration.getClusteringAgent() != null)) {
        clustered = true;
    }

    // Initialize distributed object provider
    distributedObjectProvider = ServiceReferenceHolder.getInstance().getDistributedObjectProvider();

    // Initialize objects
    kubernetesClustersMap = distributedObjectProvider.getMap(CC_KUB_GROUP_ID_TO_GROUP_MAP);
    clusterIdToMemberContextListMap = distributedObjectProvider.getMap(CC_CLUSTER_ID_TO_MEMBER_CTX_MAP);
    memberIdToMemberContextMap = distributedObjectProvider.getMap(CC_MEMBER_ID_TO_MEMBER_CTX_MAP);
    memberIdToScheduledTaskMap = distributedObjectProvider.getMap(CC_MEMBER_ID_TO_SCH_TASK_MAP);
    kubClusterIdToKubClusterContextMap = distributedObjectProvider.getMap(CC_KUB_CLUSTER_ID_TO_KUB_CLUSTER_CTX_MAP);
    clusterIdToContextMap = distributedObjectProvider.getMap(CC_CLUSTER_ID_TO_CLUSTER_CTX);
    cartridgeTypeToPartitionIdsMap = distributedObjectProvider.getMap(CC_CARTRIDGE_TYPE_TO_PARTITION_IDS_MAP);
    cartridgeTypeToCartridgeMap = distributedObjectProvider.getMap(CC_CARTRIDGE_TYPE_TO_CARTRIDGES_MAP);
    serviceGroupNameToServiceGroupMap = distributedObjectProvider
            .getMap(CC_SERVICE_GROUP_NAME_TO_SERVICE_GROUP_MAP);
    networkPartitionIDToNetworkPartitionMap = distributedObjectProvider
            .getMap(CC_NETWORK_PARTITION_ID_TO_NETWORK_PARTITION_MAP);
    partitionToIaasProviderByCartridge = distributedObjectProvider
            .getMap(CC_PARTITION_TO_IAAS_PROVIDER_BY_CARTRIDGE_MAP);
    cartridgeTypeToIaasProviders = distributedObjectProvider.getMap(CC_CARTRIDGE_TYPE_TO_IAAS_PROVIDER_MAP);
    applicationIdToClusterIdToPortMappings = distributedObjectProvider
            .getMap(CC_APPLICATION_ID_TO_CLUSTER_ID_TO_PORT_MAPPING_MAP);
    partitionIdToPartitionMap = distributedObjectProvider.getMap(CC_PARTITION_ID_TO_PARTITION_MAP);

    if (!unitTest) {
        // Update context from the registry
        updateContextFromRegistry();
    }
}
 
Example 5
Source File: VirtualHostClusterUtil.java    From carbon-commons with Apache License 2.0 4 votes vote down vote up
private static ClusteringAgent getClusteringAgent() throws AxisFault {

        AxisConfiguration axisConfig =
                DataHolder.getInstance().getConfigurationContextService().getServerConfigContext().getAxisConfiguration();
        return axisConfig.getClusteringAgent();
    }
 
Example 6
Source File: HazelcastDistributedObjectProvider.java    From attic-stratos with Apache License 2.0 4 votes vote down vote up
private boolean isClustered() {
    AxisConfiguration axisConfiguration = ServiceReferenceHolder.getInstance().getAxisConfiguration();
    return ((axisConfiguration != null) && (axisConfiguration.getClusteringAgent() != null)
            && (getHazelcastInstance() != null));
}