Examples of WorkerThread


Examples of com.intellij.util.concurrency.WorkerThread

        }
      }
    };

    if (myWorker == null || myWorker.isDisposed()) {
      myWorker = new WorkerThread("AbstractTreeBuilder.Worker", 1);
      myWorker.start();
      if (first) {
        myWorker.addTaskFirst(runnable1);
      }
      else {
View Full Code Here

Examples of com.sun.enterprise.web.connector.grizzly.WorkerThread

     */
    @Override
    public void recycle(){
        if (byteBuffer != null){
            try{
                WorkerThread workerThread = (WorkerThread)Thread.currentThread();   
                workerThread.setByteBuffer(byteBuffer);
            } catch (ClassCastException ex){
                // Avoid failling if the Grizzly extension doesn't support
                // the WorkerThread interface.              
                Logger logger = SSLSelectorThread.logger();
                if (logger.isLoggable(Level.FINEST))
View Full Code Here

Examples of com.sun.grizzly.util.WorkerThread

        newbuf.put(_buffer);
        _buffer = newbuf;
        _buffer.position(savepos-_position);
        _position = 0;

        WorkerThread workerThread = (WorkerThread) Thread.currentThread();
        workerThread.setByteBuffer(_buffer);

        if (_logger.isLoggable(Level.FINEST)) {
            _logger.log(Level.FINEST, "leaving: _position="+_position+", _buffer="+_buffer);
        }
    }
View Full Code Here

Examples of com.sun.grizzly.util.WorkerThread

            throw new IllegalStateException(StompServer.getStompBridgeResources().getKString(
                  StompBridgeResources.X_UNEXPECTED_PARSER_POSITION, _position, _buffer.position()));
        }

        ByteBuffer newbuf = ByteBuffer.allocate(_buffer.capacity());
        WorkerThread workerThread = (WorkerThread) Thread.currentThread();
        workerThread.setByteBuffer(newbuf);
        _buffer = newbuf;
        _position = 0;

        if (_logger.isLoggable(Level.FINEST)) {
            _logger.log(Level.FINEST, "leaving: _position="+_position+", _buffer="+_buffer);
View Full Code Here

Examples of com.sun.grizzly.util.WorkerThread

    private StompProtocolHandler getStompProtocolHandler(Context ctx) {

        StompProtocolHandler sph = null;
        AttributeHolder attr = ctx.getAttributeHolderByScope(Context.AttributeScope.CONNECTION);
        if (attr == null) {
            WorkerThread workerThread = (WorkerThread)Thread.currentThread();
            attr = workerThread.getAttachment();
            ctx.getSelectionKey().attach(attr);
        }
        sph = (StompProtocolHandler)attr.getAttribute(STOMP_PROTOCOL_HANDLER_ATTR);
        if (sph == null) {
            sph = new StompProtocolHandler(_bc, _jmsprop);
View Full Code Here

Examples of com.sun.grizzly.util.WorkerThread

    private StompProtocolHandler getStompProtocolHandler(Context ctx) {

        StompProtocolHandler sph = null;
        AttributeHolder attr = ctx.getAttributeHolderByScope(Context.AttributeScope.CONNECTION);
        if (attr == null) {
            WorkerThread workerThread = (WorkerThread)Thread.currentThread();
            attr = workerThread.getAttachment();
            ctx.getSelectionKey().attach(attr);
        }
        sph = (StompProtocolHandler)attr.getAttribute(STOMP_PROTOCOL_HANDLER_ATTR);
        if (sph == null) {
            sph = new StompProtocolHandler(_bc, _jmsprop);
View Full Code Here

Examples of com.sun.grizzly.util.WorkerThread

            this.parser = parser;
        }
       
        public boolean execute(Context ctx) throws IOException
        {
            WorkerThread workerThread =
                    (WorkerThread)Thread.currentThread();

            // Use Jetty's ByteBuffer
            ByteBuffer bb = ((NIOBuffer)parser.getHeaderBuffer()).getByteBuffer();
            workerThread.setByteBuffer(bb);
            return super.execute(ctx);
        }       
View Full Code Here

Examples of com.sun.grizzly.util.WorkerThread

     * Method invoked when the read event is selected for this channel.
     */
    public void onRead(IOEvent<Context> ioEvent) {
        Context ctx = ioEvent.attachment();
        ByteBuffer byteBuffer = null;
        WorkerThread workerThread = (WorkerThread) Thread.currentThread();
        byteBuffer = workerThread.getByteBuffer();
        SelectionKey febeSelectionKey = ctx.getSelectionKey();       
        if (!readFromFeBeChannel(ctx)) {
            return;
       
        /*
 
View Full Code Here

Examples of com.sun.grizzly.util.WorkerThread

                ctx.setKeyRegistrationState(KeyRegistrationState.CANCEL);

                return false;
            }

            WorkerThread workerThread = (WorkerThread) Thread.currentThread();

            // Re-size the ByteBuffer based on the underlying OS buffer.
            if (workerThread.getByteBuffer().capacity() != bufferSize) {
                if (receiveBufferSizeInBytes <= 0) {
                    try {
                        if (ctx.getProtocol() == Protocol.TCP) {
                            bufferSize = ((SocketChannel) channel).socket().
                                    getReceiveBufferSize();
                        } else {
                            bufferSize = ((DatagramChannel) channel).socket().
                                    getReceiveBufferSize();
                        }
                    } catch (IOException ex) {
                        if (logger.isLoggable(Level.WARNING)) {
                            logger.log(Level.WARNING,
                                    "sip.stack.network.resize_buffer_failed_bad_Socket_state");

                            logger.log(Level.WARNING, ex.getMessage(), ex);
                        }

                        bufferSize = DEFAULT_RECEIVE_BB_SIZE;
                    }
                } else {
                    bufferSize = receiveBufferSizeInBytes;
                }

                if (logger.isLoggable(Level.FINE)) {
                    logger.log(Level.FINE, "sip.stack.network.receivee_buffer",
                            bufferSize);
                }

                workerThread.setByteBuffer(ByteBuffer.allocate(bufferSize));
            }

            boolean invokeNextFilter = super.execute(ctx);

            if (!invokeNextFilter) {
View Full Code Here

Examples of com.sun.grizzly.util.WorkerThread

            if (!channel.isOpen()) {
                ctx.setKeyRegistrationState(KeyRegistrationState.CANCEL);

                return false;
            }
            WorkerThread workerThread = (WorkerThread) Thread.currentThread();
            if (workerThread.getByteBuffer().capacity() != bufferSize) {
                if (receiveBufferSizeInBytes <= 0) {
                    try {
                        bufferSize = ((SocketChannel) channel).socket().
                                getReceiveBufferSize();
                    } catch (IOException ex) {
                        if (logger.isLoggable(Level.WARNING)) {
                            logger.log(Level.WARNING,
                                    "sip.stack.network.resize_buffer_failed_bad_Socket_state");
                            logger.log(Level.WARNING, ex.getMessage(), ex);
                        }
                        bufferSize = DEFAULT_RECEIVE_BB_SIZE;
                    }
                } else {
                    bufferSize = receiveBufferSizeInBytes;
                }

                if (logger.isLoggable(Level.FINE)) {
                    logger.log(Level.FINE, "sip.stack.network.receivee_buffer",
                            bufferSize);
                }
                workerThread.setByteBuffer(ByteBuffer.allocate(bufferSize));
                inputBBSize = bufferSize;
            }

            boolean continueExecution = super.execute(ctx);
            if (continueExecution) {
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.