Examples of WorkerThread


Examples of com.sun.grizzly.util.WorkerThread

            SelectionKey key = ioEvent.attachment().getSelectionKey();

            try {
                sslConnectorHandler.finishConnect(key);

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

                workerThread.setSSLEngine(sslConnectorHandler.getSSLEngine());

                ThreadAttachment attachment =
                        workerThread.updateAttachment(Mode.SSL_ENGINE);

                key.attach(attachment);

                handshakeAppBuffer = acquireBuffer();
                boolean shake =
View Full Code Here

Examples of com.sun.grizzly.util.WorkerThread

    public TLSResponseDispatcher(SelectorHandler handler, SelectionKey key,
            ByteBufferPool bbPool,
            AsyncWriteCallbackHandler asyncWriteCallbackHandler) {
        super(handler, key, bbPool, asyncWriteCallbackHandler);

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

        currentTA = workerThread.getAttachment();
        sslEngine = currentTA.getSSLEngine();
        if (workerThread.getSSLEngine() != null) {
            expectedOutputBufferSize = workerThread.getSSLEngine().getSession().
                    getPacketBufferSize() * 2;
        }
    }
View Full Code Here

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

Examples of com.sun.grizzly.util.WorkerThread

        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

Examples of com.sun.grizzly.util.WorkerThread

        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

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

        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

Examples of com.workplacesystems.utilsj.threadpool.WorkerThread

                    try
                    {
                        if (event_callback.acceptEvent(event_code))
                        {
                            WorkerThread callback_thread = (WorkerThread)event_callback_pool.borrowObject();
                            callback_thread.execute(new Runnable() {
                                public void run()
                                {
                                    GregorianCalendar event_time = new GregorianCalendar(
                                            Integer.parseInt(event.substring(0, 4)),
                                            Integer.parseInt(event.substring(4, 6)),
View Full Code Here

Examples of com.workplacesystems.utilsj.threadpool.WorkerThread

                    if (sc_callback.isActive())
                    {
                        try
                        {
                            WorkerThread callback_thread = (WorkerThread)sc_callback_pool.borrowObject();
                            callback_thread.execute(new Runnable() {
                                public void run()
                                {
                                    sc_callback.processStatusChange(CGateSession.this, status_change);
                                }
                            }, null);
View Full Code Here

Examples of edu.ucla.sspace.util.WorkerThread

        // Set up the concurrent data structures so we can process the documents
        // concurrently
        final BlockingQueue<Runnable> workQueue =
            new LinkedBlockingQueue<Runnable>();
        for (int i = 0; i < Runtime.getRuntime().availableProcessors(); ++i) {
            Thread t = new WorkerThread(workQueue);
            t.start();
        }
        final Semaphore termsProcessed = new Semaphore(0);
       
        for (int termIndex = 0; termIndex < uniqueTerms; ++termIndex) {
           
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.