Package javax.jms

Examples of javax.jms.IllegalStateException


      }
   }

   public TopicConnection createTopicConnection() throws JMSException {
      if (this.forQueues)
         throw new IllegalStateException(ME + ".createTopicConnection", "You can not create TopicConnection objects from a QueueConnectionFactory");
      try {
         return new XBConnection(getConnectQos(null, null), this.metaData, false);
      }
      catch (XmlBlasterException ex) {
         throw new XBException(ex, ME + ".createTopicConnection");
View Full Code Here


      }
   }

   public QueueConnection createQueueConnection() throws JMSException {
      if (!this.forQueues)
         throw new IllegalStateException(ME + ".createQueueConnection", "You can not create TopicConnection objects from a TopicConnectionFactory");
      try {
         return new XBConnection(getConnectQos(null, null), this.metaData, true);
      }
      catch (XmlBlasterException ex) {
         throw new XBException(ex, ME + ".createQueueConnection");
View Full Code Here

   }

   public TopicConnection createTopicConnection(String userName, String password)
      throws JMSException {
      if (this.forQueues)
         throw new IllegalStateException(ME + ".createTopicConnection", "You can not create TopicConnection objects from a QueueConnectionFactory");
      try {
         return new XBConnection(getConnectQos(userName, password), this.metaData, false);
      }
      catch (XmlBlasterException ex) {
         throw new XBException(ex, ME + ".createTopicConnection");
View Full Code Here

   }

   public QueueConnection createQueueConnection(String userName, String password)
      throws JMSException {
      if (!this.forQueues)
         throw new IllegalStateException(ME + ".createQueueConnection", "You can not create TopicConnection objects from a TopicConnectionFactory");
      try {
         return new XBConnection(getConnectQos(userName, password), this.metaData, true);
      }
      catch (XmlBlasterException ex) {
         throw new XBException(ex, ME + ".createQueueConnection");
View Full Code Here

         log.finer("constructor");
   }
  
   final void checkClosed() throws JMSException {
      if (this.closed)
         throw new IllegalStateException("No operation is permitted on the Connection since in state 'closed'");
   }
View Full Code Here

     
   public TopicSession createTopicSession(boolean transacted, int ackMode)
      throws JMSException {
      checkClosed();
      if (this.forQueues)
         throw new IllegalStateException(ME + ".createTopicSession", "this is a QueueConnection: use TopicConnection to invoke this method");
      // XBTopicSession session = new XBTopicSession(cloneConnectQos(this.connectQos), ackMode, transacted);
      XBTopicSession session = new XBTopicSession(this, ackMode, transacted);
      initSession("createTopicSession", session, transacted, ackMode);
      return session;
      /*
 
View Full Code Here

   public QueueSession createQueueSession(boolean transacted, int ackMode)
      throws JMSException {
      checkClosed();
      if (!this.forQueues)
         throw new IllegalStateException(ME + ".createQueueSession", "this is a TopicConnection: use QueueConnection to invoke this method");
      // XBQueueSession session = new XBQueueSession(cloneConnectQos(this.connectQos), ackMode, transacted);
      XBQueueSession session = new XBQueueSession(this, ackMode, transacted);
      initSession("createQueueSession", session, transacted, ackMode);
      return session;
      /*
 
View Full Code Here

   public synchronized void setClientID(String loginName) throws JMSException {
      if (log.isLoggable(Level.FINER))
         log.finer("setClientID '" + loginName + "'");
      if (!this.stillVirgin) {
         throw new IllegalStateException(ME + ".setClientID: the clientId cannot be set since you made already invocations on this connection");
      }
      String oldId = getClientID();
      if (oldId != null && oldId.length() > 0) {
         throw new IllegalStateException(ME + ".setClientID: the clientId cannot be set since the administrator has already set an id to this connection via the Connection Factory");
      }
      // TODO check if the userId is already connected. If yes, then an IllegalStateException must be thrown
      this.connectQos.getSecurityQos().setUserId(loginName);
   }
View Full Code Here

   protected final void checkIfOpen(String methodName) throws JMSException {
      if (log.isLoggable(Level.FINER))
         log.finer(methodName);
      if (!this.open)
         throw new IllegalStateException(ME + "." + methodName, "the session has been closed, operation '" + methodName + "' not permitted");
   }
View Full Code Here

   // callback queue only messages coming from a given subscription
   public Message receive(long delay) throws JMSException {
      checkIfOpen("receive");
      this.session.checkControlThread();
      if (this.session.getSyncMode() == XBSession.MODE_ASYNC)
         throw new IllegalStateException(ME + ".receive: you have set a messageListener for this session so synchronous message consumption is currently not allowed");
      try {
         this.session.setSyncMode(XBSession.MODE_SYNC); // to disallow invocation of updates
         // query with a given GetQos ...        
         // TODO cache the queryKey here
         GetQos getQos = new GetQos(this.global);
View Full Code Here

TOP

Related Classes of javax.jms.IllegalStateException

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.