Package flex.messaging

Examples of flex.messaging.FlexSession


           if (id.equals("nil"))
               id = null;

           flexClient = getMessageBroker().getFlexClientManager().getFlexClient(id);
           // Make sure the FlexClient and FlexSession are associated.
           FlexSession session = FlexContext.getFlexSession();
           flexClient.registerFlexSession(session);
           // And place the FlexClient in FlexContext for this request.
           FlexContext.setThreadLocalFlexClient(flexClient);
       }
       return flexClient;
View Full Code Here


        if (duplicateSessionDetected)
        {
            List sessions = flexClient.getFlexSessions();
            for (Iterator iter = sessions.iterator(); iter.hasNext();)
            {
                FlexSession session = (FlexSession)iter.next();
                if (session instanceof HttpFlexSession)
                    session.invalidate();
            }
           
            // Return an error to the client.
            DuplicateSessionException e = new DuplicateSessionException();
            e.setMessage(ERR_MSG_DUPLICATE_SESSIONS_DETECTED);
View Full Code Here

     */
    public void operationComplete(Object instance)
    {
        if (getScope().equalsIgnoreCase(FlexFactory.SCOPE_SESSION))
        {
            FlexSession session = FlexContext.getFlexSession();
            if (session != null && session.isValid())
            {
                session.setAttribute(getAttributeId(), instance);
            }
        }
    }
View Full Code Here

        helper.importDataset(dataset);

        // Save new PDF as a byte array in the current session
        byte[] bytes = helper.saveToByteArray();
        String uuid = UUIDUtils.createUUID();
        FlexSession session = FlexContext.getFlexSession();
        session.setAttribute(uuid, bytes);

        // Close any resources
        helper.close();

        HttpServletRequest req = FlexContext.getHttpRequest();
        String contextRoot = "/lcds-samples";
        if (req != null)
            contextRoot = req.getContextPath();

        String r = contextRoot + "/dynamic-pdf?id=" + uuid + "&;jsessionid=" + session.getId();
        System.out.println(r);
        return r;
    }
View Full Code Here

        helper.importDataset(dataset);

        // Save new PDF as a byte array in the current session
        byte[] bytes = helper.saveToByteArray();
        String uuid = UUIDUtils.createUUID();
        FlexSession session = FlexContext.getFlexSession();
        session.setAttribute(uuid, bytes);

        // Close any resources
        helper.close();

        HttpServletRequest req = FlexContext.getHttpRequest();
        String contextRoot = "/lcds-samples";
        if (req != null)
            contextRoot = req.getContextPath();

        return contextRoot + "/dynamic-pdf?id=" + uuid + "&;jsessionid=" + session.getId();
    }
View Full Code Here

     */
    public static void cachePageableRowSet(PageableRowSet rowset)
    {
        if (rowset != null)
        {
            FlexSession session = FlexContext.getFlexSession();
            session.setAttribute(rowset.getID(), rowset);
        }
    }
View Full Code Here

     * @see PageableResultSet#getRecords(int, int)
     */
    public Map getRecords(String id, int startIndex, int count) throws SQLException
    {
        Map page = null;
        FlexSession session = FlexContext.getFlexSession();

        if (session != null)
        {
            Object o = session.getAttribute(id);

            if (o != null && o instanceof PageableRowSet)
            {
                PageableRowSet rs = (PageableRowSet) o;
                page = rs.getRecords(startIndex, count);
View Full Code Here

     *
     * @param id The id of the PageableRowSet to remove from the current session.
     */
    public void release(String id)
    {
        FlexSession session = FlexContext.getFlexSession();

        if (session != null)
        {
            session.removeAttribute(id);
        }
    }
View Full Code Here

     */
    public void operationComplete(Object instance)
    {
        if (getScope().equalsIgnoreCase(FlexFactory.SCOPE_SESSION))
        {
            FlexSession session = FlexContext.getFlexSession();
            if (session != null && session.isValid())
            {
                session.setAttribute(getAttributeId(), instance);
            }
        }
    }
View Full Code Here

            instance = factoryInstance.applicationInstance;
        }
        else if (factoryInstance.getScope().equalsIgnoreCase(SCOPE_SESSION))
        {
            // See if an instance already exists in this http session first
            FlexSession session = FlexContext.getFlexSession();
            if (session != null)
            {
                instance = session.getAttribute(factoryInstance.getAttributeId());
                if (instance != null)
                {
                    Class configuredClass = factoryInstance.getInstanceClass();
                    Class instClass = instance.getClass();
                    if (configuredClass != instClass &&
                        !configuredClass.isAssignableFrom(instClass))
                    {
                        ServiceException e = new ServiceException();
                        e.setMessage(INVALID_CLASS_FOUND, new Object[] {
                                        factoryInstance.getAttributeId(),
                                        "session",
                                        factoryInstance.getId(),
                                        factoryInstance.getInstanceClass(), instance.getClass()});
                        e.setCode("Server.Processing");
                        throw e;
                    }
                }
                else
                {
                    // none exists - create it the first time for each session
                    instance = factoryInstance.createInstance();
                    session.setAttribute(factoryInstance.getAttributeId(), instance);
                }
            }
            else
                instance = null;
View Full Code Here

TOP

Related Classes of flex.messaging.FlexSession

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.