Package java.lang

Examples of java.lang.IllegalStateException


                                                HeuristicMixedException,
                                                HeuristicRollbackException,
                                                SystemException {
        if (onePhase) {
           if (_state != XAState.ENDED) {
               throw new IllegalStateException(toString());
           }
        } else {
           if (!_recovery && _state != XAState.PREPARED && _state != XAState.COMMITTED) {
               throw new IllegalStateException(toString());
           }
        }
        if (_state == XAState.COMMITTED) {
            _logger.log(Level.INFO, _jbr.getString(_jbr.I_ALREADY_COMMITTED, this.toString()));
        }
View Full Code Here


        if (_status == Status.STATUS_MARKED_ROLLBACK) {
            rollback();
            throw new RollbackException(toString());
        }
        if (_status != Status.STATUS_ACTIVE) {
            throw new IllegalStateException(toString());
        }
        if (_associatedXAResources.size() != 0) {
            throw new IllegalStateException(
            "There are undelisted XAResources "+_associatedXAResources+" in "+this)
        }

        boolean onePhase = false;
        if (_participants.size() == 1) {
View Full Code Here

        if (_logger.isLoggable(Level.FINE)) {
            _logger.log(Level.FINE, _tm+" dellistResource "+xaRes+" from "+this);
        }
        if (_status != Status.STATUS_ACTIVE &&
            _status != Status.STATUS_MARKED_ROLLBACK) {
            throw new IllegalStateException(toString());
        }

        XAParticipant party = _participants.get(xaRes);
        if (party == null) {
            throw new IllegalStateException(
            "XAResource "+xaRes+" had not associated to "+this);
        }

        int flags = flag;
        if (_status == Status.STATUS_MARKED_ROLLBACK) {
View Full Code Here

        if (_status ==  Status.STATUS_MARKED_ROLLBACK) {
            throw new RollbackException(toString());
        }

        if (_status != Status.STATUS_ACTIVE) {
            throw new IllegalStateException(toString());
        }

        if (_participants.get(xaRes) != null) {
            throw new IllegalStateException("XAResource "+xaRes+" already enlisted in "+this);
        }

        String rm = null;
        try {
            rm = _tm.getRM(xaRes);
View Full Code Here

        if (_logger.isLoggable(Level.FINE)) {
            _logger.log(Level.FINE, _tm+" rollback "+this);
        }
        if (_status != Status.STATUS_ACTIVE &&
            _status != Status.STATUS_MARKED_ROLLBACK) {
            throw new IllegalStateException(toString());
        }
        if (_associatedXAResources.size() > 0) {
            XAResource[] xars = _associatedXAResources.toArray(new XAResource[]{});
            for (int i = 0;  i < xars.length; i++) {
                try {
View Full Code Here

        getInternalSession().rollback();
    }

    public XAResource getXAResource() {
        if (session == null) {
            throw new IllegalStateException("Session is closed");
        }
        return ((XASession) session).getXAResource();
    }
View Full Code Here

          msg = _queueConsumer.receive(60000);
        else if (_topicConsumer != null)
          msg = _topicConsumer.receive(60000);
        else {
          _isClosed = true;
          throw new IllegalStateException();
        }

        if (msg != null)
          _listener.onMessage(msg);
      } catch (Throwable e) {
View Full Code Here

     * @exception IllegalStateException if you have already called the
     * <code>getWriter</code> method
     **/
    public ServletOutputStream getOutputStream() throws IOException {
        if( writer != null ) {
            throw new IllegalStateException(
                    "Tried to create output stream; writer already exists" );
        }

        if( servletStream == null ) {
            outputStream = new ByteArrayOutputStream();
View Full Code Here

     *                        use this method
     *
     **/
    public java.io.PrintWriter getWriter() throws java.io.IOException {
        if( servletStream != null ) {
            throw new IllegalStateException(
                    "Tried to create writer; output stream already exists" );
        }

        if( writer == null ) {
            stringWriter = new StringWriter();
View Full Code Here

            template = "connectionfactory-activemq.xml";
        } else {
            // webspheremq
            String[] splitted = url.split("/");
            if (splitted.length != 4) {
                throw new IllegalStateException("WebsphereMQ URI should be in the following format: host/port/queuemanager/channel");
            }
           
            properties.put("host", splitted[0]);
            properties.put("port", splitted[1]);
            properties.put("queuemanager", splitted[2]);
View Full Code Here

TOP

Related Classes of java.lang.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.