@@ -0,0 +1,1565 @@
+package org.jenkinsci.plugins.rabbitmqconsumer.extensions;%0A%0Aimport java.util.concurrent.Future;%0A%0Aimport jenkins.model.Jenkins;%0Aimport hudson.Extension;%0Aimport hudson.ExtensionList;%0A%0Aimport org.jenkinsci.plugins.rabbitmqconsumer.RMQManager;%0Aimport org.jenkinsci.plugins.rabbitmqconsumer.channels.PublishRMQChannel;%0Aimport org.jenkinsci.plugins.rabbitmqconsumer.publishers.PublishResult;%0A%0Aimport com.rabbitmq.client.AMQP;%0A%0A/**%0A * Extension class to publish message to RabbitMQ.%0A *%0A * @author rinrinne a.k.a. rin_ne%0A */%0A@Extension%0Apublic class MessagePublisher %7B%0A%0A    /**%0A     * Publish message.%0A     *%0A     * @param exchangeName the exhange name.%0A     * @param routingKey the routing key.%0A     * @param props the list of property.%0A     * @param body the content.%0A     * @return future object for PublishResult.%0A     */%0A    Future%3CPublishResult%3E publish(String exchangeName, String routingKey,%0A            AMQP.BasicProperties props, byte%5B%5D body) %7B%0A        PublishRMQChannel ch = RMQManager.getInstance().getPublishChannel();%0A        if (ch != null && ch.isOpen()) %7B%0A            return ch.publish(exchangeName, routingKey, props, body);%0A        %7D%0A        return null;%0A    %7D%0A%0A    /**%0A     * Get extension instance.%0A     *%0A     * @return the instance of this class.%0A     */%0A    public static MessagePublisher get() %7B%0A        ExtensionList%3CMessagePublisher%3E extensions = Jenkins.getInstance().getExtensionList(MessagePublisher.class);%0A        if (extensions != null && extensions.size() %3E 0) %7B%0A            return extensions.get(0);%0A        %7D%0A        return null;%0A    %7D%0A%7D%0A

Add new class MessagePublisher