001    /*
002     * Created on Jan 20, 2005
003     *
004     * To change the template for this generated file go to
005     * Window>Preferences>Java>Code Generation>Code and Comments
006     */
007    package railo.runtime.cfx.customtag;
008    
009    import railo.runtime.cfx.CFXTagException;
010    
011    import com.allaire.cfx.CustomTag;
012    
013    /**
014     *
015     *
016     * To change the template for this generated type comment go to
017     * Window>Preferences>Java>Code Generation>Code and Comments
018     */
019    public final class CPPCFXTagClass implements CFXTagClass {
020            
021            private String name;
022            private boolean readonly=false;
023        private String serverLibrary;
024        private String procedure;
025        private boolean keepAlive;
026    
027        /**
028         * @param name
029         * @param readonly
030         * @param serverLibrary
031         * @param procedure
032         * @param keepAlive
033         */
034        private CPPCFXTagClass(String name, boolean readonly, String serverLibrary,
035                String procedure, boolean keepAlive) {
036            super();
037            this.name = name;
038            this.readonly = readonly;
039            this.serverLibrary = serverLibrary;
040            this.procedure = procedure;
041            this.keepAlive = keepAlive;
042        }
043    
044            public CPPCFXTagClass(String name, String serverLibrary, String procedure, boolean keepAlive) {
045                    if(name.startsWith("cfx_"))name=name.substring(4);
046                    this.name=name;
047                    this.serverLibrary=serverLibrary;
048                    this.procedure=procedure;
049                    this.keepAlive=keepAlive;
050            }
051            
052            /**
053             * @return the serverLibrary
054             */
055            public String getServerLibrary() {
056                    return serverLibrary;
057            }
058    
059            /**
060             * @return the procedure
061             */
062            public String getProcedure() {
063                    return procedure;
064            }
065    
066            @Override
067            public CustomTag newInstance() throws CFXTagException {
068                    return new CPPCustomTag(serverLibrary,procedure,keepAlive);
069                    
070            }
071    
072        @Override
073        public boolean isReadOnly() {
074            return readonly;
075        }
076    
077        @Override
078        public CFXTagClass cloneReadOnly() {
079            return new CPPCFXTagClass(name,true,serverLibrary,procedure,keepAlive);
080        }
081    
082        @Override
083        public String getDisplayType() {
084            return "cpp";
085        }
086    
087        @Override
088        public String getSourceName() {
089            return serverLibrary;
090        }
091    
092        @Override
093        public boolean isValid() {
094            return false;
095        }
096        
097            /**
098             * @return the name
099             */
100            public String getName() {
101                    return name;
102            }
103    
104            /**
105             * @return the keepAlive
106             */
107            public boolean getKeepAlive() {
108                    return keepAlive;
109            }
110            
111    }