Package com.dragome.debugging.messages

Source Code of com.dragome.debugging.messages.ChannelReceiverImpl

/*******************************************************************************
* Copyright (c) 2011-2014 Fernando Petrola
*
* This file is part of Dragome SDK.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
******************************************************************************/
package com.dragome.debugging.messages;

import com.dragome.commons.javascript.ScriptHelper;
import com.dragome.debugging.RemoteScriptHelper;
import com.dragome.remote.entities.DragomeEntityManager;
import com.dragome.services.ServiceLocator;

public final class ChannelReceiverImpl implements Receiver
{
  private SorterMessagesQueue queue= new SorterMessagesQueue();

  {
    ServiceLocator.getInstance().getExecutorService().execute(queue);
  }

  public void messageReceived(String aMessage)
  {
    //    System.out.println("received:" + message);
    int separatorIndex= aMessage.lastIndexOf("|");
    queue.addMessage(Integer.parseInt(aMessage.substring(separatorIndex+1)), aMessage);
  }
  public void reset()
  {
    ScriptHelper.scriptHelperInterface= new RemoteScriptHelper(ServiceLocator.getInstance().getServerSideServiceFactory());
    queue.clear();
    DragomeEntityManager.clear();
  }
}
TOP

Related Classes of com.dragome.debugging.messages.ChannelReceiverImpl

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.