3030import javax .ejb .Local ;
3131import javax .naming .ConfigurationException ;
3232
33- import org .apache .cloudstack .framework .events .Event ;
34- import org .apache .cloudstack .framework .events .EventBus ;
35- import org .apache .cloudstack .framework .events .EventBusException ;
36- import org .apache .cloudstack .framework .events .EventSubscriber ;
37- import org .apache .cloudstack .framework .events .EventTopic ;
38- import org .apache .cloudstack .managed .context .ManagedContextRunnable ;
3933import org .apache .log4j .Logger ;
4034
41- import com .cloud .utils .Ternary ;
42- import com .cloud .utils .component .ManagerBase ;
4335import com .rabbitmq .client .AMQP ;
4436import com .rabbitmq .client .AlreadyClosedException ;
4537import com .rabbitmq .client .Channel ;
5143import com .rabbitmq .client .ShutdownListener ;
5244import com .rabbitmq .client .ShutdownSignalException ;
5345
46+ import org .apache .cloudstack .framework .events .Event ;
47+ import org .apache .cloudstack .framework .events .EventBus ;
48+ import org .apache .cloudstack .framework .events .EventBusException ;
49+ import org .apache .cloudstack .framework .events .EventSubscriber ;
50+ import org .apache .cloudstack .framework .events .EventTopic ;
51+ import org .apache .cloudstack .managed .context .ManagedContextRunnable ;
52+
53+ import com .cloud .utils .Ternary ;
54+ import com .cloud .utils .component .ManagerBase ;
55+
5456@ Local (value = EventBus .class )
5557public class RabbitMQEventBus extends ManagerBase implements EventBus {
5658
@@ -138,23 +140,23 @@ public boolean configure(String name, Map<String, Object> params) throws Configu
138140 return true ;
139141 }
140142
141- public void setServer (String amqpHost ) {
143+ public static void setServer (String amqpHost ) {
142144 RabbitMQEventBus .amqpHost = amqpHost ;
143145 }
144146
145- public void setUsername (String username ) {
147+ public static void setUsername (String username ) {
146148 RabbitMQEventBus .username = username ;
147149 }
148150
149- public void setPassword (String password ) {
151+ public static void setPassword (String password ) {
150152 RabbitMQEventBus .password = password ;
151153 }
152154
153- public void setPort (Integer port ) {
155+ public static void setPort (Integer port ) {
154156 RabbitMQEventBus .port = port ;
155157 }
156158
157- public void setSecureProtocol (String protocol ) {
159+ public static void setSecureProtocol (String protocol ) {
158160 RabbitMQEventBus .secureProtocol = protocol ;
159161 }
160162
@@ -163,11 +165,11 @@ public void setName(String name) {
163165 this .name = name ;
164166 }
165167
166- public void setExchange (String exchange ) {
168+ public static void setExchange (String exchange ) {
167169 RabbitMQEventBus .amqpExchangeName = exchange ;
168170 }
169171
170- public void setRetryInterval (Integer retryInterval ) {
172+ public static void setRetryInterval (Integer retryInterval ) {
171173 RabbitMQEventBus .retryInterval = retryInterval ;
172174 }
173175
@@ -378,7 +380,7 @@ private synchronized Connection createConnection() throws Exception {
378380 }
379381
380382 if (useSsl != null && !useSsl .isEmpty () && useSsl .equalsIgnoreCase ("true" )) {
381- factory .useSslProtocol (this . secureProtocol );
383+ factory .useSslProtocol (secureProtocol );
382384 }
383385 Connection connection = factory .newConnection ();
384386 connection .addShutdownListener (disconnectHandler );
0 commit comments