eXo Platform 3.5

## Chapter 60. Initial Context Binder

Initial Context Binder is responsible for binding references at runtime, persisting in file and automatically rebinding. Java temp directory is used to persist references in bind-references.xml file by default. In case when need to definde special file it can be done by add parameter to InitialContextInitializer configuration.

## API

Service provide methods for binding reference:

    public void bind(String bindName, String className, String factory, String factoryLocation, Map<String, String> refAddr) throws NamingException, FileNotFoundException, XMLStreamExcept

- bindName - name of binding

- className - the fully-qualified name of the class of the object to which this Reference refers

- factory - the name of the factory class for creating an instance of the object to which this Reference refers

- factoryLocation - the location of the factory class

- refAddr - object's properties map

    public void bind(String bindName, Reference ref) throws NamingException, FileNotFoundException, XMLStreamExcept

Returns reference associated with defined name:

    public Reference getReference(String bindName)

Unbind the Reference with defined name:

    public void unbind(String bindName) throws NamingException, FileNotFoundException, XMLStreamException