org.barracudamvc.plankton.data
Class ObjectRepositoryAssembler

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended byorg.barracudamvc.plankton.data.ObjectRepositoryAssembler
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class ObjectRepositoryAssembler
extends javax.servlet.http.HttpServlet

This class basically assembles objects into the default ObjectRepository based on an XML descriptor file. For a sample file look at /WEB-INF/object-repository.xml. This class demonstrates all the basic functionality, so please be sure to look there first if you have questions. You may want to run TestObjectRepository.xml to see it in action.

In a nutshell, the ObjectRepositoryAssembler is a lightweight scripting mechanism that makes it possible to instantiate objects, set properties, invoke methods, and then register objects in the global object repository if you so desire (hence the class name). This class is extremely useful for configuration, so it will be well worth your time to learn how it works.

There are only a few basic tags:

See Also:
Serialized Form

Nested Class Summary
 class ObjectRepositoryAssembler.AssemblerXMLReader
           
 
Field Summary
static String ASSEMBLY_DESCRIPTOR
           
static String DEFAULT_DESCRIPTOR
           
static String DEFAULT_PARSER
           
static String GLOBAL_CONTINUE_ON_ERR
           
static boolean globalContinueOnErr
           
static String LOG_HEARTBEAT_STR
           
protected static org.apache.log4j.Logger logger
           
protected  boolean logHeartbeat
           
static String SAX_PARSER
           
static boolean TEST_BOOLEAN
           
static Boolean TEST_BOOLEAN2
           
static Class TEST_CLASS
           
static double TEST_DOUBLE
           
static Double TEST_DOUBLE2
           
static float TEST_FLOAT
           
static Float TEST_FLOAT2
           
static int TEST_INT
           
static Integer TEST_INT2
           
static long TEST_LONG
           
static Long TEST_LONG2
           
static short TEST_SHORT
           
static Short TEST_SHORT2
           
static String TEST_STRING
           
static String TEST_STRING2
           
static String TEST_STRING3
           
static String TEST_STRING88
           
static String TEST_STRING99
           
 
Constructor Summary
ObjectRepositoryAssembler()
           
 
Method Summary
 void assemble(ObjectRepository ior, javax.servlet.ServletConfig iservletConfig, String iassemblySourceFile)
          Assemble the system, given a specified ObjectRepository and the XML assembly decriptor name.
 void assemble(ObjectRepository ior, javax.servlet.ServletConfig iservletConfig, String iassemblySourceFile, String iparserClass)
          Assemble the system, given the root EventGateway, an XML assembly decriptor name, and a specific SAX parser class.
 void assemble(javax.servlet.ServletConfig iservletConfig, String iassemblySourceFile)
          Assemble the system into the default ObjectRepository given the XML assembly decriptor name.
 void assemble(String iassemblySourceFile)
          Assemble the system into the default ObjectRepository given the XML assembly decriptor name.
 void init()
          This class extends HttpServlet primarily for convenience, so that you easily use it to set up a servlet environment.
static void main(String[] args)
           
static void setTestString2(String s1)
           
static void setTestString3(String s1, String s2)
           
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final org.apache.log4j.Logger logger

ASSEMBLY_DESCRIPTOR

public static String ASSEMBLY_DESCRIPTOR

SAX_PARSER

public static String SAX_PARSER

DEFAULT_DESCRIPTOR

public static String DEFAULT_DESCRIPTOR

DEFAULT_PARSER

public static String DEFAULT_PARSER

LOG_HEARTBEAT_STR

public static String LOG_HEARTBEAT_STR

GLOBAL_CONTINUE_ON_ERR

public static String GLOBAL_CONTINUE_ON_ERR

logHeartbeat

protected boolean logHeartbeat

globalContinueOnErr

public static boolean globalContinueOnErr

TEST_CLASS

public static Class TEST_CLASS

TEST_STRING

public static String TEST_STRING

TEST_STRING2

public static String TEST_STRING2

TEST_STRING3

public static String TEST_STRING3

TEST_INT

public static int TEST_INT

TEST_INT2

public static Integer TEST_INT2

TEST_SHORT

public static short TEST_SHORT

TEST_SHORT2

public static Short TEST_SHORT2

TEST_LONG

public static long TEST_LONG

TEST_LONG2

public static Long TEST_LONG2

TEST_DOUBLE

public static double TEST_DOUBLE

TEST_DOUBLE2

public static Double TEST_DOUBLE2

TEST_FLOAT

public static float TEST_FLOAT

TEST_FLOAT2

public static Float TEST_FLOAT2

TEST_BOOLEAN

public static boolean TEST_BOOLEAN

TEST_BOOLEAN2

public static Boolean TEST_BOOLEAN2

TEST_STRING88

public static String TEST_STRING88

TEST_STRING99

public static String TEST_STRING99
Constructor Detail

ObjectRepositoryAssembler

public ObjectRepositoryAssembler()
Method Detail

setTestString2

public static void setTestString2(String s1)

setTestString3

public static void setTestString3(String s1,
                                  String s2)

assemble

public void assemble(String iassemblySourceFile)
Assemble the system into the default ObjectRepository given the XML assembly decriptor name. The default parser will be used.

Parameters:
iassemblySourceFile - the XML assembly descriptor (if null defaults to DEFAULT_DESCRIPTOR)

assemble

public void assemble(javax.servlet.ServletConfig iservletConfig,
                     String iassemblySourceFile)
Assemble the system into the default ObjectRepository given the XML assembly decriptor name. The default parser will be used.

Parameters:
iservletConfig - the ServletConfig object (may be null if you are calling this from other than a servlet environment)
iassemblySourceFile - the XML assembly descriptor (if null defaults to DEFAULT_DESCRIPTOR)

assemble

public void assemble(ObjectRepository ior,
                     javax.servlet.ServletConfig iservletConfig,
                     String iassemblySourceFile)
Assemble the system, given a specified ObjectRepository and the XML assembly decriptor name. The default parser will be used.

Parameters:
ior - the repository we wish to assemble into (if null defaults to default ObjectRepository)
iservletConfig - the ServletConfig object (may be null if you are calling this from other than a servlet environment)
iassemblySourceFile - the XML assembly descriptor (if null defaults to DEFAULT_DESCRIPTOR)

assemble

public void assemble(ObjectRepository ior,
                     javax.servlet.ServletConfig iservletConfig,
                     String iassemblySourceFile,
                     String iparserClass)
Assemble the system, given the root EventGateway, an XML assembly decriptor name, and a specific SAX parser class.

Parameters:
ior - the repository we wish to assemble into (if null defaults to default ObjectRepository)
iservletConfig - the ServletConfig object (may be null if you are calling this from other than a servlet environment)
iassemblySourceFile - the XML assembly descriptor (if null defaults to DEFAULT_DESCRIPTOR)
iparserClass - the SAX parser factory class (if null, defaults to DEFAULT_PARSER)

init

public void init()
          throws javax.servlet.ServletException
This class extends HttpServlet primarily for convenience, so that you easily use it to set up a servlet environment. The servlet methods that handle requests do not do anything; it all happens in the config.

Throws:
javax.servlet.ServletException

main

public static void main(String[] args)


Copyright © 2004 BarracudaMVC.org All Rights Reserved.