@Override protected void doDeactivate() throws Exception { try { if (failoverMonitor != null) { failoverMonitor.deregisterAgent(this); } } finally { super.doDeactivate(); } }
@Override protected void indicatingStart(ExtendedDataInputStream in) throws IOException { String group = in.readString(); connectorDescription = in.readString(); repositoryName = in.readString(); failoverMonitor = failoverMonitorProvider.getFailoverMonitor(group); if (failoverMonitor == null) { throw new IllegalStateException("No monitor available for fail-over group " + group); } failoverMonitor.registerAgent(this); super.indicatingStart(in); }
@Override protected void createPane(Composite parent, FailoverMonitor monitor) { final OScope scope = new OScope(parent, SWT.NONE); monitor.addListener( new ContainerEventAdapter<AgentProtocol>() { @Override protected void notifyContainerEvent(IContainerEvent<AgentProtocol> event) { addEvent(event); super.notifyContainerEvent(event); } @Override protected void onAdded(IContainer<AgentProtocol> monitor, final AgentProtocol agent) { final Channel channel = scope.getChannel(agent.getConnectorDescription()); agent.addListener( new IListener() { public void notifyEvent(IEvent event) { if (event instanceof SignalScheduledEvent) { if (!scope.isDisposed()) { scope .getDisplay() .asyncExec( new Runnable() { public void run() { if (!scope.isDisposed()) { channel.peak(); } } }); } } } }); } }); }
public FailoverMonitor create(String description) throws ProductCreationException { FailoverMonitor monitor = new FailoverMonitor(); monitor.setGroup(description); return monitor; }