Package net.timewalker.ffmq3.common.session

Examples of net.timewalker.ffmq3.common.session.AbstractSession


   
        int total = 0;
        Iterator sessionsIterator = sessions.values().iterator();
      while (sessionsIterator.hasNext())
      {
        AbstractSession session = (AbstractSession)sessionsIterator.next();
        total += session.getProducersCount();
      }
      return total;
    }
    }
View Full Code Here


      {
        int pos = 0;
        Iterator sessionsIterator = sessions.values().iterator();
        while (sessionsIterator.hasNext())
        {
          AbstractSession session = (AbstractSession)sessionsIterator.next();
          if (pos++ > 0)
            sb.append(",");
          session.getEntitiesDescription(sb);
        }
      }
    }
    sb.append("}");
  }
View Full Code Here

            final NotificationPacket notifPacket = (NotificationPacket)packet;
            final AbstractMessage prefetchedMessage = notifPacket.getMessage();
           
            boolean acceptedByConsumer = false;
               
        AbstractSession session = lookupRegisteredSession(notifPacket.getSessionId());
            if (session != null)
            {                  
                RemoteMessageConsumer consumer = (RemoteMessageConsumer)session.lookupRegisteredConsumer(notifPacket.getConsumerId());
                if (consumer != null)   
                    acceptedByConsumer = consumer.addToPrefetchQueue(prefetchedMessage,notifPacket.getPrefetchCapacity());
                else
                  log.debug("#"+id+" No such consumer : #"+notifPacket.getSessionId()+":"+notifPacket.getConsumerId()); // Consumer was concurrently closed or not yet registered
            }
View Full Code Here

    protected final AbstractSession getSession() throws JMSException
    {
        if (sessionRef == null)
            throw new FFMQException("Message has no associated session","CONSISTENCY");
       
        AbstractSession session = (AbstractSession)sessionRef.get();
        if (session == null)
            throw new FFMQException("Message session is no longer valid","CONSISTENCY");
       
        return session;
    }
View Full Code Here

    /* (non-Javadoc)
     * @see javax.jms.Message#acknowledge()
     */
    public final void acknowledge() throws JMSException
    {
        AbstractSession session = getSession();
       
        int acknowledgeMode = session.getAcknowledgeMode();
        if (acknowledgeMode != Session.CLIENT_ACKNOWLEDGE)
            return; // Ignore [JMS SPEC]
       
        session.acknowledge();      
    }
View Full Code Here

                                                TestUtils.TEST_SERVER_PORT,
                                                settings);
            }
            else
            {
                listener = new TcpListener(engine,
                                           FFMQConstants.DEFAULT_SERVER_HOST,
                                           TestUtils.TEST_SERVER_PORT,
                                           settings);
            }
           
View Full Code Here

          if (isRemote())
          {
            boolean useNIO = settings.getBooleanProperty("listener.tcp.useNIO",false);
            if (useNIO)
            {
              listener = new NIOTcpListener(engine,
                                                FFMQConstants.DEFAULT_SERVER_HOST,
                                                TestUtils.TEST_SERVER_PORT,
                                                settings);
            }
            else
View Full Code Here

          hasCreatedASession = true;
          ActivityWatchdog.getInstance().unregister(this);
        }
       
        // Use an internal hook to bridge the local session to the remote peer
        localSession.setNotificationProxy(new RemoteNotificationProxy(localSession.getId(),transport));
       
        return new CreateSessionResponse();
    }
View Full Code Here

          catch (JMSException e)
          {
              // Ignore
          }
         
          engine = new FFMQEngine(TestUtils.LOCAL_ENGINE_NAME,settings,null);
          engine.deploy();
         
//          engine.deleteQueue("TEST1");
//          engine.deleteQueue("TEST2");
//          engine.deleteTopic("TEST1");
View Full Code Here

   
    protected final void initDestination() throws JMSException
    {
        // Security : a consumer destination may only be set at creation time
        //            so we check permissions here once and for all.
        LocalConnection conn = (LocalConnection)session.getConnection();
        if (conn.isSecurityEnabled())
        {
            if (destination instanceof Queue)
            {
                String queueName = ((Queue)destination).getQueueName();
                if (conn.isRegisteredTemporaryQueue(queueName))
                {
                    // OK, temporary destination
                }
                else
                if (queueName.equals(FFMQConstants.ADM_REQUEST_QUEUE))
                {
                    // Only the internal admin thread can consume on this queue
                    if (conn.getSecurityContext() != null)
                        throw new FFMQException("Access denied to administration queue "+queueName,"ACCESS_DENIED");
                }
                else
                if (queueName.equals(FFMQConstants.ADM_REPLY_QUEUE))
                {
                    conn.checkPermission(Resource.SERVER, Action.REMOTE_ADMIN);
                }
                else
                {
                    // Standard queue
                    conn.checkPermission(destination,Action.CONSUME);
                }
            }
            else
            if (destination instanceof Topic)
            {
                String topicName = ((Topic)destination).getTopicName();
                if (conn.isRegisteredTemporaryTopic(topicName))
                {
                    // OK, temporary destination
                }
                else
                {
                    // Standard topic
                    conn.checkPermission(destination,Action.CONSUME);
                }
            }
        }
       
        // Lookup a local destination object from the given reference
View Full Code Here

TOP

Related Classes of net.timewalker.ffmq3.common.session.AbstractSession

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.