Examples of SessionState


Examples of org.apache.mina.core.session.SessionState

            if (session == null) {
                // We are done with this queue.
                return;
            }

            SessionState state = getState(session);

            switch (state) {
                case OPENED:
                    updateTrafficControl(session);
View Full Code Here

Examples of org.apache.tapestry5.annotations.SessionState

    public void transform(PlasticClass plasticClass, TransformationSupport support, MutableComponentModel model)
    {
        for (PlasticField field : plasticClass.getFieldsWithAnnotation(SessionState.class))
        {
            SessionState annotation = field.getAnnotation(SessionState.class);

            transform(plasticClass, field, annotation.create());

            field.claim(annotation);
        }
    }
View Full Code Here

Examples of org.jboss.jms.client.state.SessionState

      MethodInvocation mi = (MethodInvocation)invocation;
      boolean transacted = ((Boolean)mi.getArguments()[0]).booleanValue();
      int ackMode = ((Integer)mi.getArguments()[1]).intValue();
      boolean xa = ((Boolean)mi.getArguments()[2]).booleanValue();

      SessionState sessionState =
         new SessionState(connectionState, sessionDelegate, transacted,
                          ackMode, xa, sessionDelegate.getDupsOKBatchSize());

      delegate.setState(sessionState);
      return delegate;
   }
View Full Code Here

Examples of org.jboss.jms.client.state.SessionState

   public Object handleCreateConsumerDelegate(Invocation invocation) throws Throwable
   {
      ClientConsumerDelegate consumerDelegate = (ClientConsumerDelegate)invocation.invokeNext();
      DelegateSupport delegate = (DelegateSupport)consumerDelegate;

      SessionState sessionState = (SessionState)getState(invocation);

      MethodInvocation mi = (MethodInvocation)invocation;
      JBossDestination dest = (JBossDestination)mi.getArguments()[0];
      String selector = (String)mi.getArguments()[1];
      boolean noLocal = ((Boolean)mi.getArguments()[2]).booleanValue();
View Full Code Here

Examples of org.jboss.jms.client.state.SessionState

      // ProducerDelegates are not created on the server

      ProducerDelegate producerDelegate = new ClientProducerDelegate();
      DelegateSupport delegate = (DelegateSupport)producerDelegate;

      SessionState sessionState = (SessionState)getState(invocation);

      MethodInvocation mi = (MethodInvocation)invocation;
      Destination dest = ((Destination)mi.getArguments()[0]);

      ProducerState producerState = new ProducerState(sessionState, producerDelegate, dest);
View Full Code Here

Examples of org.jboss.jms.client.state.SessionState

      MethodInvocation mi = (MethodInvocation)invocation;

      ClientBrowserDelegate browserDelegate = (ClientBrowserDelegate)invocation.invokeNext();
      DelegateSupport delegate = (DelegateSupport)browserDelegate;

      SessionState sessionState = (SessionState)getState(invocation);

      JBossDestination destination = (JBossDestination)mi.getArguments()[0];
      String selector = (String)mi.getArguments()[1];

      BrowserState state =
View Full Code Here

Examples of org.jboss.jms.client.state.SessionState

         }
      }

      m.setJMSDestination(destination);
     
      SessionState sessionState = (SessionState)producerState.getParent();
                 
      // Generate the message id
      ConnectionState connectionState = (ConnectionState)sessionState.getParent();
     
      long id =
         connectionState.getIdGenerator().getId((ConnectionDelegate)connectionState.getDelegate());
   
      JBossMessage messageToSend;
      boolean foreign = false;

      if (!(m instanceof MessageProxy))
      {
         // it's a foreign message

         foreign = true;
        
         // JMS 1.1 Sect. 3.11.4: A provider must be prepared to accept, from a client,
         // a message whose implementation is not one of its own.

         // create a matching JBossMessage Type from JMS Type
         if(m instanceof BytesMessage)
         {
            messageToSend = new JBossBytesMessage((BytesMessage)m,0);
         }
         else if(m instanceof MapMessage)
         {
            messageToSend = new JBossMapMessage((MapMessage)m,0);
         }
         else if(m instanceof ObjectMessage)
         {
            messageToSend = new JBossObjectMessage((ObjectMessage)m,0);
         }
         else if(m instanceof StreamMessage)
         {
            messageToSend = new JBossStreamMessage((StreamMessage)m,0);
         }
         else if(m instanceof TextMessage)
         {
            messageToSend = new JBossTextMessage((TextMessage)m,0);
         }
         else
         {
            messageToSend = new JBossMessage(m, 0);
         }
        
         messageToSend.setJMSMessageID(null);
      }
      else
      {
         // get the actual message
         MessageProxy proxy = (MessageProxy)m;
                                   
         //The following line executed on the proxy should cause a copy to occur
         //if it is necessary
         proxy.setJMSMessageID(null);
        
         //Get the underlying message
         messageToSend = proxy.getMessage();    
        
         proxy.beforeSend();
      }
     
      // Set the new id
     
      messageToSend.setMessageId(id);
     
      // This only really used for BytesMessages and StreamMessages to reset their state
      messageToSend.doBeforeSend();
     
      // now that we know the messageID, set it also on the foreign message, if is the case
      if (foreign)
      {
         m.setJMSMessageID(messageToSend.getJMSMessageID());
      }
           
      // we now invoke the send(Message) method on the session, which will eventually be fielded
      // by connection endpoint
      ((SessionDelegate)sessionState.getDelegate()).send(messageToSend, false);
     
      return null;
   }
View Full Code Here

Examples of org.jboss.jms.client.state.SessionState

      ConsumerDelegate consumerDelegate = (ConsumerDelegate)invocation.invokeNext();

      boolean isCC = ((Boolean)mi.getArguments()[4]).booleanValue();

      // Create the message handler
      SessionState sessionState =
         (SessionState)((DelegateSupport)invocation.getTargetObject()).getState();
      ConnectionState connectionState = (ConnectionState)sessionState.getParent();
      SessionDelegate sessionDelegate = (SessionDelegate)invocation.getTargetObject();
      ConsumerState consumerState = (ConsumerState)((DelegateSupport)consumerDelegate).getState();
      int consumerID = consumerState.getConsumerID();
      int prefetchSize = consumerState.getBufferSize();
      QueuedExecutor sessionExecutor = sessionState.getExecutor();
      int maxDeliveries = consumerState.getMaxDeliveries();
     
      //We need the queue name for recovering any deliveries after failover
      String queueName = null;
      if (consumerState.getSubscriptionName() != null)
      {
         queueName = MessageQueueNameHelper.
            createSubscriptionName(connectionState.getClientID(),
                                   consumerState.getSubscriptionName());
      }
      else if (consumerState.getDestination().isQueue())
      {
         queueName = consumerState.getDestination().getName();
      }
     
      MessageCallbackHandler messageHandler =
         new MessageCallbackHandler(isCC, sessionState.getAcknowledgeMode(),
                                    sessionDelegate, consumerDelegate, consumerID, queueName,
                                    prefetchSize, sessionExecutor, maxDeliveries);
     
      sessionState.addCallbackHandler(messageHandler);
     
      CallbackManager cm = connectionState.getRemotingConnection().getCallbackManager();
      cm.registerHandler(consumerID, messageHandler);
        
      consumerState.setMessageCallbackHandler(messageHandler);
View Full Code Here

Examples of org.jboss.jms.client.state.SessionState

     
      // First we call close on the messagecallbackhandler which waits for onMessage invocations     
      // to complete and the last delivery to arrive
      consumerState.getMessageCallbackHandler().close(lastDeliveryId);
               
      SessionState sessionState = (SessionState)consumerState.getParent();
      ConnectionState connectionState = (ConnectionState)sessionState.getParent();
                
      sessionState.removeCallbackHandler(consumerState.getMessageCallbackHandler());

      CallbackManager cm = connectionState.getRemotingConnection().getCallbackManager();
      cm.unregisterHandler(consumerState.getConsumerID());
        
      //And then we cancel any messages still in the message callback handler buffer    
View Full Code Here

Examples of org.jboss.jms.client.state.SessionState

  
   // XASession implementation
  
   public Session getSession() throws JMSException
   {     
      SessionState state = (SessionState)((DelegateSupport)delegate).getState();
      if (!state.isXA())
      {
         throw new IllegalStateException("Isn't an XASession");
      }
     
      return this;
View Full Code Here
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.