protected void preDeliveryHook(MessageListener listener, ActiveMQMessage message) {
if (listener instanceof MessageEndpoint) {
MessageEndpoint endpoint = (MessageEndpoint) listener;
try {
endpoint.beforeDelivery(ActiveMQBaseEndpointWorker.ON_MESSAGE_METHOD);
} catch (NoSuchMethodException e) {
log.error(e.toString(), e);
} catch (ResourceException e) {
log.warn(e.toString(), e);
}