org.apache.turbine.services.assemblerbroker.util.python

## Class PythonBaseFactory<T extends Assembler>

- java.lang.Object
- - org.apache.turbine.services.assemblerbroker.util.python.PythonBaseFactory<T>

- Type Parameters:
    `T` - the specialized assembler type
  All Implemented Interfaces:
    Loader<T>, AssemblerFactory<T>
  Direct Known Subclasses:
    PythonActionFactory, PythonLayoutFactory, PythonNavigationFactory, PythonPageFactory, PythonScreenFactory

      public abstract class PythonBaseFactory<T extends Assembler>
      extends Object
      implements AssemblerFactory<T>

  A factory that attempts to load a python class in the JPython interpreter and execute it as a Turbine screen. The JPython script should inherit from Turbine Screen or one of its subclasses.
  Author:
    Leon Messerschmidt, Henning P. Schmiedehausen

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `PYTHON_CONFIG_FILE` Global config file.
    `static String` | `PYTHON_PATH` Key for the python path

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PythonBaseFactory()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `T` | `getAssembler(String subDirectory, String name)` Get an Assembler.
    `int` | `getCacheSize()` Get the size of a possibly configured cache
    `abstract Loader<T>` | `getLoader()` Get the loader for this type of assembler

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.apache.turbine.services.assemblerbroker.util.AssemblerFactory

      `getManagedClass`

    - ### Methods inherited from interface org.apache.turbine.modules.Loader

      `getAssembler`

- - ### Field Detail

    - #### PYTHON_PATH

          public static final String PYTHON_PATH

      Key for the python path
      See Also:
        Constant Field Values

    - #### PYTHON_CONFIG_FILE

          public static final String PYTHON_CONFIG_FILE

      Global config file. This is executed before every screen
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### PythonBaseFactory

          public PythonBaseFactory()

  - ### Method Detail

    - #### getAssembler

          public T getAssembler(String subDirectory,
                       String name)
                                           throws Exception

      Get an Assembler.
      Parameters:
        `subDirectory` - subdirectory within python.path
        `name` - name of the requested Assembler
      Returns:
        an Assembler
      Throws:
        `Exception` - generic exception

    - #### getLoader

          public abstract Loader<T> getLoader()

      Get the loader for this type of assembler
      Specified by:
        `getLoader` in interface `AssemblerFactory<T extends Assembler>`
      Returns:
        a Loader

    - #### getCacheSize

          public int getCacheSize()

      Get the size of a possibly configured cache
      Specified by:
        `getCacheSize` in interface `Loader<T extends Assembler>`
      Returns:
        the size of the cache in bytes

Copyright © 2000–2018 The Apache Software Foundation. All rights reserved.