|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.softslate.commerce.businessobjects.core.BusinessObjectFactory
Factory class used to create instances of business layer objects.
Generally, this class uses a SettingsBean
instance to look up
the fully-qualified class name of the requested business object. Then it uses
the Java reflection API to create the instance.
An instance of BusinessObjectFactory
is created in the Struts
layer. Its properties are populated there with the application's
DAOFactory
,
SettingsBean
, and with the
User
currently
accessing the system.
Immediately after instantiating the requested business object, this factory passes its own properties to it so that the newly created object can use them to communicate with the rest of the application.
Field Summary | |
private DAOFactory |
daoFactory
This factory's DAOFactory . |
(package private) static org.apache.commons.logging.Log |
log
|
private SettingsBean |
settingsBean
This factory's SettingsBean . |
private User |
user
This factory's User . |
Constructor Summary | |
BusinessObjectFactory()
|
|
BusinessObjectFactory(SettingsBean settingsBean)
|
Method Summary | |
java.lang.Object |
createObject(java.lang.String type)
Creates a business object. |
java.lang.Object |
createObjectFromClassName(java.lang.String className)
Creates a business object. |
DAOFactory |
getDaoFactory()
Retrieves the DAOFactory previously set for this factory. |
SettingsBean |
getSettingsBean()
Retrieves the SettingsBean previously set for this
factory. |
java.util.Map |
getTransferMap()
Creates a Map of this factory's properties. |
User |
getUser()
Retrieves the User previously set for this factory. |
void |
setDaoFactory(DAOFactory daoFactory)
Sets this factory's DAOFactory . |
void |
setSettingsBean(SettingsBean settingsBean)
Sets this factory's SettingsBean . |
void |
setUser(User user)
Sets this factory's User . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
static org.apache.commons.logging.Log log
private User user
User
. The current User
accessing the system, for which business processing is to be performed by
business objects created by this factory. This factory will pass the
User
to every business object it creates.
private SettingsBean settingsBean
SettingsBean
. The current
SettingsBean
, containing various settings to be used by
business objects created by this factory. This factory will pass the
SettingsBean
to every business object it creates.
private DAOFactory daoFactory
DAOFactory
. The current
DAOFactory
for the system, which will allow business
objects created by this factory to create data access objects. This
factory will pass the DAOFactory
to every business object
it creates.
Constructor Detail |
public BusinessObjectFactory()
public BusinessObjectFactory(SettingsBean settingsBean)
Method Detail |
public User getUser()
User
previously set for this factory.
User
object that represents the user currently
accessing the system.public void setUser(User user)
User
. This factory will pass the
User
to every business object it creates.
user
- The current User
accessing the system, for
which business processing is to be performed by business
objects created by this factory.public SettingsBean getSettingsBean()
SettingsBean
previously set for this
factory.
SettingsBean
object that represents various
settings for the system.public void setSettingsBean(SettingsBean settingsBean)
SettingsBean
. This factory will pass
the SettingsBean
to every business object it creates.
settingsBean
- The current SettingsBean
for the system,
containing various settings to be used by business objects
created by this factory.public DAOFactory getDaoFactory()
DAOFactory
previously set for this factory.
DAOFactory
object that can be used to create
data access objects.public void setDaoFactory(DAOFactory daoFactory)
DAOFactory
. This factory will pass
the DAOFactory
to every business object it creates.
daoFactory
- The current DAOFactory
for the system, which
will allow business objects created by this factory to create
data access objects.public java.util.Map getTransferMap()
Map
of this factory's properties. This factory
will pass the Map
to the
initialize(Map parameters)
method of each business object
it creates, which in turn populates the object's properties.
Map
of this factory's properties.public java.lang.Object createObject(java.lang.String type) throws java.lang.Exception
A lookup is performed first to find the fully-qualified Java class name
of the object to create. The type
parameter corresponds to
the code
field in the npcSetting
table of
the database. This factory uses its SettingsBean
to
perform the lookup.
If the Java class name is found, an object is created, and then this factory populates it with its own properties. These properties allow the newly create object to communicate with the rest of the application.
type
- A String
associated with the class name of the
business object to be created.
null
, if an error occurs.
java.lang.Exception
public java.lang.Object createObjectFromClassName(java.lang.String className) throws java.lang.Exception
Using the className
parameter, this factory creates an
object, and then populates it with its own properties. These properties
allow the newly create object to communicate with the rest of the
application.
className
- A String
associated with the class name of the
business object to be created.
null
, if an error occurs.
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |