Examples of ServerContext


Examples of org.cspoker.common.api.shared.context.ServerContext

    Pair<StaticServerContext, Queue<ServerEvent>> state;
    try {
      state = contexts.getOrCreate(credentials.getLeft(), new IFactory1<Pair<StaticServerContext, Queue<ServerEvent>>, LoginException>(){

        public Pair<StaticServerContext, Queue<ServerEvent>> create() throws LoginException {
          ServerContext serverContext = cspokerServer.login(credentials.getLeft(), credentials.getRight());
          final ConcurrentLinkedQueue<ServerEvent> eventQueue = new ConcurrentLinkedQueue<ServerEvent>();
          StaticServerContext staticServerContext = new XmlServerContext(serverContext,
              new UniversalServerListener(
                  new ServerEventListener(){
View Full Code Here

Examples of org.cspoker.common.api.shared.context.ServerContext

    this.cspokerServer = cspokerServer;
  }
 
  public ExternalRemoteServerContext login(String username, String password)
      throws LoginException, RemoteException {
    ServerContext rootServer = cspokerServer.login(username, password);
    RemoteServerContext context = new ExportingServerContext(
        new UnremoteServerContext(new AsynchronousServerContext(
            new SequencePreservingExecutor(GlobalThreadPool.getInstance()), rootServer)));
    try {
      UnicastRemoteObject.unexportObject(context, true);
View Full Code Here

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

Examples of org.directwebremoting.ServerContext

  @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

Examples of org.directwebremoting.ServerContext

            //���û�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

Examples of org.directwebremoting.ServerContext

            //���û�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

Examples of org.directwebremoting.ServerContext

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

        ServerContext serverContext = connection.getServerContext();

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

Examples of org.directwebremoting.ServerContext

     * @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

Examples of org.directwebremoting.ServerContext

        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

Examples of org.directwebremoting.ServerContext

        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
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.