|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface JNDIBeanPropertyHandler
A handler to translate JNDI attributes into Java Bean property values and vice versa. The behviour of some handlers can be altered by specifying "initialization properties" that specify parameters relevant to the handler. All classes implementing this interface should provide a no argument constructor.
A handler implementation is generally written to convert a set of
JNDI attribute values to a single bean property value and vice versa.
The size of the Attribute array passed to
getPropertyValue and the size of the
list returned by getAttributeValues should be the same.
The size and order is determined by the attributes listed in the
<property> mapping in the XML configuration.
For example, if a mapping like this is being used:
<property>
<name>foo</name>
<attr>a</attr>
<attr>b</attr>
<attr>c</attr>
<attr>d</attr>
</property>
Then the getPropertyValue method will receive an
array with four Attributes. attr[0] will be
attribute "a", attr[1] attribute "b", etc. Similarly,
getAttributeValues must return a List with
four members, the first being the value of attribute "a", the
second for "b", etc.
JNDIBeanStoreFactory| Field Summary | |
|---|---|
static Logger |
logger
|
| Method Summary | |
|---|---|
List<?> |
getAttributeValues(Object value)
Converts a Java Bean property value into one or more JNDI attribute values. |
Object |
getPropertyValue(Attribute[] attr)
Converts a list of JNDI attributes into an object suitable for a Java Bean property value. |
void |
init(Properties props)
Provides a set of properties to initialize the handler. |
| Field Detail |
|---|
static final Logger logger
| Method Detail |
|---|
void init(Properties props)
throws JNDIBeanStoreConfigException
JNDIBeanStoreFactory
with the properties listed by its XML configuration data.
props - The properties to use for initialization.
JNDIBeanStoreConfigException - If any of the properties were
invalid in any way.
@Nullable
Object getPropertyValue(Attribute[] attr)
throws NamingException
Attributes
in the array will appear in the order specified in the XML mapping.
attr - An array of JNDI attributes.
NamingException - If an attribute's values could not be read.
JNDIBeanStoreException - If the attribute values could not
be processed.
List<?> getAttributeValues(Object value)
throws JNDIBeanStoreException
Collection.
value - The bean property value to be converted.
Collection values will be converted
to multivalued attributes.
JNDIBeanStoreException - If the bean property value could
not be processed.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||