org.fusesource.stompjms.jndi
Class JNDIStorable

java.lang.Object
  extended by org.fusesource.stompjms.jndi.JNDIStorable
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, javax.naming.Referenceable
Direct Known Subclasses:
StompJmsConnectionFactory, StompJmsDestination

public abstract class JNDIStorable
extends java.lang.Object
implements javax.naming.Referenceable, java.io.Externalizable

Facilitates objects to be stored in JNDI as properties

See Also:
Serialized Form

Constructor Summary
JNDIStorable()
           
 
Method Summary
protected abstract  void buildFromProperties(java.util.Map<java.lang.String,java.lang.String> props)
          Set the properties that will represent the instance in JNDI
 java.util.Map<java.lang.String,java.lang.String> getProperties()
          Get the properties from this instance for storing in JNDI
protected  java.lang.String getProperty(java.util.Map<java.lang.String,java.lang.String> map, java.lang.String key, java.lang.String defaultValue)
           
 javax.naming.Reference getReference()
          Retrive a Reference for this instance to store in JNDI
protected abstract  void populateProperties(java.util.Map<java.lang.String,java.lang.String> props)
          Initialize the instance from properties stored in JNDI
 void readExternal(java.io.ObjectInput in)
           
 void setProperties(java.util.Map<java.lang.String,java.lang.String> props)
          set the properties for this instance as retrieved from JNDI
 void writeExternal(java.io.ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JNDIStorable

public JNDIStorable()
Method Detail

buildFromProperties

protected abstract void buildFromProperties(java.util.Map<java.lang.String,java.lang.String> props)
Set the properties that will represent the instance in JNDI

Parameters:
props -

populateProperties

protected abstract void populateProperties(java.util.Map<java.lang.String,java.lang.String> props)
Initialize the instance from properties stored in JNDI

Parameters:
props -

setProperties

public void setProperties(java.util.Map<java.lang.String,java.lang.String> props)
set the properties for this instance as retrieved from JNDI

Parameters:
props -

getProperties

public java.util.Map<java.lang.String,java.lang.String> getProperties()
Get the properties from this instance for storing in JNDI

Returns:
the properties

getReference

public javax.naming.Reference getReference()
                                    throws javax.naming.NamingException
Retrive a Reference for this instance to store in JNDI

Specified by:
getReference in interface javax.naming.Referenceable
Returns:
the built Reference
Throws:
javax.naming.NamingException - if error on building Reference

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable
Parameters:
in -
Throws:
java.io.IOException
java.lang.ClassNotFoundException
See Also:
Externalizable.readExternal(java.io.ObjectInput)

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable
Parameters:
out -
Throws:
java.io.IOException
See Also:
Externalizable.writeExternal(java.io.ObjectOutput)

getProperty

protected java.lang.String getProperty(java.util.Map<java.lang.String,java.lang.String> map,
                                       java.lang.String key,
                                       java.lang.String defaultValue)


Copyright © 2010-2011 FuseSource, Corp.. All Rights Reserved.