Package com.ponysdk.core

Examples of com.ponysdk.core.Application


    @Before
    public void beforeTest() {
        log.info("Running #" + name.getMethodName());

        final Application application = new Application("test", "Test", new EmptySession(), new ApplicationManagerOption());
        final UIContext uiContext = new UIContext(application);
        UIContext.setCurrent(uiContext);
        txn = Txn.get();
        txn.begin(new EmptyTxnContext());
        PPusher.initialize();
View Full Code Here


    }

    public Collection<Application> getApplications() {
        final List<Application> applications = new ArrayList<Application>();
        for (final Session session : sessionsById.values()) {
            final Application application = (Application) session.getAttribute(Application.class.getCanonicalName());
            if (application != null) applications.add(application);
        }
        return applications;
    }
View Full Code Here

        streamRequest(req, resp);
    }

    private void streamRequest(final HttpServletRequest req, final HttpServletResponse resp) {
        try {
            final Application ponyApplicationSession = (Application) req.getSession().getAttribute(Application.class.getCanonicalName());
            final Long ponySessionID = Long.parseLong(req.getParameter("ponySessionID"));
            final UIContext ponySession = ponyApplicationSession.getUIContext(ponySessionID);
            final StreamHandler streamHandler = ponySession.removeStreamListener(Long.parseLong(req.getParameter(PROPERTY.STREAM_REQUEST_ID)));
            streamHandler.onStream(req, resp);
        } catch (final Exception e) {
            log.error("Cannot stream request", e);
            try {
View Full Code Here

    @Override
    public WebSocket doWebSocketConnect(final HttpServletRequest req, final String arg1) {
        final long key = Long.parseLong(req.getParameter(APPLICATION.VIEW_ID));

        final Application applicationSession = (Application) req.getSession().getAttribute(Application.class.getCanonicalName());
        if (applicationSession == null) throw new RuntimeException("Invalid session, please reload your application");

        JettyWebSocket jettyWebSocket;

        final UIContext uiContext = applicationSession.getUIContext(key);
        uiContext.acquire();
        try {
            UIContext.setCurrent(uiContext);
            jettyWebSocket = newJettyWebsocket();
            PPusher.get().initialize(jettyWebSocket);
View Full Code Here

TOP

Related Classes of com.ponysdk.core.Application

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.