org.apache.axis2.clustering.ClusteringCommand Java Examples
The following examples show how to use
org.apache.axis2.clustering.ClusteringCommand.
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: RemoteTaskManager.java From carbon-commons with Apache License 2.0 | 5 votes |
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); } }
Example #2
Source File: TenantLoadMessageSenderTest.java From carbon-apimgt with Apache License 2.0 | 5 votes |
@Test public void testSendTenantRegistryLoadMessage() throws ClusteringFault { ClusteringAgent clusteringAgent = PowerMockito.mock(ClusteringAgent.class); ClusteringMessage request = new TenantLoadMessage(1, "a.com"); ClusteringCommand command = PowerMockito.mock(ClusteringCommand.class); List<ClusteringCommand> commandList = new ArrayList<ClusteringCommand>(); commandList.add(command); PowerMockito.when(clusteringAgent.sendMessage(request, true)).thenReturn(commandList); tenantLoadMessageSender.sendTenantLoadMessage(clusteringAgent, 1, "a.com", 1); }
Example #3
Source File: TenantLoadMessageSenderTest.java From carbon-apimgt with Apache License 2.0 | 5 votes |
@Test(expected = ClusteringFault.class) public void testSendTenantRegistryLoadMessageFail() throws ClusteringFault { ClusteringAgent clusteringAgent = PowerMockito.mock(ClusteringAgent.class); ClusteringCommand command = PowerMockito.mock(ClusteringCommand.class); List<ClusteringCommand> commandList = new ArrayList<ClusteringCommand>(); commandList.add(command); ClusteringFault clusteringFault = PowerMockito.mock(ClusteringFault.class); PowerMockito.when(clusteringAgent.sendMessage(Matchers.any(TenantLoadMessage.class), Matchers.anyBoolean())). thenThrow(clusteringFault); tenantLoadMessageSender.sendTenantLoadMessage(clusteringAgent, 1, "a.com", 2); }
Example #4
Source File: ServiceMappingAddRequest.java From carbon-commons with Apache License 2.0 | 4 votes |
@Override public ClusteringCommand getResponse() { return null; }
Example #5
Source File: DataSourceStatMessage.java From micro-integrator with Apache License 2.0 | 4 votes |
@Override public ClusteringCommand getResponse() { return null; }
Example #6
Source File: VirtualHostAddRequest.java From carbon-commons with Apache License 2.0 | 4 votes |
@Override public ClusteringCommand getResponse() { return null; }
Example #7
Source File: VirtualHostDeleteMapping.java From carbon-commons with Apache License 2.0 | 4 votes |
@Override public ClusteringCommand getResponse() { return null; }
Example #8
Source File: ServiceMappingDeleteRequest.java From carbon-commons with Apache License 2.0 | 4 votes |
@Override public ClusteringCommand getResponse() { return null; //To change body of implemented methods use File | Settings | File Templates. }
Example #9
Source File: SubscriptionClusterMessage.java From carbon-commons with Apache License 2.0 | 4 votes |
@Override public ClusteringCommand getResponse() { return null; }
Example #10
Source File: RemoteTaskManager.java From carbon-commons with Apache License 2.0 | 4 votes |
@Override public ClusteringCommand getResponse() { return this.result; }
Example #11
Source File: StatUpdateClusterMessage.java From carbon-apimgt with Apache License 2.0 | 4 votes |
@Override public ClusteringCommand getResponse() { return null; }
Example #12
Source File: TenantLoadMessage.java From carbon-apimgt with Apache License 2.0 | 4 votes |
@Override public ClusteringCommand getResponse() { return null; }
Example #13
Source File: SessionClusterMessage.java From carbon-apimgt with Apache License 2.0 | 4 votes |
@Override public ClusteringCommand getResponse() { return null; }
Example #14
Source File: SessionClusterMessage.java From carbon-identity with Apache License 2.0 | 4 votes |
@Override public ClusteringCommand getResponse() { return null; }
Example #15
Source File: AssociationClusterMessage.java From carbon-identity with Apache License 2.0 | 4 votes |
@Override public ClusteringCommand getResponse() { return null; }
Example #16
Source File: PolicySearchCacheInvalidationClusteringMessage.java From carbon-identity-framework with Apache License 2.0 | 4 votes |
@Override public ClusteringCommand getResponse() { return null; }
Example #17
Source File: PolicyStatusClusterMessage.java From carbon-identity-framework with Apache License 2.0 | 4 votes |
@Override public ClusteringCommand getResponse() { return null; }