Package org.geotools.xml.gml.FCBuffer

Examples of org.geotools.xml.gml.FCBuffer.StopException


            }

            if (featureCollectionBuffer.state <= 0) {
                switch (featureCollectionBuffer.state) {
                case FCBuffer.STOP:
                    throw new StopException(); // alternative to stop()

                case FCBuffer.FINISH:
                    return;

                default:
                    featureCollectionBuffer.state = (featureCollectionBuffer
                        .getCapacity() - featureCollectionBuffer.getSize()) / 3;
                    logger.finest("New State " + featureCollectionBuffer.state
                        + " " + featureCollectionBuffer.getSize());

                    while (featureCollectionBuffer.getSize() > (featureCollectionBuffer
                            .getCapacity() - 1)) {
                        logger.finest("waiting for reader");
                        synchronized (featureCollectionBuffer) {
                            try {
                                featureCollectionBuffer.wait(100);
                            } catch (InterruptedException e) {
                                throw new StopException()// alternative to stop()
                            }
                        }
//                        Thread.yield();
                        if(featureCollectionBuffer.state == FCBuffer.STOP)
                          throw new StopException(); // alternative to stop()
                    }
                }
            } else {
                featureCollectionBuffer.state--;
                logger.finest("New State " + featureCollectionBuffer.state
View Full Code Here


   
    private void checkStatus() throws StopException {
    if (this.hints != null && hints.get(XMLHandlerHints.FLOW_HANDLER_HINT) != null) {
      FlowHandler handler = (FlowHandler) hints.get(XMLHandlerHints.FLOW_HANDLER_HINT);
      if (handler.shouldStop(hints)) {
        throw new StopException();
      }
    }
   
    if (Thread.currentThread().isInterrupted()) {
      throw new StopException();
    }
  }
View Full Code Here

TOP

Related Classes of org.geotools.xml.gml.FCBuffer.StopException

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.