@Override public AddressInfo createAddress(final SimpleString address, RoutingType routingType, final boolean autoCreated) throws Exception { return createAddress(new AddressInfo(address, routingType), autoCreated); }
@Override public void acknowledge(final MessageReference ref, final AckReason reason, final ServerConsumer consumer) throws Exception { if (isNonDestructive() && reason == AckReason.EXPIRED || reason == AckReason.KILLED ) { removeIfCurrent(ref); } super.acknowledge(ref, reason, consumer); }
@Override protected void refRemoved(MessageReference ref) { if (isNonDestructive()) { removeIfCurrent(ref); } super.refRemoved(ref); }
@Override public AddressInfo addOrUpdateAddressInfo(AddressInfo addressInfo) throws Exception { if (!addAddressInfo(addressInfo)) { updateAddressInfo(addressInfo.getName(), addressInfo.getRoutingTypes()); } return getAddressInfo(addressInfo.getName()); }
private void addMessage(ScheduledDeliveryHandlerImpl handler, long nextMessageID, long nextScheduledTime, boolean tail) { MessageReferenceImpl refImpl = new MessageReferenceImpl(new FakeMessage(nextMessageID), null); refImpl.setScheduledDeliveryTime(nextScheduledTime); handler.addInPlace(nextScheduledTime, refImpl, tail); }
private void checkAndSchedule(ScheduledDeliveryHandlerImpl handler, long nextMessageID, long nextScheduledTime, boolean tail, Queue queue) { MessageReferenceImpl refImpl = new MessageReferenceImpl(new FakeMessage(nextMessageID), queue); refImpl.setScheduledDeliveryTime(nextScheduledTime); handler.checkAndSchedule(refImpl, tail); }
@Test public void testScheduleFixedSample() throws Exception { ScheduledDeliveryHandlerImpl handler = new ScheduledDeliveryHandlerImpl(null, new FakeQueueForScheduleUnitTest(0)); addMessage(handler, 0, 48L, true); addMessage(handler, 1, 75L, true); addMessage(handler, 2, 56L, true); addMessage(handler, 3, 7L, false); addMessage(handler, 4, 69L, true); debugList(true, handler, 5); }
@Override public RoutingStatus send(final Message message, final boolean direct, boolean noAutoCreateQueue) throws Exception { return send(getCurrentTransaction(), message, direct, noAutoCreateQueue); }
@Override public Object createObject() { return new MessageReferenceImpl(); } }));
@Override public void cancel(final Transaction tx, final MessageReference reference, boolean ignoreRedeliveryCheck) { getRefsOperation(tx, ignoreRedeliveryCheck).addAck(reference); }
/** * Handler for changed policy entries in the directory. * * @param namingEvent the changed entry event that occurred */ public void objectChanged(NamingEvent namingEvent) { objectRemoved(namingEvent); objectAdded(namingEvent); }
/** * To be called by backup trying to fail back the server */ private void startFailbackChecker() { activeMQServer.getScheduledPool().scheduleAtFixedRate(new FailbackChecker(), 1000L, 1000L, TimeUnit.MILLISECONDS); }
@Override public SimpleString readNodeId() throws ActiveMQIllegalStateException, IOException { return getNodeId(); } }
@Override public Activation createActivation(ActiveMQServerImpl server, boolean wasLive, Map<String, Object> activationParams, ActiveMQServerImpl.ShutdownOnCriticalErrorListener shutdownOnCriticalIO) { return new SharedStoreBackupActivation(server, this); }
@Override QueueIterateAction createDeleteMatchingAction(AckReason ackReason) { QueueIterateAction queueIterateAction = super.createDeleteMatchingAction(ackReason); return new QueueIterateAction() { @Override public void actMessage(Transaction tx, MessageReference ref) throws Exception { removeIfCurrent(ref); queueIterateAction.actMessage(tx, ref); } }; }
@Override public void createSharedQueue(SimpleString address, final SimpleString name, final RoutingType routingType, boolean durable, final SimpleString filterString) throws Exception { createSharedQueue(address, name, routingType, filterString, durable, null, null, null, null); }
@Override public AddressInfo getAddressAndRoutingType(AddressInfo addressInfo) { if (prefixEnabled) { return addressInfo.getAddressAndRoutingType(prefixes); } return addressInfo; }
@Override public Map<String, Set<Role>> getSecurityRoles() { if (securityRoles == null) { populateSecurityRoles(); } return securityRoles; }
@Override public void stop(boolean isShutdown) throws Exception { if (isShutdown) { exitCalled = true; } else { stop(); } }
@Override public void resetFlags() { super.resetFlags(); exitCalled = false; } }