Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ const CLOSE_CONNECTION_SIG = "closeConnectionWithID(java.lang.String)";
const CLOSE_SESSION_SIG = "closeSessionWithID(java.lang.String,java.lang.String)";
const CLOSE_CONSUMER_SIG = "closeConsumerWithID(java.lang.String,java.lang.String)";
const LIST_LOCK_MANAGER_SIG = "listLockCoordinatorsAsJSON()";
const START_LOCK_COORDINATOR_SIG = "startLockCoordinator(java.lang.String)";
const STOP_LOCK_COORDINATOR_SIG = "stopLockCoordinator(java.lang.String)";

const MS_PER_SEC = 1000;
const MS_PER_MIN = 60 * MS_PER_SEC;
Expand Down Expand Up @@ -654,6 +656,14 @@ class ArtemisService {
return jolokiaService.execute(await this.getBrokerObjectName(), CLOSE_CONSUMER_SIG, [session, name]);
}

async startLockCoordinator(name: string) {
return jolokiaService.execute(await this.getBrokerObjectName(), START_LOCK_COORDINATOR_SIG, [name]);
}

async stopLockCoordinator(name: string) {
return jolokiaService.execute(await this.getBrokerObjectName(), STOP_LOCK_COORDINATOR_SIG, [name]);
}

async getBrokerObjectName() {
return await this.brokerObjectName;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,15 +297,41 @@ export const Status: React.FunctionComponent = () => {
<Th>Name</Th>
<Th>ID</Th>
<Th>Status</Th>
<Th></Th>
</Tr>
</Thead>
<Tbody>
{
lockCoordinators?.lockCoordinators.map((coordinator, index) => {
return <Tr>
return <Tr key={index}>
<Td>{coordinator.name}</Td>
<Td>{coordinator.lockId}</Td>
<Td>{coordinator.status}</Td>
<Td>
{coordinator.status === 'Stopped' ? (
<Button variant="primary" size="sm" onClick={() => {
artemisService.startLockCoordinator(coordinator.name)
.then(() => {
eventService.notify({ type: 'success', message: 'Lock Coordinator ' + coordinator.name + ' started', duration: 3000 });
getLockCoordinators();
})
.catch((error) => {
eventService.notify({ type: 'danger', message: 'Failed to start Lock Coordinator: ' + jolokiaService.errorMessage(error) });
});
}}>Start</Button>
) : (
<Button variant="secondary" size="sm" onClick={() => {
artemisService.stopLockCoordinator(coordinator.name)
.then(() => {
eventService.notify({ type: 'success', message: 'Lock Coordinator ' + coordinator.name + ' stopped', duration: 3000 });
getLockCoordinators();
})
.catch((error) => {
eventService.notify({ type: 'danger', message: 'Failed to stop Lock Coordinator: ' + jolokiaService.errorMessage(error) });
});
}}>Stop</Button>
)}
</Td>
</Tr>
})
}
Expand Down
Loading