public class DispatcherLogic extends Object
Dispatch
instances and related objects.Modifier and Type | Class and Description |
---|---|
protected static class |
DispatcherLogic.ConfigurationCacheEntry |
protected static class |
DispatcherLogic.FileCacheEntry<T> |
Modifier and Type | Field and Description |
---|---|
static String |
CONFIGURATION_CACHE_CHECK_FREQUENCY |
static String |
CONFIGURATION_CACHE_SIZE |
protected static com.google.common.cache.LoadingCache<File,DispatcherLogic.ConfigurationCacheEntry> |
configurationCache |
static String |
copyright |
static String |
INVALID_PAGE_INSTANCE |
static org.slf4j.Logger |
logger |
static String |
PAGE_CACHE_CHECK_FREQUENCY |
static String |
PAGE_CACHE_SIZE |
protected static com.google.common.cache.LoadingCache<File,DispatcherLogic.FileCacheEntry<Page>> |
pageCache |
protected static JAXBContext |
pagesJaxbContext |
Constructor and Description |
---|
DispatcherLogic() |
Modifier and Type | Method and Description |
---|---|
protected static void |
appendChildrenToPagesSelectionProvider(File baseDir,
File parentDir,
String breadcrumb,
DefaultSelectionProvider selectionProvider,
boolean includeDetailChildren,
File... excludes) |
static void |
clearConfigurationCache() |
static void |
clearConfigurationCache(Class configurationClass)
Clears the cache from entries whose class matches exactly with the one passed as a parameter.
|
static void |
configurePageAction(PageAction pageAction,
PageInstance pageInstance) |
static SelectionProvider |
createPagesSelectionProvider(File baseDir,
boolean includeRoot,
boolean includeDetailChildren,
File... excludes) |
static SelectionProvider |
createPagesSelectionProvider(File baseDir,
File... excludes) |
static PageAction |
ensureActionBean(PageInstance page)
Deprecated.
|
static Class<? extends PageAction> |
getActionClass(Configuration configuration,
File directory) |
static Class<? extends PageAction> |
getActionClass(Configuration configuration,
File directory,
boolean fallback) |
static <T> T |
getConfiguration(File configurationFile,
Class<? extends T> configurationClass) |
static Page |
getPage(File directory) |
protected static File |
getPageFile(File directory) |
static PageAction |
getSubpage(Configuration configuration,
PageInstance parentPageInstance,
String pathFragment) |
static void |
init(Configuration portofinoConfiguration) |
static void |
initConfigurationCache(int maxSize,
int refreshCheckFrequency) |
static void |
initPageCache(int maxSize,
int refreshCheckFrequency) |
static boolean |
isValidActionClass(Class<?> actionClass) |
static <T> T |
loadConfiguration(File configurationFile,
Class<? extends T> configurationClass) |
static <T> T |
loadConfiguration(InputStream inputStream,
Class<? extends T> configurationClass) |
static Page |
loadPage(File key) |
static Page |
loadPage(InputStream inputStream) |
static File |
saveConfiguration(File directory,
Object configuration) |
static File |
savePage(File directory,
Page page)
Persists a page to the file system.
|
static File |
savePage(PageInstance pageInstance)
Persists a page to the file system.
|
public static final String copyright
public static final org.slf4j.Logger logger
public static final String INVALID_PAGE_INSTANCE
protected static final JAXBContext pagesJaxbContext
public static final String PAGE_CACHE_SIZE
public static final String PAGE_CACHE_CHECK_FREQUENCY
public static final String CONFIGURATION_CACHE_SIZE
public static final String CONFIGURATION_CACHE_CHECK_FREQUENCY
protected static com.google.common.cache.LoadingCache<File,DispatcherLogic.FileCacheEntry<Page>> pageCache
protected static com.google.common.cache.LoadingCache<File,DispatcherLogic.ConfigurationCacheEntry> configurationCache
public static SelectionProvider createPagesSelectionProvider(File baseDir, File... excludes)
public static SelectionProvider createPagesSelectionProvider(File baseDir, boolean includeRoot, boolean includeDetailChildren, File... excludes)
protected static void appendChildrenToPagesSelectionProvider(File baseDir, File parentDir, String breadcrumb, DefaultSelectionProvider selectionProvider, boolean includeDetailChildren, File... excludes)
public static File savePage(PageInstance pageInstance) throws Exception
pageInstance
- the live PageInstance containing the Page to save.Exception
- in case the save fails.public static File savePage(File directory, Page page) throws Exception
directory
- the directory where to save the page.xml file.page
- the page to save.Exception
- in case the save fails.public static void init(Configuration portofinoConfiguration)
public static void initPageCache(int maxSize, int refreshCheckFrequency)
public static void initConfigurationCache(int maxSize, int refreshCheckFrequency)
public static void clearConfigurationCache()
public static void clearConfigurationCache(Class configurationClass)
configurationClass
- the class of the entries to remove.public static Page loadPage(InputStream inputStream) throws JAXBException
JAXBException
public static Page getPage(File directory) throws PageNotActiveException
PageNotActiveException
public static File saveConfiguration(File directory, Object configuration) throws Exception
Exception
public static <T> T getConfiguration(File configurationFile, Class<? extends T> configurationClass) throws Exception
Exception
public static <T> T loadConfiguration(File configurationFile, Class<? extends T> configurationClass) throws Exception
Exception
public static <T> T loadConfiguration(InputStream inputStream, Class<? extends T> configurationClass) throws Exception
Exception
public static Class<? extends PageAction> getActionClass(Configuration configuration, File directory)
public static Class<? extends PageAction> getActionClass(Configuration configuration, File directory, boolean fallback)
public static boolean isValidActionClass(Class<?> actionClass)
@Deprecated public static PageAction ensureActionBean(PageInstance page) throws IllegalAccessException, InstantiationException
public static void configurePageAction(PageAction pageAction, PageInstance pageInstance) throws JAXBException, IOException
JAXBException
IOException
public static PageAction getSubpage(Configuration configuration, PageInstance parentPageInstance, String pathFragment) throws PageNotActiveException
PageNotActiveException