Package com.sun.grizzly.util

Examples of com.sun.grizzly.util.WorkerThread


         * Attach may not be required for async, required only for sync
         * write.
         */
        if (enableTlsSyncWrite) {
            if (Thread.currentThread() instanceof WorkerThread) {
                WorkerThread workerThread =
                        (WorkerThread) Thread.currentThread();

                workerThread.attach(currentTA);

                SSLOutputWriter.flushChannel((SocketChannel) getKey().channel(),
                        bb);
            } else {
                if (logger.isLoggable(Level.WARNING)) {
View Full Code Here


        if (ctx.getProtocol() != Protocol.UDP) {
            return invokeNextFilter;
        }

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

        ByteBuffer buffer = workerThread.getByteBuffer();
        buffer.flip();
        if (buffer.remaining() == 0) {
            return invokeNextFilter;
        }
        try {
View Full Code Here

        Socket s = null;
        InetSocketAddress remoteAddress = null;
        SipServletMessageImpl _message = null;
        boolean invokeNextFilter = true;

        final WorkerThread workerThread =
                ((WorkerThread) Thread.currentThread());
        ByteBuffer buffer = workerThread.getByteBuffer();
        SipParser _parser = SipParser.getInstance();
        final Protocol prot = ctx.getProtocol();
        final SelectionKey key = ctx.getSelectionKey();
        final SelectorHandler handler = ctx.getSelectorHandler();
      final ThreadAttachment currentTA = workerThread.getAttachment();

        TargetTuple remote = null;
        InetSocketAddress local = null;
        X509Certificate[] x509Certs = null;
View Full Code Here

            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

        SSLEngine sslEngine = null;
        if (attachment instanceof ThreadAttachment) {
            sslEngine = ((ThreadAttachment) attachment).getSSLEngine();
        }
       
        WorkerThread thread = (WorkerThread) Thread.currentThread();
       
        if (sslEngine == null) {
            return Utils.readWithTemporarySelector(key.channel(),
                    thread.getByteBuffer(), timeout).bytesRead;
        } else {
            // if ssl - try to unwrap secured buffer first
            ByteBuffer byteBuffer = thread.getByteBuffer();
            ByteBuffer securedBuffer = thread.getInputBB();
           
            if (securedBuffer.position() > 0) {
                int initialPosition = byteBuffer.position();
                byteBuffer =
                        SSLUtils.unwrapAll(byteBuffer, securedBuffer, sslEngine);
View Full Code Here

TOP

Related Classes of com.sun.grizzly.util.WorkerThread

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.