@Override public boolean intercept(Packet packet, RemotingConnection connection) throws ActiveMQException { if (packet.getType() == PacketImpl.BACKUP_REGISTRATION) { try { SharedNothingBackupActivation activation = (SharedNothingBackupActivation) backup.getActivation(); ReplicationEndpoint repEnd = activation.getReplicationEndpoint(); handler.addSubHandler(repEnd); Channel repChannel = repEnd.getChannel(); repChannel.setHandler(handler); handler.setChannel(repChannel); live.getRemotingService().removeIncomingInterceptor(this); } catch (Exception e) { throw new RuntimeException(e); } } return true; }
public void deliverUpToDateMsg() { live.getRemotingService().removeIncomingInterceptor(this); if (backup.isStarted()) handler.deliver(); }