Examples of Context


Examples of com.sun.enterprise.tools.verifier.Context

  if ((descriptor instanceof EjbSessionDescriptor) ||
      (descriptor instanceof EjbEntityDescriptor)) {
      try {
    Context context = getVerifierContext();
    ClassLoader jcl = context.getClassLoader();
    Class c = Class.forName(getClassName(descriptor), false, jcl);
    str = getSuperInterface();
                if (isImplementorOf(c, str)) {
        // it extends the proper EJBHome
        result.addGoodDetails(smh.getLocalString
View Full Code Here

Examples of com.sun.grizzly.Context

    /*
     * 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;
       
        /*
         * Paranoid check to fail early.
         */
        if (byteBuffer.position() == 0 || responseHandler == null
                || clientKey == null ) {
            ctx.getSelectorHandler().register(febeSelectionKey,
                    SelectionKey.OP_READ);
            return;
        }
        /* Parsed is an instance variable whose value has to be preserved
         * until the lifecycle of the callback handler.
         */
        if (!parsed) {
            while (!responseHandler.parse(byteBuffer)) {
                if (_logger.isLoggable(Level.FINE)) {
                    _logger.log(Level.FINE,
                            "clb.proxy.callback_algorithm_parse_false");
                }
                if (!readFromFeBeChannel(ctx)) {
                    return;
                }
            }
            parsed = true;
        } else {
            byteBuffer.flip();
        }
        SocketChannel clientChannel = null;
        if (clientKey != null){
            clientChannel = (SocketChannel)clientKey.channel();
        }
       
        if (_logger.isLoggable(Level.FINEST)) {
            _logger.log(Level.FINEST, "clb.proxy.callback.algorithm_finished",
                    clientChannel.socket().getRemoteSocketAddress());
            _logger.log(Level.FINEST, "clb.proxy.callback_clientkey",
                    clientKey.channel());
            _logger.log(Level.FINEST, "clb.proxy.callback.server_channel",
                    ctx.getSelectionKey().channel());
            _logger.log(Level.FINEST, "Byte Buffer " + byteBuffer);
            try {
                dumpBuffer(byteBuffer);
            } catch (Exception e) {
                //ignore
            }
        }
       
        long byteswritten = 0;
        int iPos = byteBuffer.position();
        int iLimit = byteBuffer.limit();
        int bytesToBeWritten = byteBuffer.remaining();       
        boolean writeSuccess = true;
        /*
         * If we have the bytes ready write it to the client
         */
       
        if ((clientChannel != null) && (clientChannel.isConnected())) {
            try {
                if (isSecure) {
                    if (_logger.isLoggable(Level.FINEST)) {
                        _logger.log(Level.FINEST,
                                "clb.proxy.callback.ssl_writer",
                                clientChannel + " " + byteBuffer + " " +
                                outputBB + " " + sslEngine);
                    }
                    byteswritten = SSLOutputWriter.flushChannel(clientChannel,
                            byteBuffer, outputBB, sslEngine);
                } else {
                    byteswritten = OutputWriter.flushChannel(clientChannel,
                            byteBuffer);
                }
            } catch (Exception ioe) {
                /*
                 * If write fails then close client and update the response
                 * handler. We have to drop the response because we cannot send
                 * it through another channel.
                 */
                writeSuccess = false;
                responseHandler.updateBytesWritten(bytesToBeWritten);
                byteBuffer.position(iPos);
                byteBuffer.limit(iLimit);               
            }
            if (responseHandler.isTransferEncoding()) {
                if (_logger.isLoggable(Level.FINE)) {
                    _logger.log(Level.FINE, "Transfer encoding Byte buffer " +
                            byteBuffer);
                }
                /**
                 * It is quite inefficient to search for termination in the whole
                 * bytebuffer, Needs to be modified
                 */
                responseHandler.updateEnd((ByteBuffer) byteBuffer.flip());
            } else {
                responseHandler.updateBytesWritten(byteswritten);
            }

        } else {
            _logger.log(Level.SEVERE,
                    "clb.proxy.callback_client_channel_closed");
            writeSuccess = false;
        }
        if (byteBuffer != null) {
            byteBuffer.clear();
        }               
        boolean register = false;
        if (outputBB != null) {
            outputBB.clear();
       
        if (responseHandler.hasRemaining()) {
            /*
             * If write to client failed and there is still more data
             * to be read from the backend we cannot re-use the febe channel
             * anymore.
             */
            if (!writeSuccess) {
                cleanFeBeHandler(ctx.getSelectorHandler(),
                        febeSelectionKey);
                connectionManager.removeClientEndpoint(clientKey);
                connectionManager.cancelClientKey(clientKey);
            } else {
                register = true;
            }          
            if (_logger.isLoggable(Level.FINEST)) {
                _logger.log(Level.FINEST,
                        "clb.proxy.callback.algorithm_more_data",
                        clientChannel.socket().getRemoteSocketAddress());
            }
        } else {                        
            /* keep the key registered because it can be closed by the
             * peer when in the cache, when this happens the read will
             * will be invoked and we can close the channel. We dont have to
             * keep it registered when keep alive is disabled because we
             * can  be sure that the channel will not be closed. 
             */           
            register = true;
            // refactor
            if (!writeSuccess){
                /*
                 * Close only the client because we can re-use febe channel
                 */
                connectionManager.removeClientEndpoint(clientKey);
                connectionManager.cancelClientKey(clientKey);
            }    
           
            if (!keepAlive) {
                if (_logger.isLoggable(Level.FINEST)) {
                    _logger.log(Level.FINEST,
                            "clb.proxy.callback.algorithm_cancelled_key",
                            clientChannel.socket().getRemoteSocketAddress());
                }
                connectionManager.cancelClientKey(clientKey);
            } else {
                if (_logger.isLoggable(Level.FINEST)) {
                    _logger.log(Level.FINEST,
                            "clb.proxy.callback.algorithm_registered_key",
                            clientChannel.socket().getRemoteSocketAddress());
                }
                connectionManager.registerClientKey(clientKey);               
            }
           
            release();
        }
         if (register) {
            ctx.getSelectorHandler().register(febeSelectionKey,
                    SelectionKey.OP_READ);
        }
       
    }
View Full Code Here

Examples of com.sun.jsftemplating.util.fileStreamer.Context

  // Create dummy UIViewRoot
  UIViewRoot root = new UIViewRoot();
  root.setRenderKitId("dummy");

  // Setup the FacesStreamerContext
  Context fsContext = new FacesStreamerContext(context);
  fsContext.setAttribute(Context.FILE_PATH, path);

  // Get the HttpServletResponse
  Object obj = context.getExternalContext().getResponse();
  HttpServletResponse resp = null;
  if (obj instanceof HttpServletResponse) {
      resp = (HttpServletResponse) obj;

      // We have an HttpServlet response, do some extra stuff...
      // Check the last modified time to see if we need to serve the resource
      long mod = fsContext.getContentSource().getLastModified(fsContext);
      if (mod != -1) {
    long ifModifiedSince = ((HttpServletRequest)
      context.getExternalContext().getRequest()).
      getDateHeader("If-Modified-Since");
    // Round down to the nearest second for a proper compare
View Full Code Here

Examples of com.sun.tools.javac.util.Context

    public JavacFileManager getStandardFileManager(
        DiagnosticListener<? super JavaFileObject> diagnosticListener,
        Locale locale,
        Charset charset) {
        Context context = new Context();
        context.put(Locale.class, locale);
        if (diagnosticListener != null)
            context.put(DiagnosticListener.class, diagnosticListener);
        PrintWriter pw = (charset == null)
                ? new PrintWriter(System.err, true)
                : new PrintWriter(new OutputStreamWriter(System.err, charset), true);
        context.put(Log.outKey, pw);
        return new JavacFileManager(context, true, charset);
    }
View Full Code Here

Examples of com.tinkerpop.gremlin.server.Context

    }

    @Override
    protected void decode(final ChannelHandlerContext channelHandlerContext, final RequestMessage msg,
                          final List<Object> objects) throws Exception {
        final Context gremlinServerContext = new Context(msg, channelHandlerContext, settings,
                graphs, gremlinExecutor, this.scheduledExecutorService);
        try {
            // choose a processor to do the work based on the request message.
            final Optional<OpProcessor> processor = OpLoader.getProcessor(msg.getProcessor());
View Full Code Here

Examples of context.Context

        if((!ALIGN_AND_DISTRIBUTION_SERVICE_NAME.equals(name))||(!FComponent.class.equals(type)))
            throw new IllegalParameterException("IllegalParameterException");

        AlignAndDistService alignAndDistService = new AlignAndDistService();

        Context cont = alignAndDistService.getContext();
        ActionMap actionMap = alignAndDistService.getActionMap();

        Hashtable interfaces = new Hashtable();
        Hashtable classes = new Hashtable();
View Full Code Here

Examples of de.crowdcode.kissmda.core.Context

  public void testCreateFile() throws IOException {
    String fileContent = "Hello Junit Test.";
    String directory = "de/kissmda/test";
    String fileName = "readme.txt";

    Context context = mock(Context.class);
    when(context.getTargetModel()).thenReturn(
        "target/generated-test-sources/resources");

    fileWriter.createFile(context, directory, fileName, fileContent);

    verify(context).getTargetModel();
View Full Code Here

Examples of de.devbliss.apitester.Context

    private Context doGetRequest(URI uri) throws Exception {
        return apiTest.get(uri);
    }

    protected ApiResponse makeGetRequest(URI uri) throws Exception {
        Context context = doGetRequest(uri);
        sayRequest(context.apiRequest);
        docTestMachine.sayResponse(context.apiResponse, headersToShow);
        return context.apiResponse;
    }
View Full Code Here

Examples of de.innovationgate.ext.org.mozilla.javascript.Context

    public String getClassName() {
        return "ContextRedirector";
    }

    public Scriptable getParentScope() {
        Context context = Context.getCurrentContext();
        return WGAGlobal.fetchRootScope(context);
    }
View Full Code Here

Examples of de.willuhn.jameica.bookmark.Context

   
    List<Bookmark> bookmarks = service.getBookmarks();
    for (int i=0;i<bookmarks.size();++i)
    {
      Bookmark b = bookmarks.get(i);
      Context c = b.getContext();
      if (c == null)
        continue;
     
      String cClassName = c.getClassName();
      if (cClassName == null || !cClassName.equals(className))
        continue;

      String cId = c.getId();
      if (cId != null && cId.equals(id))
      {
        service.delete(b);
        // hier kein Break, weil eine Entity auf mehreren Seiten gebookmarkt
        // sein kann. Zum Beispiel ein Umsatz in UmsatzDetail und in UmsatzEditDetail
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.