public class SDOHelperContext
extends java.lang.Object
implements commonj.sdo.helper.HelperContext
Modifier and Type | Class and Description |
---|---|
static interface |
SDOHelperContext.HelperContextResolver
Strategy for
HelperContext creation. |
static class |
SDOHelperContext.MyNotificationFilter
INTERNAL:
This class will be handed in as a parameter when adding a JBoss notification listener.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
STRICT_TYPE_CHECKING_PROPERTY_NAME
Property controls strictness of
Type.getInstanceClass() type checking. |
Constructor and Description |
---|
SDOHelperContext()
Create a local HelperContext.
|
SDOHelperContext(java.lang.ClassLoader aClassLoader)
Create a local HelperContext.
|
SDOHelperContext(java.lang.String identifier)
Create a local HelperContext with the given identifier.
|
SDOHelperContext(java.lang.String identifier,
java.lang.ClassLoader aClassLoader)
Create a local HelperContext with the given identifier.
|
Modifier and Type | Method and Description |
---|---|
static void |
addAlias(java.lang.String identifier,
java.lang.String alias)
Add an alias to identifier pair to the alias Map for the current
application.
|
commonj.sdo.impl.ExternalizableDelegator.Resolvable |
createResolvable()
Create and return a new ExternalizableDelegator.Resolvable instance based
on this helper context.
|
commonj.sdo.impl.ExternalizableDelegator.Resolvable |
createResolvable(java.lang.Object target)
Create and return a new ExternalizableDelegator.Resolvable instance based
on this helper context and a given target.
|
commonj.sdo.helper.CopyHelper |
getCopyHelper()
Return the CopyHelper instance for this helper context.
|
commonj.sdo.helper.DataFactory |
getDataFactory()
Return the DataFactory instance for this helper context.
|
commonj.sdo.helper.DataHelper |
getDataHelper()
Return the DataHelper instance for this helper context.
|
commonj.sdo.helper.EqualityHelper |
getEqualityHelper()
Return the EqualityHelper instance for this helper context.
|
static commonj.sdo.helper.HelperContext |
getHelperContext()
INTERNAL:
Return the helper context for a given key.
|
static commonj.sdo.helper.HelperContext |
getHelperContext(java.lang.String identifier)
Return the local helper context associated with the given identifier, or
create one if it does not already exist.
|
static commonj.sdo.helper.HelperContext |
getHelperContext(java.lang.String identifier,
java.lang.ClassLoader classLoader)
Return the local helper context with the given identifier, or create
one if it does not already exist.
|
static SDOHelperContext.HelperContextResolver |
getHelperContextResolver()
Getter for HelperContextResolver
|
java.lang.String |
getIdentifier()
Return the unique label for this HelperContext.
|
java.lang.Object |
getProperty(java.lang.String name)
Return the value stored in the properties Map for a given
name, or null if an entry for name does not exist.
|
commonj.sdo.helper.TypeHelper |
getTypeHelper()
Return the TypeHelper instance for this helper context.
|
static java.util.Map<SDOTypeHelperDelegate.SDOWrapperTypeId,SDOWrapperType> |
getWrapperTypes()
Returns the
SDOWrapperType instances for current application |
commonj.sdo.helper.XMLHelper |
getXMLHelper()
Return the XMLHelper instance for this helper context.
|
commonj.sdo.helper.XSDHelper |
getXSDHelper()
Return the XSDHelper instance for this helper context.
|
static boolean |
hasHelperContext(java.lang.String identifier)
Return true if a HelperContext corresponding to this identifier or alias
already exists, else false.
|
static boolean |
isApplicationResolverSet()
Indicates if a call to setApplicationResolver has been made.
|
boolean |
isStrictTypeCheckingEnabled()
Indicates whether strict type checking is enabled.
|
void |
makeDefaultContext()
ADVANCED
Promote this helper context to be the default or global one.
|
static void |
putHelperContext(java.lang.ClassLoader key,
commonj.sdo.helper.HelperContext value)
INTERNAL:
Put a ClassLoader/HelperContext key/value pair in the Thread HelperContext
map.
|
static void |
putHelperContext(commonj.sdo.helper.HelperContext ctx)
Replaces the provided helper context in the map of identifiers to
helper contexts for this application. ctx.getIdentifier() will be
used to obtain the identifier value.
|
static java.util.Map<SDOTypeHelperDelegate.SDOWrapperTypeId,SDOWrapperType> |
putWrapperTypes(java.util.Map<SDOTypeHelperDelegate.SDOWrapperTypeId,SDOWrapperType> wrapperTypes)
Replaces the
SDOWrapperType instances for current application with the ones passed as an argument |
static void |
removeHelerContextResolver()
Removes HelperContextResolver for the current application.
|
static void |
removeHelperContext(java.lang.ClassLoader key)
INTERNAL:
Remove a ClassLoader/HelperContext key/value pair from the Thread
HelperContext map.
|
static void |
removeHelperContext(java.lang.String identifier,
java.lang.ClassLoader key)
INTERNAL
|
void |
reset()
Reset the Type,XML and XSD helper instances.
|
static void |
setApplicationResolver(ApplicationResolver aResolver)
ADVANCED:
Used to set an ApplicationResolver instance that will be used to retrieve
info pertaining to a given application, such as the application name, in
the case where our logic fails.
|
static void |
setHelperContextResolver(java.lang.Object helperContextResolver)
Method allows dynamically change HelperContext creation strategy.
|
static void |
setHelperContextResolver(SDOHelperContext.HelperContextResolver helperContextResolver)
Method allows dynamically change HelperContext creation strategy.
|
void |
setProperty(java.lang.String name,
java.lang.Object value)
Add a name/value pair to the properties Map.
|
void |
setStrictTypeCheckingEnabled(boolean enabled)
Controls type checking strictness.
|
public static final java.lang.String STRICT_TYPE_CHECKING_PROPERTY_NAME
Type.getInstanceClass()
type checking.
See isStrictTypeCheckingEnabled()
for more details.
By this property, the initial value can be changed.
Default value is true.
public SDOHelperContext()
public SDOHelperContext(java.lang.String identifier)
identifier
- The unique label for this HelperContext.public SDOHelperContext(java.lang.ClassLoader aClassLoader)
aClassLoader
- This class loader will be used to find static
instance classes.public SDOHelperContext(java.lang.String identifier, java.lang.ClassLoader aClassLoader)
identifier
- The unique label for this HelperContext.aClassLoader
- This class loader will be used to find static
instance classes.public static void setApplicationResolver(ApplicationResolver aResolver)
aResolver
- the ApplicationResolver instance that will be used to retrieve
info pertaining to a given application. Note that null is
considered a valid set operation.SDOException
- if more than one call is made to this method
in an active server instance.public static boolean isApplicationResolverSet()
public void reset()
public commonj.sdo.helper.CopyHelper getCopyHelper()
getCopyHelper
in interface commonj.sdo.helper.HelperContext
public commonj.sdo.helper.DataFactory getDataFactory()
getDataFactory
in interface commonj.sdo.helper.HelperContext
public commonj.sdo.helper.DataHelper getDataHelper()
getDataHelper
in interface commonj.sdo.helper.HelperContext
public commonj.sdo.helper.EqualityHelper getEqualityHelper()
getEqualityHelper
in interface commonj.sdo.helper.HelperContext
public commonj.sdo.helper.TypeHelper getTypeHelper()
getTypeHelper
in interface commonj.sdo.helper.HelperContext
public commonj.sdo.helper.XMLHelper getXMLHelper()
getXMLHelper
in interface commonj.sdo.helper.HelperContext
public commonj.sdo.helper.XSDHelper getXSDHelper()
getXSDHelper
in interface commonj.sdo.helper.HelperContext
public commonj.sdo.impl.ExternalizableDelegator.Resolvable createResolvable()
public commonj.sdo.impl.ExternalizableDelegator.Resolvable createResolvable(java.lang.Object target)
target
- public static void putHelperContext(java.lang.ClassLoader key, commonj.sdo.helper.HelperContext value)
key
- class loadervalue
- helper contextpublic static void removeHelperContext(java.lang.ClassLoader key)
key
- class loaderpublic static void removeHelperContext(java.lang.String identifier, java.lang.ClassLoader key)
identifier
- the specific identifier of the HelperContext to be removed. "" for a Global helperkey
- the ClassLoader associated with the HelperContext to be removedpublic static commonj.sdo.helper.HelperContext getHelperContext()
public static commonj.sdo.helper.HelperContext getHelperContext(java.lang.String identifier)
identifier
- the identifier or alias to use for lookup/creationpublic static commonj.sdo.helper.HelperContext getHelperContext(java.lang.String identifier, java.lang.ClassLoader classLoader)
public static void putHelperContext(commonj.sdo.helper.HelperContext ctx)
ctx
- the HelperContext to be added to the context Map for
the current applicationpublic static SDOHelperContext.HelperContextResolver getHelperContextResolver()
public static void setHelperContextResolver(java.lang.Object helperContextResolver)
helperContextResolver
- on this object SDOHelperContext.HelperContextResolver.getHelperContext(String, ClassLoader)
will be called.
If it is null - then default strategy will be set.public static void setHelperContextResolver(SDOHelperContext.HelperContextResolver helperContextResolver)
helperContextResolver
- strategy to be used. If it is null - then default strategy will be set.public static void removeHelerContextResolver()
public void makeDefaultContext()
public java.lang.String getIdentifier()
public static boolean hasHelperContext(java.lang.String identifier)
identifier
- the alias or identifier used to lookup a helper contextpublic static void addAlias(java.lang.String identifier, java.lang.String alias)
identifier
- assumed to be a key in the helper context Mapalias
- the alias to be associated with identifierpublic void setProperty(java.lang.String name, java.lang.Object value)
name
- the name of the propertyvalue
- the value of the propertypublic java.lang.Object getProperty(java.lang.String name)
name
- the name of the property to be returnedpublic boolean isStrictTypeCheckingEnabled()
If strict type checking is enabled then Type.getInstanceClass()
interface is checked whether it contains getters for all the properties
of the Type
upon initialization of the Type
.
If any getter is missing then the interface is ignored and
Type.getInstanceClass()
will return null
.
The getters are not checked if the strict type checking is disabled.
public void setStrictTypeCheckingEnabled(boolean enabled)
isStrictTypeCheckingEnabled()
for more details.enabled
- new value (true
to enable the strict validation)public static java.util.Map<SDOTypeHelperDelegate.SDOWrapperTypeId,SDOWrapperType> getWrapperTypes()
SDOWrapperType
instances for current applicationpublic static java.util.Map<SDOTypeHelperDelegate.SDOWrapperTypeId,SDOWrapperType> putWrapperTypes(java.util.Map<SDOTypeHelperDelegate.SDOWrapperTypeId,SDOWrapperType> wrapperTypes)
SDOWrapperType
instances for current application with the ones passed as an argumentwrapperTypes
- the SDOWrapperType instances to use for current application