Package org.itsnat.impl.core.servlet

Examples of org.itsnat.impl.core.servlet.DeserialPendingTask


        final String[] templateVerId = MarkupTemplateImpl.readObject(in);

        in.defaultReadObject();
       
        DeserialPendingTask task = new DeserialPendingTask()
        {
            public void process(ItsNatServletImpl itsNatServlet,ItsNatServletRequest request, ItsNatServletResponse response)
            {
                ClientDocumentAttachedServerImpl.this.docTemplate = (ItsNatStfulDocumentTemplateAttachedServerImpl)MarkupTemplateImpl.getMarkupTemplate(itsNatServlet,templateVerId);
            }
View Full Code Here


        final MarkupSourceStringMarkupImpl source = (MarkupSourceStringMarkupImpl)in.readObject(); // Puede ser null (lo normal)

        int size = in.readInt();

        DeserialPendingTask task = null;
        if (size > 0)
        {
            final int posDocTemplateVersion = in.readInt();

            final ArrayList<String[]> templateIds = new ArrayList<String[]>(size);
            for(int i = 0; i < size; i++)
            {
                String[] templateId = MarkupTemplateVersionImpl.readObject(in);
                templateIds.add(templateId);
            }

            task = new DeserialPendingTask()
            {
                public void process(ItsNatServletImpl itsNatServlet,ItsNatServletRequest request, ItsNatServletResponse response)
                {
                    ItsNatDocumentImpl.this.usedTemplatesWithCachedNodes = createUsedTemplateVersionsWithCachedNodesMap(itsNatServlet);
                    for(int i = 0; i < templateIds.size(); i++)
                    {
                        // Recargamos los templates, si no han cambiado todo ser� igual
                        // pero si ha cambiado alguno no se si funcionar� bien pues
                        // en teor�a los templates del documento no deben cambiar,
                        // la alternativa de serializar los MarkupTemplateVersionImpl
                        // podr�a ser peor
                        String[] templateId = templateIds.get(i);
                        MarkupTemplateVersionImpl templateVersion;
                        if (i == posDocTemplateVersion)
                        {
                            templateVersion = MarkupTemplateVersionImpl.getNewestMarkupTemplateVersion(itsNatServlet,templateId,source,request,response);
                            ItsNatDocumentImpl.this.docTemplateVersion = (ItsNatDocumentTemplateVersionImpl)templateVersion;
                        }
                        else
                            templateVersion = MarkupTemplateVersionImpl.getNewestMarkupTemplateVersion(itsNatServlet,templateId,null,request,response);

                        usedTemplatesWithCachedNodes.put(templateVersion);
                    }
                }
            };
        }
        else
        {
            final String[] templateId = MarkupTemplateVersionImpl.readObject(in);

            task = new DeserialPendingTask()
            {
                public void process(ItsNatServletImpl itsNatServlet,ItsNatServletRequest request, ItsNatServletResponse response)
                {
                    MarkupTemplateVersionImpl templateVersion = MarkupTemplateVersionImpl.getNewestMarkupTemplateVersion(itsNatServlet,templateId,source,request,response);
                    ItsNatDocumentImpl.this.docTemplateVersion = (ItsNatDocumentTemplateVersionImpl)templateVersion;
View Full Code Here

        // Ahora bien, este request pertenece a un servlet concreto y puede haber varios
        // servlets, pero tenemos que despertar a todos los servlets AHORA porque de otra forma
        // al terminar este request se intentar�n serializar los documentos de otros servlets
        // que ni siquiera est�n correctamente de-serializados

        DeserialPendingTask sessionTask = getSessionDeserialPendingTask();
        if (sessionTask != null)
        {
            ItsNatServletImpl itsNatServlet = itsNatRequest.getItsNatServletImpl();
            ItsNatServletResponse itsNatResponse = itsNatRequest.getItsNatServletResponse();

            sessionTask.process(itsNatServlet,itsNatRequest,itsNatResponse);

            setSessionDeserialPendingTask(null); // Para liberar memoria
        }

        if (hasDeserialPendingTasks())
View Full Code Here

TOP

Related Classes of org.itsnat.impl.core.servlet.DeserialPendingTask

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.