Package org.apache.qpid.jms.jndi
Class JNDIStorable
- java.lang.Object
-
- org.apache.qpid.jms.jndi.JNDIStorable
-
- All Implemented Interfaces:
Externalizable,Serializable,Referenceable
- Direct Known Subclasses:
JmsConnectionFactory,JmsDestination
public abstract class JNDIStorable extends Object implements Referenceable, Externalizable
Facilitates objects to be stored in JNDI as properties- Since:
- 1.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description JNDIStorable()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract Map<String,String>buildFromProperties(Map<String,String> props)Set the properties that will represent the instance in JNDIMap<String,String>getProperties()Get the properties from this instance for storing in JNDIprotected StringgetProperty(Map<String,String> map, String key, String defaultValue)ReferencegetReference()Retrieve a Reference for this instance to store in JNDIprotected abstract voidpopulateProperties(Map<String,String> props)Initialize the instance from properties stored in JNDIvoidreadExternal(ObjectInput in)Map<String,String>setProperties(Map<String,String> props)set the properties for this instance as retrieved from JNDIvoidwriteExternal(ObjectOutput out)
-
-
-
Method Detail
-
buildFromProperties
protected abstract Map<String,String> buildFromProperties(Map<String,String> props)
Set the properties that will represent the instance in JNDI- Parameters:
props- The properties to use when building the new isntance.- Returns:
- a new, unmodifiable, map containing any unused properties, or empty if none were.
-
populateProperties
protected abstract void populateProperties(Map<String,String> props)
Initialize the instance from properties stored in JNDI- Parameters:
props- The properties to use when initializing the new instance.
-
setProperties
public Map<String,String> setProperties(Map<String,String> props)
set the properties for this instance as retrieved from JNDI- Parameters:
props- The properties to apply to this instance.- Returns:
- a new, unmodifiable, map containing any unused properties, or empty if none were.
-
getProperties
public Map<String,String> getProperties()
Get the properties from this instance for storing in JNDI- Returns:
- the properties
-
getReference
public Reference getReference() throws NamingException
Retrieve a Reference for this instance to store in JNDI- Specified by:
getReferencein interfaceReferenceable- Returns:
- the built Reference
- Throws:
NamingException- if error on building Reference
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException- See Also:
Externalizable.readExternal(java.io.ObjectInput)
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException- See Also:
Externalizable.writeExternal(java.io.ObjectOutput)
-
-