Package org.directwebremoting

Examples of org.directwebremoting.ServerContext


 
  public String cos(){
    WebContext webContext = WebContextFactory.get();
    ServletContext servletContext = webContext.getServletContext();

    ServerContext serverContext = ServerContextFactory.get(servletContext);
    Iterator iterator = serverContext.getAllScriptSessions().iterator();
    String currentPage = webContext.getCurrentPage();
    serverContext.getScriptSessionsByPage(currentPage);
    while(iterator.hasNext()){
      ScriptProxy proxy = new ScriptProxy((ScriptSession) iterator.next());
      proxy.addFunctionCall("redirect");
    }
   
View Full Code Here


  @SuppressWarnings("deprecation")
  public void onApplicationEvent(ApplicationEvent event) {
    //����¼�������ChatMessageEvent��ִ���������
        if (event instanceof ChatMessageEvent) {
            Message msg = (Message) event.getSource();
            ServerContext context = ServerContextFactory.get();
            //��ÿͻ�������chatҳ��script session������
            Collection<ScriptSession> sessions = context.getScriptSessionsByPage(((ServerContext) ctx).getContextPath() + "/chat.jsp");
            for (ScriptSession session : sessions) {
                ScriptBuffer sb = new ScriptBuffer();
                Date time = msg.getTime();
                @SuppressWarnings("deprecation")
        String s = time.getYear() + "-" + (time.getMonth() + 1) + "-" +  time.getDate() + " "
View Full Code Here

            //���û�id��ҳ��ű�session�� 
            this.setScriptSessionFlag(user.getUserid())
       
        //���DWR������ 
        ServletContext sc = request.getSession().getServletContext()
        ServerContext sctx = ServerContextFactory.get(sc)
        //��õ�ǰ��� index.jsp ҳ������нű�session 
        //Collection sessions = sctx.getScriptSessionsByPage("/ind.jsp"); 
        Collection sessions = sctx.getScriptSessionsByPage("/fly-web/ind.jsp")
        Util util = new Util(sessions)
        //������Щҳ���е�һЩԪ�� 
        util.removeAllOptions("users")
        util.addOptions("users", users, "username")
        util.removeAllOptions("receiver")
View Full Code Here

            //���û�id��ҳ��ű�session�� 
            this.setScriptSessionFlag(user.getUserid())
       
        //���DWR������ 
        ServletContext sc = request.getSession().getServletContext()
        ServerContext sctx = ServerContextFactory.get(sc)
        //��õ�ǰ��� index.jsp ҳ������нű�session 
        //Collection sessions = sctx.getScriptSessionsByPage("/ind.jsp"); 
        Collection sessions = sctx.getScriptSessionsByPage("/fly-web/ind.jsp")
        Util util = new Util(sessions)
        //������Щҳ���е�һЩԪ�� 
        util.removeAllOptions("users")
        util.addOptions("users", users, "username")
        util.removeAllOptions("receiver")
View Full Code Here

    {
        this.destination = destination;
        setMessageSelector(messageSelector);
        this.noLocal = noLocal;

        ServerContext serverContext = connection.getServerContext();

        if (serverContext != null)
        {
            hub = HubFactory.get(serverContext);
        }
View Full Code Here

     * @param destination
     */
    public DwrMessageProducer(Destination destination, DwrConnection connection)
    {
        this.destination = destination;
        ServerContext serverContext = connection.getServerContext();

        if (serverContext != null)
        {
            hub = HubFactory.get(serverContext);
        }
View Full Code Here

        if (webcx != null)
        {
            return webcx.getServletContext();
        }

        ServerContext serverContext = StartupUtil.getSingletonServerContext();
        if (serverContext != null)
        {
            return serverContext.getServletContext();
        }

        for (ServerContext sc : StartupUtil.getAllServerContexts())
        {
            // Use the ServletContext of the first ServerContext we see.
View Full Code Here

        Loggers.STARTUP.debug("Setup: Resolving listener implementations:");
        resolveListenerImplementations(container, servletConfig);

        Loggers.STARTUP.debug("Setup: Initializing Factories:");
        ServerContext serverContext = ServerContextFactory.attach(container);
        WebContextFactory.attach(container);
        HubFactory.attach(container);
        JsonParserFactory.attach(container);
        JsonSerializerFactory.attach(container);
        CallbackHelperFactory.attach(container);
View Full Code Here

    /* (non-Javadoc)
     * @see org.directwebremoting.Builder#get()
     */
    public T get()
    {
        ServerContext serverContext = ServerContextFactory.get();
        return get(serverContext);
    }
View Full Code Here

    /* (non-Javadoc)
     * @see org.directwebremoting.extend.Builder#get()
     */
    public ServerContext get()
    {
        ServerContext serverContext = WebContextFactory.get();
        if (serverContext == null)
        {
            // If not see if there is a singleton
            serverContext = StartupUtil.getSingletonServerContext();
            if (serverContext == null)
View Full Code Here

TOP

Related Classes of org.directwebremoting.ServerContext

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.