Package net.timewalker.ffmq3.transport

Examples of net.timewalker.ffmq3.transport.PacketTransportException


            return socketChannel;
        }
        catch (Exception e)
        {
            log.error("#"+id+" could not connect to "+host+":"+port,e);
            throw new PacketTransportException("Could not connect to "+host+":"+port+" : "+e.toString());
        }
    }
View Full Code Here


   * @see net.timewalker.ffmq3.transport.PacketTransport#send(net.timewalker.ffmq3.transport.packet.AbstractPacket)
   */
  public void send(AbstractPacket packet) throws PacketTransportException
  {
    if (closed)
      throw new PacketTransportException("Transport is closed");
   
    lastSendActivity = System.currentTimeMillis();
   
    boolean wakeUpRequired;
    synchronized (sendQueue)
    {
      if (sendQueueMaxSize > 0 && sendQueue.size() >= sendQueueMaxSize)
        throw new PacketTransportException("Send queue overflow (size="+sendQueueMaxSize+")");
     
      wakeUpRequired = sendQueue.isEmpty();
      sendQueue.add(packet);
    }
   
View Full Code Here

    public void send(AbstractPacket packet) throws PacketTransportException
    {
      synchronized (sendQueue)
    {
        if (sendQueueMaxSize > 0 && sendQueue.size() >= sendQueueMaxSize)
        throw new PacketTransportException("Send queue overflow (size="+sendQueueMaxSize+")");
       
        sendQueue.addLast(packet);
    }
      waitLock.release();     
    }
View Full Code Here

    {
        synchronized (sendQueue)
        {
            int len = packets.size();
            if (sendQueueMaxSize > 0 && sendQueue.size() > sendQueueMaxSize+len)
                throw new PacketTransportException("Send queue overflow (size="+sendQueueMaxSize+")");
           
            for (int i = 0 ; i < len ; i++)
                sendQueue.addLast(packets.get(i));
        }
        waitLock.release();
View Full Code Here

            return socket;
        }
        catch (Exception e)
        {
            log.error("#"+id+" could not connect to "+host+":"+port+" (timeout="+connectTimeout+"s)",e);
            throw new PacketTransportException("Could not connect to "+host+":"+port+" : "+e.toString());
        }
    }
View Full Code Here

            receiverThread.waitForStartup();
        }
        catch (Exception e)
        {
            log.error("#"+id+" cannot start TCP packet I/O handlers",e);
            throw new PacketTransportException("Cannot start TCP packet I/O handlers : "+e.toString());
        }
    }
View Full Code Here

     * @see net.timewalker.ffmq3.remote.transport.PacketTransport#send(net.timewalker.ffmq3.remote.transport.packet.AbstractPacket)
     */
    public void send( AbstractPacket packet ) throws PacketTransportException
    {
        if (closed)
         throw new PacketTransportException("Transport is closed");
       
        sender.send(packet);
    }
View Full Code Here

          {
            PropertyConfigurator.configure(testSettings);
            log4jConfigured = true;
          }
 
          Settings settings = new Settings(testSettings);
         
          if (listener != null)
          {
              listener.stop();
              listener = null;
          }
      
          try
          {
              FFMQEngine.getDeployedInstance(TestUtils.LOCAL_ENGINE_NAME).undeploy();
          }
          catch (JMSException e)
          {
              // Ignore
          }
         
          engine = new FFMQEngine(TestUtils.LOCAL_ENGINE_NAME,settings,null);
          engine.deploy();
         
//          engine.deleteQueue("TEST1");
//          engine.deleteQueue("TEST2");
//          engine.deleteTopic("TEST1");
//          engine.deleteTopic("TEST2");
         
          queue1 = engine.getLocalQueue("TEST1");
          queue2 = engine.getLocalQueue("TEST2");
          topic1 = engine.getLocalTopic("TEST1");
          topic2 = engine.getLocalTopic("TEST2");
         
          ((LocalQueue)queue1).purge(null);
          ((LocalQueue)queue2).purge(null);
          ((LocalTopic)topic1).resetStats();
          //topic2.resetStats();
         
          if (isRemote())
          {
            boolean useNIO = settings.getBooleanProperty("listener.tcp.useNIO",false);
            if (useNIO)
            {
              listener = new NIOTcpListener(engine,
                                                FFMQConstants.DEFAULT_SERVER_HOST,
                                                TestUtils.TEST_SERVER_PORT,
View Full Code Here

    }
   
    private Settings createSettings( Message msg ) throws JMSException
    {
        // Fill settings from message headers
        Settings queueSettings = new Settings();
        Enumeration headers = msg.getPropertyNames();
        while (headers.hasMoreElements())
        {
            String propName = (String)headers.nextElement();
            if (propName.startsWith(FFMQAdminConstants.ADM_HEADER_PREFIX))
                continue;
           
            String propValue = msg.getStringProperty(propName);
            queueSettings.setStringProperty(propName, propValue);
        }
        return queueSettings;
    }
View Full Code Here

        return queueSettings;
    }
   
    private String processCreateQueue( Message msg ) throws JMSException
    {
        Settings queueSettings = createSettings(msg);
        QueueDefinition queueDef = new QueueDefinition(queueSettings);
       
        log.debug("Creating queue : "+queueDef);
        engine.createQueue(queueDef);
       
View Full Code Here

TOP

Related Classes of net.timewalker.ffmq3.transport.PacketTransportException

Copyright © 2018 www.massapicom. 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.