Package com.ponysdk.ui.server.basic

Examples of com.ponysdk.ui.server.basic.PPusher


                final MarketData price = new MarketData(market.getCurrency(), (int) (Math.random() * 99), (int) (Math.random() * 99));

                for (final Application application : SessionManager.get().getApplications()) {
                    final Collection<UIContext> uiContexts = application.getUIContexts();
                    for (final UIContext uiContext : uiContexts) {
                        final PPusher pusher = uiContext.getPusher();
                        if (pusher != null) {
                            if (pusher.getPusherState() == PusherState.STARTED) pusher.pushToClient(price);
                        }
                    }
                }
            }
        }, 1000, 200);
View Full Code Here


        super("Flex Table", "Table");
    }

    @Override
    protected void onFirstShowPage() {
        final PPusher pusher = PPusher.initialize();

        super.onFirstShowPage();

        final PFlexTable table = new PFlexTable();
        table.setCellPadding(0);
        table.setCellSpacing(0);
        table.setSizeFull();

        labels = new PLabel[100][10];

        for (int r = 0; r < 100; r++) {
            for (int c = 0; c < 10; c++) {
                final PLabel pLabel = new PLabel(r + "_" + c);
                labels[r][c] = pLabel;
                pLabel.setWidth("40px");
                table.setWidget(r, c, pLabel);
            }
        }

        pusher.addConnectionListener(new ConnectionListener() {

            final Timer timer = new Timer();

            @Override
            public void onOpen() {

                timer.scheduleAtFixedRate(new TimerTask() {

                    @Override
                    public void run() {
                        pusher.execute(new Runnable() {

                            @Override
                            public void run() {
                                for (int r = 0; r < 100; r++) {
                                    for (int c = 0; c < 10; c++) {
View Full Code Here

    protected void pushData(final PonyStock stock) {
        final Collection<Application> applications = SessionManager.get().getApplications();
        for (final Application application : applications) {
            for (final UIContext uiContext : application.getUIContexts()) {
                final PPusher pusher = uiContext.getPusher();
                if (pusher != null) pusher.pushToClient(stock);
            }
        }
    }
View Full Code Here

TOP

Related Classes of com.ponysdk.ui.server.basic.PPusher

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.