|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.turbine.services.webmacro.TurbineTemplateProvider
This class provides the WebMacro engine with Temlate
instances.
This class was created as a replacement of
org.webmacro.resource.TemplateProvider
that relies on
the properties of WebMacroService
for locating the templates.
Field Summary | |
private org.webmacro.Broker |
broker
Resource broker that manages this provider. |
private int |
cacheTime
Expiration time of the provided resources. |
private java.lang.String[] |
paths
Stored paths that are searched by this provider. |
static java.lang.String |
TYPE
The single resource type we provide. |
private static java.lang.String[] |
types
An array of supported resource types. |
Fields inherited from interface org.webmacro.broker.ResourceProvider |
INFINITE_CACHE, NEVER_CACHE |
Constructor Summary | |
TurbineTemplateProvider()
|
Method Summary | |
void |
destroy()
Shuts down the provider. |
private org.webmacro.Template |
findTemplate(java.lang.String name)
Locates a template file, and instantiates Template
object. |
java.lang.String[] |
getTypes()
Returns an array of supported resource types. |
void |
init(org.webmacro.broker.ResourceBroker broker)
Initializes the provider. |
void |
resourceCreate(org.webmacro.broker.CreateResourceEvent create)
Creates a new resource (not implemented). |
boolean |
resourceDelete(org.webmacro.broker.ResourceEvent delete)
Deletes a resource (not implemented). |
int |
resourceExpireTime()
Returns expiration time of the provided resources. |
void |
resourceRequest(org.webmacro.broker.RequestResourceEvent request)
Retrieves a resource. |
boolean |
resourceSave(org.webmacro.broker.ResourceEvent save)
Saves a resource to permanet storage (not implemented). |
int |
resourceThreads()
Returns the number of additional worker threads to be used by the provider |
Methods inherited from class java.lang.Object |
|
Field Detail |
public static java.lang.String TYPE
private static java.lang.String[] types
private int cacheTime
private java.lang.String[] paths
private org.webmacro.Broker broker
Constructor Detail |
public TurbineTemplateProvider()
Method Detail |
public java.lang.String[] getTypes()
getTypes
in interface org.webmacro.broker.ResourceProvider
public int resourceExpireTime()
resourceExpireTime
in interface org.webmacro.broker.ResourceProvider
public int resourceThreads()
resourceThreads
in interface org.webmacro.broker.ResourceProvider
public void init(org.webmacro.broker.ResourceBroker broker) throws org.webmacro.broker.ResourceInitException
init
in interface org.webmacro.broker.ResourceProvider
broker
- The ResourceBroker
that manages this
provider.org.webmacro.broker.ResourceInitException
- The resource couldn't be initialized.public void destroy()
destroy
in interface org.webmacro.broker.ResourceProvider
public void resourceRequest(org.webmacro.broker.RequestResourceEvent request) throws org.webmacro.NotFoundException, java.lang.InterruptedException
resourceRequest
in interface org.webmacro.broker.ResourceProvider
request
- A RequestResourceEvent
.NotFoundException.
- InterruptedException.
- public void resourceCreate(org.webmacro.broker.CreateResourceEvent create) throws org.webmacro.NotFoundException, java.lang.InterruptedException
resourceCreate
in interface org.webmacro.broker.ResourceProvider
create
- A CreateResourceEvent
.NotFoundException.
- InterruptedException.
- public boolean resourceDelete(org.webmacro.broker.ResourceEvent delete)
resourceDelete
in interface org.webmacro.broker.ResourceProvider
delete
- A ResourceEvent
.public boolean resourceSave(org.webmacro.broker.ResourceEvent save)
resourceSave
in interface org.webmacro.broker.ResourceProvider
save
- A ResourceEvent
.private org.webmacro.Template findTemplate(java.lang.String name)
Template
object.name
- the name of the template to be locatedTemplate
object.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |