Package org.itsnat.impl.core.clientdoc

Examples of org.itsnat.impl.core.clientdoc.NodeCacheRegistryImpl.addNode()


            for(int i = 0; (currParent != null) && (currParent != cachedParent) && (i < maxParents); i++)
            {
                String parentId = nodeCache.getId(currParent);
                if (parentId == null) // No cacheado
                {
                    parentId = nodeCache.addNode(currParent);
                    if (parentId != null)
                    {
                        // Hemos cacheado un nuevo nodo, DEBEMOS LLAMAR toJSArray y enviar al cliente
                        // de otra manera el cliente NO se enterar� de este cacheado.
                        if (newCachedParentIds == null)
View Full Code Here


            }
            else // No cacheado
            {
                if (cacheIfPossible)
                {
                    id = nodeCache.addNode(node); // Si el nodo no es cacheable o la cach� est� bloqueada (s�lo lectural) devuelve null, no pasa nada por no poder cachear
                    return getNodeLocationWithParentUsingCache(node,id,true,nodeCache);
                }
                else
                {
                    String path = clientDoc.getStringPathFromNode(node);
View Full Code Here

            }
            else
            {
                // No cacheado,intentamos cachear ahora, necesitamos calcular el path para que se cachee en el cliente tambi�n
                needRefNodePath = true;
                idRefChild = nodeCache.addNode(nextSibling); // el caso null es que no es cacheable por ejemplo, o la cach� est� "bloqueada"
            }
        }
        else needRefNodePath = true;

        if (needRefNodePath)
View Full Code Here

            }
            else
            {
                // Intentamos cachear ahora, necesitamos calcular el path para que se cachee en el cliente tambi�n
                needNodePath = true;
                idNode = nodeCache.addNode(node); // el caso null es que no es cacheable por ejemplo, o la cach� est� "bloqueada"
            }
        }
        else needNodePath = true;

        if (needNodePath)
View Full Code Here

                // Los ids de los nodos son generados por el ItsNatDocumentImpl
                // por lo que pueden compartirse entre cach�s de clientes.

                if (isIgnoredNodeForCaching(node)) continue;

                nodeCacheObserver.addNode(node,id); // node no puede ser nulo

                NodeLocationWithParentImpl nodeLoc = NodeLocationWithParentImpl.getNodeLocationWithParentUsingCache(node,id,cacheParentIfPossible,nodeCacheObserver);
                if (!nodeLoc.isJustCached())
                    throw new ItsNatException("INTERNAL ERROR");
                code.append( JSRenderNodeImpl.addNodeToCache(nodeLoc) );
View Full Code Here

    }

    protected void preventiveNodeCaching(Node node,String id,ClientDocumentStfulImpl clientDoc)
    {
        NodeCacheRegistryImpl nodeCache = clientDoc.getNodeCacheRegistry(); // No puede ser nula
        nodeCache.addNode(node,id); // node no puede ser nulo (dar� error)

        // Con cacheIfPossible = true tambi�n cacheamos padres, minimizando problemas.
        NodeLocationWithParentImpl nodeLoc = NodeLocationWithParentImpl.getNodeLocationWithParentUsingCache(node,id,true,nodeCache);
        if (!nodeLoc.isJustCached())
            throw new ItsNatException("INTERNAL ERROR");
View Full Code Here

        if (!clientDoc.getItsNatStfulDocument().isNewNodeDirectChildOfContentRoot(newNode))
            return null;
       
        NodeCacheRegistryImpl nodeCache = clientDoc.getNodeCacheRegistry();
        if (nodeCache == null) return null;
        String id = nodeCache.addNode(newNode); // Si devuelve null es que no se puede cachear el nodo o cach� "bloqueada"
       
        // Este idJS es para m�todos especiales en donde opcionalmente podemos pasar el id del nodo cacheado (si se pudo cachear sino pues null), es simplemente el "id", en este caso no es necesario y no sigue el convencionalismo de arrays de NodeLocation
        return id != null ? "\"" + id + "\"" : "null";       
    }
}
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.