Examples of HttpEvent


Examples of org.jboss.servlet.http.HttpEvent

     */
    public void doFilterEvent(HttpEvent event)
        throws IOException, ServletException {

        if( Globals.IS_SECURITY_ENABLED ) {
            final HttpEvent ev = event;
            try {
                java.security.AccessController.doPrivileged(
                    new java.security.PrivilegedExceptionAction() {
                        public Object run()
                            throws ServletException, IOException {
View Full Code Here

Examples of org.jboss.servlet.http.HttpEvent

                support.fireInstanceEvent(InstanceEvent.BEFORE_FILTER_EVENT,
                        filter, event);
                        */

                if( Globals.IS_SECURITY_ENABLED ) {
                    final HttpEvent ev = event;
                    Principal principal =
                        ev.getHttpServletRequest().getUserPrincipal();

                    Object[] args = new Object[]{ev, this};
                    SecurityUtil.doAsPrivilege
                        ("doFilterEvent", (Filter) filter, cometClassType, args, principal);

                    args = null;
                } else
                    filter.doFilterEvent(event, this);
                }

                /*support.fireInstanceEvent(InstanceEvent.AFTER_FILTER_EVENT,
                        filter, event);*/
            } catch (IOException e) {
                /*
                if (filter != null)
                    support.fireInstanceEvent(InstanceEvent.AFTER_FILTER_EVENT,
                            filter, event, e);
                            */
                throw e;
            } catch (ServletException e) {
                /*
                if (filter != null)
                    support.fireInstanceEvent(InstanceEvent.AFTER_FILTER_EVENT,
                            filter, event, e);
                            */
                throw e;
            } catch (RuntimeException e) {
                /*
                if (filter != null)
                    support.fireInstanceEvent(InstanceEvent.AFTER_FILTER_EVENT,
                            filter, event, e);
                            */
                throw e;
            } catch (Throwable e) {
                /*if (filter != null)
                    support.fireInstanceEvent(InstanceEvent.AFTER_FILTER_EVENT,
                            filter, event, e);*/
                throw new ServletException
                    (sm.getString("filterChain.filter"), e);
            }
            return;
        }

        // We fell off the end of the chain -- call the servlet instance
        try {
            /*
            support.fireInstanceEvent(InstanceEvent.BEFORE_SERVICE_EVENT,
                    servlet, request, response);
                    */
            if( Globals.IS_SECURITY_ENABLED ) {
                final HttpEvent ev = event;
                Principal principal =
                    ev.getHttpServletRequest().getUserPrincipal();
                Object[] args = new Object[]{ ev };
                SecurityUtil.doAsPrivilege("event",
                        servlet,
                        classTypeUsedInEvent,
                        args,
View Full Code Here

Examples of org.jboss.servlet.http.HttpEvent

                            log.warn("No active events to resume with");
                            return;
                        }

                        Iterator<HttpEvent> iter = activeSessEvents.iterator();
                        HttpEvent et;
                        transmitMessages((et = iter.next()).getHttpServletResponse(), queue);
                        iter.remove();
                        et.close();
                    }
                    catch (Exception e) {
                        e.printStackTrace();
                    }
                }
View Full Code Here

Examples of org.jboss.servlet.http.HttpEvent

              log.warn("No active events to resume with");
              return;
            }

            Iterator<HttpEvent> iter = activeSessEvents.iterator();
            HttpEvent et;
            transmitMessages((et = iter.next()).getHttpServletResponse(), queue);
            iter.remove();
            et.close();
          }
          catch (Exception e) {
            e.printStackTrace();
          }
        }
View Full Code Here

Examples of org.jboss.servlet.http.HttpEvent

              log.warn("No active events to resume with");
              return;
            }

            Iterator<HttpEvent> iter = activeSessEvents.iterator();
            HttpEvent et;
            transmitMessages((et = iter.next()).getHttpServletResponse(), queue);
            iter.remove();
            et.close();
          }
          catch (Exception e) {
            e.printStackTrace();
          }
        }
View Full Code Here

Examples of org.jboss.servlet.http.HttpEvent

                            log.warn("No active events to resume with");
                            return;
                        }

                        Iterator<HttpEvent> iter = activeSessEvents.iterator();
                        HttpEvent et;
                        transmitMessages((et = iter.next()).getHttpServletResponse(), queue);
                        iter.remove();
                        et.close();
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            });
View Full Code Here

Examples of org.jboss.servlet.http.HttpEvent

                    continue;
                }
                //we are not implementing forever responses, if the client is connected
                //then we will fire off the message
                //first we check to see if we have any existing connections we can piggy back on
                HttpEvent event = events.poll();
                boolean delivered = false;
                //TODO TODO - check on thread safety, for writing and for getting last request.
                if (event!=null) {
                    synchronized (event) {
                        RequestBase rq = (RequestBase)event.getHttpServletRequest().getAttribute(RequestBase.LAST_REQ_ATTR);
                        if (rq!=null) {
                            Map map = new HashMap();
                            try {
                                map.put(Bayeux.CHANNEL_FIELD,message.getChannel().getId());
                                map.put(Bayeux.DATA_FIELD,message);
                                JSONObject json = new JSONObject(map);
                                if (log.isTraceEnabled()) {
                                    log.trace("Message instantly delivered to remote client["+this+"] message:"+json);
                                }
                                rq.addToDeliveryQueue(this, json);
                                //deliver the batch
                                if (i==(msgs.length-1)) {
                                    rq.deliver(event, this);
                                    event.close(); //todo, figure out a better way, this means only one message gets delivered
                                    removeCometEvent(event); //and delivered instantly
                                }
                                delivered = true;
                            } catch (Exception e) {
                                // TODO: fix
View Full Code Here

Examples of org.jboss.servlet.http.HttpEvent

     */
    public void doFilterEvent(HttpEvent event)
        throws IOException, ServletException {

        if( Globals.IS_SECURITY_ENABLED ) {
            final HttpEvent ev = event;
            try {
                java.security.AccessController.doPrivileged(
                    new java.security.PrivilegedExceptionAction() {
                        public Object run()
                            throws ServletException, IOException {
View Full Code Here

Examples of org.jboss.servlet.http.HttpEvent

                support.fireInstanceEvent(InstanceEvent.BEFORE_FILTER_EVENT,
                        filter, event);
                        */

                if( Globals.IS_SECURITY_ENABLED ) {
                    final HttpEvent ev = event;
                    Principal principal =
                        ev.getHttpServletRequest().getUserPrincipal();

                    Object[] args = new Object[]{ev, this};
                    SecurityUtil.doAsPrivilege
                        ("doFilterEvent", (Filter) filter, cometClassType, args);

                    args = null;
                } else
                    filter.doFilterEvent(event, this);
                }

                /*support.fireInstanceEvent(InstanceEvent.AFTER_FILTER_EVENT,
                        filter, event);*/
            } catch (IOException e) {
                /*
                if (filter != null)
                    support.fireInstanceEvent(InstanceEvent.AFTER_FILTER_EVENT,
                            filter, event, e);
                            */
                throw e;
            } catch (ServletException e) {
                /*
                if (filter != null)
                    support.fireInstanceEvent(InstanceEvent.AFTER_FILTER_EVENT,
                            filter, event, e);
                            */
                throw e;
            } catch (RuntimeException e) {
                /*
                if (filter != null)
                    support.fireInstanceEvent(InstanceEvent.AFTER_FILTER_EVENT,
                            filter, event, e);
                            */
                throw e;
            } catch (Throwable e) {
                /*if (filter != null)
                    support.fireInstanceEvent(InstanceEvent.AFTER_FILTER_EVENT,
                            filter, event, e);*/
                throw new ServletException
                    (sm.getString("filterChain.filter"), e);
            }
            return;
        }

        // We fell off the end of the chain -- call the servlet instance
        try {
            /*
            support.fireInstanceEvent(InstanceEvent.BEFORE_SERVICE_EVENT,
                    servlet, request, response);
                    */
            if( Globals.IS_SECURITY_ENABLED ) {
                final HttpEvent ev = event;
                Principal principal =
                    ev.getHttpServletRequest().getUserPrincipal();
                Object[] args = new Object[]{ ev };
                SecurityUtil.doAsPrivilege("event",
                        servlet,
                        classTypeUsedInEvent,
                        args,
View Full Code Here

Examples of org.jboss.servlet.http.HttpEvent

     */
    public void doFilterEvent(HttpEvent event)
        throws IOException, ServletException {

        if( Globals.IS_SECURITY_ENABLED ) {
            final HttpEvent ev = event;
            try {
                java.security.AccessController.doPrivileged(
                    new java.security.PrivilegedExceptionAction() {
                        public Object run()
                            throws ServletException, IOException {
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.