Class DBContext
java.lang.Object
org.apache.velocity.context.AbstractContext
org.apache.velocity.example.DBContext
- All Implemented Interfaces:
org.apache.velocity.context.Context, org.apache.velocity.context.InternalEventContext
public class DBContext
extends org.apache.velocity.context.AbstractContext
Example context impl that uses a database to store stuff :)
yes, this is silly
expects a mysql db test with table
CREATE TABLE contextstore (
k varchar(100),
val blob
);
very fragile, crappy code.... just a demo!
- Version:
- $Id$
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.velocity.app.event.EventCartridgeattachEventCartridge(org.apache.velocity.app.event.EventCartridge arg0) intorg.apache.velocity.runtime.resource.Resourceorg.apache.velocity.app.event.EventCartridgeList<org.apache.velocity.Template> String[]String[]org.apache.velocity.util.introspection.IntrospectionCacheDatavoidbooleanNot implementing.internalGet(String key) retrieves a serialized object from the db and returns the living instance to the caller.String[]Not implementing.internalPut(String key, Object value) Serializes and stores an object in the database.internalRemove(String key) Not implementing.voidvoidvoidpushCurrentMacroName(String arg0) voidvoidsetCurrentResource(org.apache.velocity.runtime.resource.Resource arg0) voidsetMacroLibraries(List<org.apache.velocity.Template> arg0) private voidsetup()Methods inherited from class org.apache.velocity.context.AbstractContext
containsKey, get, getChainedContext, getKeys, put, remove
-
Field Details
-
conn
Connection conn
-
-
Constructor Details
-
DBContext
public DBContext() -
DBContext
public DBContext(org.apache.velocity.context.Context inner)
-
-
Method Details
-
internalGet
-
internalPut
-
internalContainsKey
Not implementing. Not required for Velocity core operation, so not bothering. As we say above : "very fragile, crappy code..."- Specified by:
internalContainsKeyin classorg.apache.velocity.context.AbstractContext
-
internalGetKeys
Not implementing. Not required for Velocity core operation, so not bothering. As we say above : "very fragile, crappy code..."- Specified by:
internalGetKeysin classorg.apache.velocity.context.AbstractContext
-
internalRemove
-
setup
private void setup() -
pushCurrentTemplateName
-
popCurrentTemplateName
public void popCurrentTemplateName() -
getCurrentTemplateName
-
getTemplateNameStack
-
pushCurrentMacroName
-
popCurrentMacroName
public void popCurrentMacroName() -
getCurrentMacroName
-
getCurrentMacroCallDepth
public int getCurrentMacroCallDepth() -
getMacroNameStack
-
icacheGet
-
icachePut
public void icachePut(Object arg0, org.apache.velocity.util.introspection.IntrospectionCacheData arg1) -
setCurrentResource
public void setCurrentResource(org.apache.velocity.runtime.resource.Resource arg0) -
getCurrentResource
public org.apache.velocity.runtime.resource.Resource getCurrentResource() -
setMacroLibraries
-
getMacroLibraries
-
attachEventCartridge
public org.apache.velocity.app.event.EventCartridge attachEventCartridge(org.apache.velocity.app.event.EventCartridge arg0) - Specified by:
attachEventCartridgein interfaceorg.apache.velocity.context.InternalEventContext
-
getEventCartridge
public org.apache.velocity.app.event.EventCartridge getEventCartridge()- Specified by:
getEventCartridgein interfaceorg.apache.velocity.context.InternalEventContext
-