org.glassfish.virtualization.spi
Interface TemplateInstance


public interface TemplateInstance

Represents a template instance that can be instantiated in a virtual machine

Author:
Jerome Dochez

Method Summary
 Template getConfig()
          Returns the static (persisted) information on the template.
 TemplateCustomizer getCustomizer()
          Returns the customizer for this template instance.
 File getFileByExtension(String extension)
          Returns the first file in this template location that has this extension.
 File getLocation()
          Returns the template location where template files were stored.
 boolean satisfies(TemplateCondition condition)
          Returns true of the template satisfy a condition
 

Method Detail

getConfig

Template getConfig()
Returns the static (persisted) information on the template.

Returns:
the template configuration.

satisfies

boolean satisfies(TemplateCondition condition)
Returns true of the template satisfy a condition

Parameters:
condition - the index which can be a key value pair like a ServiceType:JavaEE or any implementation of the TemplateCondition interface
Returns:
true if the index is satisfied.

getCustomizer

TemplateCustomizer getCustomizer()
Returns the customizer for this template instance. The customizer is often looked up in the services registry using the ServiceType index value.

Returns:
the customizer instance.

getLocation

File getLocation()
Returns the template location where template files were stored.

Returns:
a local disk location

getFileByExtension

File getFileByExtension(String extension)
                        throws FileNotFoundException
Returns the first file in this template location that has this extension.

Parameters:
extension - the requested file extension
Returns:
the file if found a matching one.
Throws:
FileNotFoundException - when no file with that extension is present in this template definition


Copyright © 2012. All Rights Reserved.