@Override public String agentStatus() { StringBuilder sb = new StringBuilder(); // Messages LinkedBlockingQueue<Message> agentQueue = this.messagingClient.getMessageProcessor().getMessageQueue(); if( agentQueue.isEmpty() ) { sb.append( "There is no message being processed in agent queue\n" ); } else { sb.append( "Agent " + getScopedInstancePath() + " (" + getApplicationName() + ")\n" ); sb.append( "The number total of messages in agent queue is : " + agentQueue.size() + "\n" ); sb.append( "The types of messages being processed are : " + "\n"); for( Message msg : agentQueue ) { sb.append( msg.getClass().getSimpleName() + "\n" ); } } // Running processes Process p = ProcessStore.getProcess(this.applicationName, this.scopedInstancePath); if( p != null ) sb.append( "Be careful. A recipe is under execution." ); else sb.append( "No recipe is under execution." ); return sb.toString(); } }
if( rawClient != null ) { newMessagingClient = new JmxWrapperForMessagingClient( rawClient ); newMessagingClient.setMessageQueue( this.messageProcessor.getMessageQueue()); openConnection( newMessagingClient );
if( rawClient != null ) { newMessagingClient = new JmxWrapperForMessagingClient( rawClient ); newMessagingClient.setMessageQueue( this.messageProcessor.getMessageQueue()); openConnection( newMessagingClient );
@Test public void testProcessing() throws Exception { // The message is processed... this.processor.start(); this.processor.storeMessage( new MsgCmdResynchronize()); Thread.sleep( 1000 ); this.processor.stopProcessor(); Assert.assertEquals( 0, this.processor.getMessageQueue().size()); }