Codota Logo
net.roboconf.messaging.api
Code IndexAdd Codota to your IDE (free)

How to use net.roboconf.messaging.api

Best Java code snippets using net.roboconf.messaging.api (Showing top 18 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
StringBuilder s =
  • Codota Iconnew StringBuilder()
  • Codota Iconnew StringBuilder(32)
  • Codota IconString str;new StringBuilder(str)
  • Smart code suggestions by Codota
}
origin: roboconf/roboconf-platform

@Override
protected void configureMessageProcessor( AbstractMessageProcessor<IAgentClient> messageProcessor ) {
  messageProcessor.setMessagingClient( this );
}
origin: net.roboconf/roboconf-messaging-api

/**
 * Associates a message processor with this instance.
 * <p>
 * The message processor cannot be started before. This method will start it.
 * </p>
 * <p>
 * This method must be invoked only once.
 * </p>
 * @param messageProcessor the message processor
 */
public void associateMessageProcessor( AbstractMessageProcessor<T> messageProcessor ) {
  if( this.messageProcessor != null )
    throw new IllegalArgumentException( "The message processor was already defined." );
  this.messageProcessor = messageProcessor;
  configureMessageProcessor( messageProcessor );
  this.messageProcessor.start();
}
origin: net.roboconf/roboconf-messaging-api

@Override
public final void run() {
  this.running.set( true );
  while( this.running.get()) {
    try {
      Message message = this.messageQueue.take();
      if( this.running.get())
        processMessage( message );
    } catch( InterruptedException e ) {
      break;
    }
  }
  Logger.getLogger( getClass().getName()).fine( "Roboconf's message processing thread is stopping." );
  this.running.set( false );
}
origin: net.roboconf/roboconf-agent

if( this.messagingClient.isConnected()) {
  this.messagingClient.sendMessageToTheDm( new MsgNotifMachineDown( this.applicationName, this.scopedInstancePath ));
  this.logger.fine( "Agent " + getAgentId() + " notified the DM it was about to stop." );
this.messagingClient.getMessageProcessor().stopProcessor();
this.messagingClient.getMessageProcessor().interrupt();
this.messagingClient.closeConnection();
origin: roboconf/roboconf-platform

JmxWrapperForMessagingClient newMessagingClient = null;
try {
  IMessagingClient rawClient = createMessagingClient( factoryName );
  if( rawClient != null ) {
    newMessagingClient = new JmxWrapperForMessagingClient( rawClient );
    newMessagingClient.setMessageQueue( this.messageProcessor.getMessageQueue());
    openConnection( newMessagingClient );
    this.messagingClient = newMessagingClient;
  else
    resetInternalClient();
terminateClient( oldClient, "The previous client could not be terminated correctly.", this.logger );
origin: roboconf/roboconf-platform

@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());
}
origin: roboconf/roboconf-platform

@After
public void releaseClients() throws Exception {
  for( ReconfigurableClient<?> client : this.clients ) {
    client.getMessageProcessor().stopProcessor();
    client.getMessageProcessor().interrupt();
    client.closeConnection();
  }
  this.clients.clear();
}
origin: roboconf/roboconf-platform

@Test
public void testStartAndStop() throws Exception {
  Assert.assertFalse( this.processor.isRunning());
  this.processor.start();
  Thread.sleep( 200 );
  Assert.assertTrue( this.processor.isRunning());
  this.processor.stopProcessor();;
  Thread.sleep( 200 );
  Assert.assertFalse( this.processor.isRunning());
}
origin: roboconf/roboconf-platform

@Test
public void testInterrupt() throws Exception {
  Assert.assertFalse( this.processor.isRunning());
  this.processor.start();
  Thread.sleep( 200 );
  Assert.assertTrue( this.processor.isRunning());
  this.processor.interrupt();
  Thread.sleep( 200 );
  Assert.assertFalse( this.processor.isRunning());
}
origin: net.roboconf/roboconf-dm

this.messagingClient.getMessageProcessor().stopProcessor();
this.messagingClient.getMessageProcessor().interrupt();
try {
  this.messagingClient.closeConnection();
origin: net.roboconf/roboconf-agent

  @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();
  }
}
origin: roboconf/roboconf-platform

@After
public void terminateProcessor() {
  if( this.processor != null )
    this.processor.stopProcessor();
}
origin: net.roboconf/roboconf-messaging-api

JmxWrapperForMessagingClient newMessagingClient = null;
try {
  IMessagingClient rawClient = createMessagingClient( factoryName );
  if( rawClient != null ) {
    newMessagingClient = new JmxWrapperForMessagingClient( rawClient );
    newMessagingClient.setMessageQueue( this.messageProcessor.getMessageQueue());
    openConnection( newMessagingClient );
    this.messagingClient = newMessagingClient;
  else
    resetInternalClient();
terminateClient( oldClient, "The previous client could not be terminated correctly.", this.logger );
origin: roboconf/roboconf-platform

/**
 * Associates a message processor with this instance.
 * <p>
 * The message processor cannot be started before. This method will start it.
 * </p>
 * <p>
 * This method must be invoked only once.
 * </p>
 * @param messageProcessor the message processor
 */
public void associateMessageProcessor( AbstractMessageProcessor<T> messageProcessor ) {
  if( this.messageProcessor != null )
    throw new IllegalArgumentException( "The message processor was already defined." );
  this.messageProcessor = messageProcessor;
  configureMessageProcessor( messageProcessor );
  this.messageProcessor.start();
}
origin: roboconf/roboconf-platform

@Override
public final void run() {
  this.running.set( true );
  while( this.running.get()) {
    try {
      Message message = this.messageQueue.take();
      if( this.running.get())
        processMessage( message );
    } catch( InterruptedException e ) {
      break;
    }
  }
  Logger.getLogger( getClass().getName()).fine( "Roboconf's message processing thread is stopping." );
  this.running.set( false );
}
origin: net.roboconf/roboconf-messaging-api

@Override
protected void configureMessageProcessor( AbstractMessageProcessor<IAgentClient> messageProcessor ) {
  messageProcessor.setMessagingClient( this );
}
origin: net.roboconf/roboconf-messaging-api

@Override
protected void configureMessageProcessor( AbstractMessageProcessor<IDmClient> messageProcessor ) {
  messageProcessor.setMessagingClient( this );
}
origin: roboconf/roboconf-platform

@Override
protected void configureMessageProcessor( AbstractMessageProcessor<IDmClient> messageProcessor ) {
  messageProcessor.setMessagingClient( this );
}
net.roboconf.messaging.api

Most used classes

  • AbstractMessageProcessor
    A message processor is in charge of (guess what) processing messages. The DM is supposed to have onl
  • RoboconfMessageQueue
    A blocking queue with additional attributes to measure activity.
  • MsgNotifHeartbeat
  • IdleClient
  • MessagingContext
    A context that identifies messages recipients and topic names. Three properties are part of this cla
  • MsgCmdAddImport,
  • MsgCmdRemoveImport,
  • MsgCmdRequestImport,
  • MsgNotifInstanceChanged,
  • MsgNotifInstanceRemoved,
  • MsgNotifLogs,
  • MsgNotifMachineDown,
  • MsgCmdAddInstance,
  • MsgCmdChangeBinding,
  • MsgCmdChangeInstanceState,
  • MsgCmdRemoveInstance,
  • MsgCmdSetScopedInstance,
  • MsgCmdUpdateProbeConfiguration,
  • MsgEcho
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now