Package org.itsnat.core

Examples of org.itsnat.core.ItsNatException


        if (!fileName.equals(ITSNAT) &&
            !fileName.equals(ITSNAT_MSIE_OLD) &&
            !fileName.equals(ITSNAT_W3C) &&
            !fileName.equals(ITSNAT_SVGWEB) &&
            !fileName.equals(ITSNAT_FIX_OTHERNS_IN_HTML) )
           throw new ItsNatException("Security Violation Attempt");
    }
View Full Code Here


            StringBuilder textRes = new StringBuilder();
            while (start != -1)
            {
                int end = text.indexOf('}',start);
                if (end == -1) throw new ItsNatException("INTERNAL ERROR"); // DEBE existir necesariamente el finalizador
                end++;
                String mark = text.substring(start,end);
                String templateId = CachedSubtreeImpl.getTemplateId(mark);
                MarkupTemplateVersionImpl template = getUsedMarkupTemplateVersion(templateId);
View Full Code Here

    }

    public boolean processGlobalListeners()
    {
        if (!super.processGlobalListeners())
            throw new ItsNatException("Observed session/document with id " + targetSessionId + "/" + targetDocId + " does not exist");

        return true;
    }
View Full Code Here

            URLConnection conn = url.openConnection();
            return new InputSource(conn.getInputStream());
        }
        catch(IOException ex)
        {
            throw new ItsNatException(ex);
        }
    }
View Full Code Here

        return features.get(name);
    }

    public Object setFeature(String name, Object value)
    {
        if (value == null) throw new ItsNatException("Null value is not allowed",this);
        throw new ItsNatException("Feature not supported: \"" + name + "\"",this);
        //return features.put(name,value);
    }
View Full Code Here

    private NodeLocationWithParentImpl(Node node,String id,String path,Node cachedParent,String cachedParentId,boolean cacheIfPossible,ClientDocumentStfulImpl clientDoc)
    {
        super(clientDoc);

        if (node == null) throw new ItsNatException("INTERNAL ERROR");          
       
        this.nodeLocationDeleg = getNodeLocationNotParent(node, id, path, clientDoc);

        this.cachedParent = cachedParent;
        this.cachedParentId = cachedParentId;

        NodeCacheRegistryImpl nodeCache = clientDoc.getNodeCacheRegistry();
        if ((nodeCache != null) && cacheIfPossible) // Aunque est� cacheado el nodo principal aprovechamos para cachear los padres.
        {
            // Cacheamos unos cuantos padres inmediatos para que los nodos "adyacentes" (de la zona en general)
            // puedan encontrarse m�s r�pidamente, sobre todo si el cachedParent no se encontr� o est� muy arriba.

            int maxParents = 3; // Un valor razonable para evitar cachear en exceso nodos padre (y enviar demasiado JavaScript)
                                // que a lo mejor no se usan nunca ni para el c�lculo de paths
            Node currParent = node.getParentNode();
            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)
                            this.newCachedParentIds = new ArrayList<String>(maxParents);
                        newCachedParentIds.add(parentId);
                        currParent = currParent.getParentNode();
                        i++;
                    }
                    else currParent = null; // No se puede cachear, paramos
                }
                else currParent = null; // Ya cacheado, paramos
            }
        }
       
        if ((nodeLocationDeleg instanceof NodeLocationAlreadyCachedNotParentImpl) && !isNull(cachedParentId)) throw new ItsNatException("INTERNAL ERROR");       
    }
View Full Code Here

            if (newCachedParentIds != null)
                code.append( "," + toJSArrayCachedParents() ); // 4 items (el �ltimo un array dentro de array)
            code.append( "]" );
            return code.toString();
        }
        else throw new ItsNatException("INTERNAL ERROR");
    }
View Full Code Here

    public ClientDocumentAttachedClientCometImpl(boolean readOnly,int commMode,long eventTimeout,long waitDocTimeout,Browser browser,ItsNatSessionImpl session,ItsNatStfulDocumentImpl itsNatDoc)
    {
        super(readOnly,commMode,eventTimeout,waitDocTimeout,browser,session,itsNatDoc);

        if (!CommModeImpl.isPureAsyncMode(commMode))
            throw new ItsNatException("Communication mode must be pure synchronous in Comet");
    }
View Full Code Here

    }

    public boolean processGlobalListeners()
    {
        if (!super.processGlobalListeners())
            throw new ItsNatException("Parent iframe or object or embed no longer exists");

        return true;
    }
View Full Code Here

        {
            beanInfo = Introspector.getBeanInfo(clasz);
        }
        catch(IntrospectionException ex)
        {
            throw new ItsNatException(ex,this);
        }

        PropertyDescriptor[] props = beanInfo.getPropertyDescriptors();
        try
        {
            for (int i = 0; i < props.length; i++)
            {
                PropertyDescriptor property = props[i];
                String propName = property.getName();
                Method method = property.getReadMethod();
                Object res = method.invoke(obj,(Object[])null)// El cast es para evitar un warning si se compila con JDK 1.5 (caso varargs)
                setLocalVariable(prefix + propName,res);
            }
        }
        catch(IllegalAccessException ex)
        {
            throw new ItsNatException(ex,this);
        }
        catch(InvocationTargetException ex)
        {
            throw new ItsNatException(ex,this);
        }
    }
View Full Code Here

TOP

Related Classes of org.itsnat.core.ItsNatException

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.