public class InitialContextBinder extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
BIND_NAME_ATTR |
static String |
BIND_REFERENCES_ELEMENT |
protected Map<String,Reference> |
bindings
All current binded references.
|
protected String |
bindingsStorePath
Absolute file path to references's storage.
|
static String |
CLASS_NAME_ATTR |
static String |
FACTORY_ATTR |
static String |
FACTORY_LOCATION_ATTR |
protected InitialContextInitializer |
initialContextInitializer
Initial context binder.
|
static String |
PROPERTY_ELEMENT |
static String |
REFADDR_ELEMENT |
static String |
REFERENCE_ELEMENT |
| Modifier and Type | Method and Description |
|---|---|
void |
bind(String bindName,
Reference reference)
Binds the reference in initial contexts and persists list of all binded
references into file.
|
void |
bind(String bindName,
String className,
String factory,
String factoryLocation,
Map<String,String> refAddr)
Constructs references from params, binds in initial contexts and persists list of all binded
references into file.
|
Reference |
getReference(String bindName)
Returns reference associated with defined name.
|
protected Map<String,Reference> |
readBindings()
Import references from xml-file.
|
protected void |
saveBindings()
Export references into xml-file.
|
void |
unbind(String bindName)
Unbind the Reference with defined name, remove from the bindings list and persists the rest of references
into the file.
|
public static final String BIND_REFERENCES_ELEMENT
public static final String REFERENCE_ELEMENT
public static final String PROPERTY_ELEMENT
public static final String REFADDR_ELEMENT
public static final String BIND_NAME_ATTR
public static final String CLASS_NAME_ATTR
public static final String FACTORY_ATTR
public static final String FACTORY_LOCATION_ATTR
protected final InitialContextInitializer initialContextInitializer
protected final String bindingsStorePath
public void bind(String bindName, String className, String factory, String factoryLocation, Map<String,String> refAddr) throws NamingException, FileNotFoundException, XMLStreamException
bindName - bind nameclassName - class namefactory - factory namefactoryLocation - factory locationrefAddr - map of references's propertiesNamingException - if error occurs due to bindingXMLStreamExceptionFileNotFoundExceptionpublic void bind(String bindName, Reference reference) throws NamingException, FileNotFoundException, XMLStreamException
bindName - bind namereference - referenceNamingException - if error occurs due to bindingFileNotFoundExceptionXMLStreamExceptionpublic void unbind(String bindName) throws NamingException, FileNotFoundException, XMLStreamException
bindName - the Reference's bind nameNamingExceptionFileNotFoundExceptionXMLStreamExceptionpublic Reference getReference(String bindName)
bindName - the name on which the reference was binded.protected void saveBindings()
throws FileNotFoundException,
XMLStreamException
XMLStreamException - if any exception occurs during exportFileNotFoundException - if can't open output stream from fileprotected Map<String,Reference> readBindings() throws FileNotFoundException, XMLStreamException
XMLStreamException - if errors occurs during importFileNotFoundException - if can't open input stream from fileCopyright © 2019 eXo Platform SAS. All Rights Reserved.