本文整理汇总了Java中org.apache.axis2.clustering.ClusteringAgent.getParameter方法的典型用法代码示例。如果您正苦于以下问题:Java ClusteringAgent.getParameter方法的具体用法?Java ClusteringAgent.getParameter怎么用?Java ClusteringAgent.getParameter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.axis2.clustering.ClusteringAgent
的用法示例。
在下文中一共展示了ClusteringAgent.getParameter方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadWellKnownMembers
import org.apache.axis2.clustering.ClusteringAgent; //导入方法依赖的package包/类
private void loadWellKnownMembers(ClusteringAgent clusteringAgent, OMElement clusterElement) {
clusteringAgent.setMembers(new ArrayList<Member>());
Parameter membershipSchemeParam = clusteringAgent.getParameter("membershipScheme");
if (membershipSchemeParam != null) {
String membershipScheme = ((String) membershipSchemeParam.getValue()).trim();
if (membershipScheme.equals(ClusteringConstants.MembershipScheme.WKA_BASED)) {
List<Member> members = new ArrayList<Member>();
OMElement membersEle =
clusterElement.getFirstChildWithName(new QName("members"));
if (membersEle != null) {
for (Iterator iter = membersEle.getChildrenWithLocalName("member"); iter.hasNext();) {
OMElement memberEle = (OMElement) iter.next();
String hostName =
memberEle.getFirstChildWithName(new QName("hostName")).getText().trim();
String port =
memberEle.getFirstChildWithName(new QName("port")).getText().trim();
members.add(new Member(replaceVariables(hostName),
Integer.parseInt(replaceVariables(port))));
}
}
clusteringAgent.setMembers(members);
}
}
}
示例2: start
import org.apache.axis2.clustering.ClusteringAgent; //导入方法依赖的package包/类
/**
* Will create a configuration context from the avialable data and then it
* will start the listener manager
*
* @throws AxisFault if something went wrong
*/
protected void start() throws AxisFault {
if (configContext == null) {
configContext = getConfigurationContext();
}
if (!started) {
ClusteringAgent clusteringAgent =
configContext.getAxisConfiguration().getClusteringAgent();
String avoidInit = ClusteringConstants.Parameters.AVOID_INITIATION;
if (clusteringAgent != null &&
clusteringAgent.getParameter(avoidInit) != null &&
((String) clusteringAgent.getParameter(avoidInit).getValue()).equalsIgnoreCase("true")) {
clusteringAgent.setConfigurationContext(configContext);
clusteringAgent.init();
}
listenerManager.startSystem(configContext);
started = true;
}
}
示例3: shouldClusterBeInitiated
import org.apache.axis2.clustering.ClusteringAgent; //导入方法依赖的package包/类
/**
* @param clusteringAgent The ClusterManager implementation
* @return true, if the cluster needs to be automatically initialized by the framework; false,
* otherwise
*/
private static boolean shouldClusterBeInitiated(ClusteringAgent clusteringAgent) {
Parameter param =
clusteringAgent.getParameter(ClusteringConstants.Parameters.AVOID_INITIATION);
return !(param != null && JavaUtils.isTrueExplicitly(param.getValue()));
}