本文整理汇总了Java中org.apache.axis2.clustering.ClusteringAgent.sendMessage方法的典型用法代码示例。如果您正苦于以下问题:Java ClusteringAgent.sendMessage方法的具体用法?Java ClusteringAgent.sendMessage怎么用?Java ClusteringAgent.sendMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.axis2.clustering.ClusteringAgent
的用法示例。
在下文中一共展示了ClusteringAgent.sendMessage方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sendClusterMessage
import org.apache.axis2.clustering.ClusteringAgent; //导入方法依赖的package包/类
/**
* Send out policy status change notification to other nodes.
*
* @param clusterMessage
* @param isSync
*/
private void sendClusterMessage(PolicyStatusClusterMessage clusterMessage, boolean isSync) {
try {
if (log.isDebugEnabled()) {
log.debug("Sending policy status change cluster message to all other nodes");
}
ClusteringAgent clusteringAgent = EntitlementConfigHolder.getInstance()
.getConfigurationContextService()
.getServerConfigContext()
.getAxisConfiguration()
.getClusteringAgent();
if (clusteringAgent != null) {
clusteringAgent.sendMessage(clusterMessage, isSync);
} else {
log.error("Clustering Agent not available.");
}
} catch (ClusteringFault clusteringFault) {
log.error("Error while sending policy status change cluster message", clusteringFault);
}
}
示例2: replicateAssociationInfo
import org.apache.axis2.clustering.ClusteringAgent; //导入方法依赖的package包/类
private void replicateAssociationInfo(AssociationClusterMessage associationInfoData) {
if (log.isDebugEnabled()) {
log.debug("Starting to replicate association : " + associationInfoData.getAssociation().getHandle());
}
ClusteringAgent agent = IdentityProviderServiceComponent.getConfigContext().getAxisConfiguration().getClusteringAgent();
if (log.isDebugEnabled()) {
log.debug("Clustering Agent: " + agent);
}
if (agent != null) {
try {
agent.sendMessage(associationInfoData, true);
} catch (ClusteringFault e) {
log.error("Unable to send cluster message :" + e.getMessage(), e);
}
}
if (log.isDebugEnabled()) {
log.debug("Completed replicating association : " + associationInfoData.getAssociation().getHandle());
}
}
示例3: addServiceMappingToCluster
import org.apache.axis2.clustering.ClusteringAgent; //导入方法依赖的package包/类
public static Boolean addServiceMappingToCluster(String mapping, String epr) throws AxisFault {
Boolean isMappingAdded = false;
try {
ClusteringAgent agent = getClusteringAgent();
if(agent != null) {
agent.sendMessage(new ServiceMappingAddRequest(mapping, epr), true);
isMappingAdded = true;
}
if (log.isDebugEnabled()) {
log.debug("sent cluster command to to get Active tenants on cluster");
}
} catch (AxisFault f) {
String msg = "Error in getting active tenant by cluster commands";
log.error(msg, f);
throw new AxisFault(msg);
}
return isMappingAdded;
}
示例4: addVirtualHostsToCluster
import org.apache.axis2.clustering.ClusteringAgent; //导入方法依赖的package包/类
public static Boolean addVirtualHostsToCluster(String hostName, String uri, String webappPath) throws AxisFault {
Boolean isMappingAdded = false;
try {
ClusteringAgent agent = getClusteringAgent();
if(agent != null) {
agent.sendMessage(new VirtualHostAddRequest(hostName, uri, webappPath), true);
isMappingAdded = true;
}
if (log.isDebugEnabled()) {
log.debug("sent cluster command to to get Active tenants on cluster");
}
} catch (AxisFault f) {
String msg = "Error in getting active tenant by cluster commands";
log.error(msg, f);
throw new AxisFault(msg);
}
return isMappingAdded;
}
示例5: deleteServiceMappingToCluster
import org.apache.axis2.clustering.ClusteringAgent; //导入方法依赖的package包/类
public static Boolean deleteServiceMappingToCluster(String mapping) throws AxisFault {
Boolean isMappingAdded = false;
try {
ClusteringAgent agent = getClusteringAgent();
if(agent != null) {
agent.sendMessage(new ServiceMappingDeleteRequest(mapping), true);
isMappingAdded = true;
}
if (log.isDebugEnabled()) {
log.debug("sent cluster command to to get Active tenants on cluster");
}
} catch (AxisFault f) {
String msg = "Error in getting active tenant by cluster commands";
log.error(msg, f);
throw new AxisFault(msg);
}
return isMappingAdded;
}
示例6: deleteVirtualHostsToCluster
import org.apache.axis2.clustering.ClusteringAgent; //导入方法依赖的package包/类
public static Boolean deleteVirtualHostsToCluster(String hostName) throws AxisFault {
Boolean isMappingAdded = false;
try {
ClusteringAgent agent = getClusteringAgent();
if(agent != null) {
agent.sendMessage(new VirtualHostDeleteMapping(hostName), true);
isMappingAdded = true;
}
if (log.isDebugEnabled()) {
log.debug("sent cluster command to to get Active tenants on cluster");
}
} catch (AxisFault f) {
String msg = "Error in getting active tenant by cluster commands";
log.error(msg, f);
throw new AxisFault(msg);
}
return isMappingAdded;
}
示例7: sendClusterMessage
import org.apache.axis2.clustering.ClusteringAgent; //导入方法依赖的package包/类
/**
* Sends a cluster message to other members of the cluster.If message transmission fails it will
* create a thread which will attempt retry transmission for a predefined amount of retry attempts.
*
* @param message The message to be transmitted
*/
public static void sendClusterMessage(ClusteringMessage message) {
ClusteringAgent agent = createClusteringAgent();
if (agent == null) {
//log.error("Unable to send the clustering message as a clustering agent was not obtained.");
if (log.isDebugEnabled()) {
log.debug(String.format("Failed to send cluster message :%s ", message));
}
return;
}
try {
agent.sendMessage(message, true);
if (log.isDebugEnabled()) {
log.debug(String.format("Successfully transmitted cluster message :%s", message));
}
} catch (ClusteringFault e) {
if (log.isDebugEnabled()) {
log.error("Unable to send the clustering message.The system will now attempt to retry " +
"sending the message", e);
}
}
}
示例8: sendSessionInvalidationClusterMessage
import org.apache.axis2.clustering.ClusteringAgent; //导入方法依赖的package包/类
public void sendSessionInvalidationClusterMessage(String sessionIndex) {
SessionClusterMessage clusterMessage = new SessionClusterMessage();
clusterMessage.setMessageId(UUID.randomUUID());
clusterMessage.setSessionIndex(sessionIndex);
ClusteringAgent clusteringAgent = SAML2SSOAuthFEDataHolder.getInstance()
.getConfigurationContextService().getServerConfigContext().getAxisConfiguration()
.getClusteringAgent();
if (clusteringAgent != null) {
int numberOfRetries = 0;
while (numberOfRetries < 60) {
try {
clusteringAgent.sendMessage(clusterMessage, true);
log.info("Sent [" + clusterMessage + "]");
break;
} catch (ClusteringFault e) {
numberOfRetries++;
if (numberOfRetries < 60) {
log.warn(
"Could not send SSOSessionInvalidationClusterMessage. Retry will be attempted in 2s. Request: "
+ clusterMessage, e);
} else {
log.error(
"Could not send SSOSessionInvalidationClusterMessage. Several retries failed. Request:"
+ clusterMessage, e);
}
try {
Thread.sleep(2000);
} catch (InterruptedException ignored) {
}
}
}
}
}
示例9: sendAddSubscriptionClusterMessage
import org.apache.axis2.clustering.ClusteringAgent; //导入方法依赖的package包/类
/**
* This is to send clusterMessage to inform other nodes about subscription added to the system, so that everyone can add new one.
* @param topicName
* @param subsciptionID
* @param tenantID
* @param tenantName
* @throws ClusteringFault
*/
public static void sendAddSubscriptionClusterMessage(String topicName,String subsciptionID,
int tenantID, String tenantName) throws ClusteringFault{
ConfigurationContextService configContextService = (ConfigurationContextService) PrivilegedCarbonContext
.getThreadLocalCarbonContext().getOSGiService(ConfigurationContextService.class);
ConfigurationContext configContext = configContextService.getServerConfigContext();
ClusteringAgent agent = configContext.getAxisConfiguration().getClusteringAgent();
agent.sendMessage(new SubscriptionClusterMessage(topicName,subsciptionID,tenantID, tenantName), false);
}
示例10: sendLoggingConfigSyncClusterMessage
import org.apache.axis2.clustering.ClusteringAgent; //导入方法依赖的package包/类
private void sendLoggingConfigSyncClusterMessage() {
ClusteringAgent clusteringAgent =
DataHolder.getInstance().getServerConfigContext().getAxisConfiguration().getClusteringAgent();
if (clusteringAgent != null) {
try {
clusteringAgent.sendMessage(new LoggingConfigSyncRequest(), true);
} catch (ClusteringFault clusteringFault) {
log.error("Logging configuration synchronization cluster message failed.", clusteringFault);
}
}
}
示例11: getTaskStateFromLocalCluster
import org.apache.axis2.clustering.ClusteringAgent; //导入方法依赖的package包/类
private TaskState getTaskStateFromLocalCluster(String taskName) throws TaskException {
/* first check local server */
if (this.isTaskRunning(taskName)) {
return TaskState.BLOCKED;
}
ClusteringAgent agent = this.getClusteringAgent();
if (agent == null) {
return TaskState.UNKNOWN;
}
TaskStatusMessage msg = new TaskStatusMessage();
msg.setTaskName(taskName);
msg.setTaskType(this.getTaskType());
msg.setTenantId(this.getTenantId());
try {
List<ClusteringCommand> result = agent.sendMessage(msg, true);
TaskStatusResult status;
for (ClusteringCommand entry : result) {
status = (TaskStatusResult) entry;
if (status.isRunning()) {
return TaskState.BLOCKED;
}
}
return TaskState.NORMAL;
} catch (ClusteringFault e) {
throw new TaskException(e.getMessage(), Code.UNKNOWN, e);
}
}