BusinessPolicyHome Class

com.beasys.commerce.foundation
BusinessPolicyHome Class

public class BusinessPolicyHome

    extends Object
    implements SmartHome

This is a BusinessPolicy home/bean factory. This implementation caches classes for increased performance using the design pattern that reduces contention and synchronization overhead.

Related Topics

CommercePropertiesHelper


Hierarchy
Object
  BusinessPolicyHome
All Implemented Interfaces

SmartHome

Field Summary

public static final String
CUSTOM_HOME_NAME
String
public static final String
DEFAULT_BUSINESS_POLICY_IMPL_SUFFIX
String
public static final String
DEFAULT_POLICY_BEAN_CLASS_NAME
String
 

Constructor Summary

BusinessPolicyHome()

 

Method Summary

public static BusinessPolicy
create(String businessPolicyInterfaceClassName)
Given a bean interface, use the factory pattern to create an instance.
public static SmartHome
getCustomHome(String businessPolicyInterfaceClassName)
Given a bean interface, use the factory pattern to get its custom home.
public static void
init()
The init method must be called before any BusinessPolicies are created.
 
Methods from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
   

Field Detail

CUSTOM_HOME_NAME

public static final String CUSTOM_HOME_NAME


DEFAULT_BUSINESS_POLICY_IMPL_SUFFIX

public static final String DEFAULT_BUSINESS_POLICY_IMPL_SUFFIX


DEFAULT_POLICY_BEAN_CLASS_NAME

public static final String DEFAULT_POLICY_BEAN_CLASS_NAME

 

Constructor Detail

BusinessPolicyHome

public BusinessPolicyHome()
 

Method Detail

create(String) Method

public static BusinessPolicy create(String businessPolicyInterfaceClassName)
Given a bean interface, use the factory pattern to create an instance. The bean instance can be obtained from the weblogiccommerce.properties file. If it is not there, then we will use the default Impl where is the name of the bean interface. This is an example of specifying a different Impl class in the properties file.
 com.beasys.commerce.ebusiness.item.ItemPriceCalculationPolicy.CustomHomeName = com.acme.util.ExpertPricerHome
 com.beasys.commerce.ebusiness.item.ItemPriceCalculationPolicy.DefaultPolicyClassName = com.acme.util.ExpertPricer
 


getCustomHome(String) Method

public static SmartHome getCustomHome(String businessPolicyInterfaceClassName)
Given a bean interface, use the factory pattern to get its custom home. If a bean's custom home is not defined in the weblogiccommerce.properties file, then this method returns null. This is an example of specifying a custom home name in the properties file.
 com.beasys.commerce.ebusiness.item.ItemPriceCalculationPolicy.CustomHomeName = com.acme.util.ExpertPricerHome
 com.beasys.commerce.ebusiness.item.ItemPriceCalculationPolicy.DefaultPolicyClassName = com.acme.util.ExpertPricer
 


init() Method

public static void init()
The init method must be called before any BusinessPolicies are created. This is required for supporting pluggable BelongingHomes specified in the commerce.properties file.