org.apache.activemq.artemis.jndi

## Class JNDIStorable

- java.lang.Object
- - org.apache.activemq.artemis.jndi.JNDIStorable

- All Implemented Interfaces:
    Externalizable, Serializable, Referenceable

      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 and Description
    `JNDIStorable()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected abstract Map<String,String>` | `buildFromProperties(Map<String,String> props)` Set the properties that will represent the instance in JNDI
    `Map<String,String>` | `getProperties()` Get the properties from this instance for storing in JNDI
    `protected String` | `getProperty(Map<String,String> map, String key, String defaultValue)`
    `Reference` | `getReference()` Retrieve a Reference for this instance to store in JNDI
    `protected abstract void` | `populateProperties(Map<String,String> props)` Initialize the instance from properties stored in JNDI
    `void` | `readExternal(ObjectInput in)`
    `Map<String,String>` | `setProperties(Map<String,String> props)` set the properties for this instance as retrieved from JNDI
    `void` | `writeExternal(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 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:
        `getReference` in interface `Referenceable`
      Returns:
        the built Reference
      Throws:
        `NamingException` - if error on building Reference

    - #### readExternal

          public void readExternal(ObjectInput in)
                            throws IOException,
                                   ClassNotFoundException

      Specified by:
        `readExternal` in interface `Externalizable`
      Throws:
        `IOException`
        `ClassNotFoundException`
      See Also:
        `Externalizable.readExternal(ObjectInput)`

    - #### writeExternal

          public void writeExternal(ObjectOutput out)
                             throws IOException

      Specified by:
        `writeExternal` in interface `Externalizable`
      Throws:
        `IOException`
      See Also:
        `Externalizable.writeExternal(ObjectOutput)`

    - #### getProperty

          protected String getProperty(Map<String,String> map,
                                       String key,
                                       String defaultValue)

Copyright © 2017 The Apache Software Foundation. All rights reserved.