[exo-jcr-commits] exo-jcr SVN: r4579 - kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/services/naming.
do-not-reply at jboss.org
do-not-reply at jboss.org
Fri Jul 1 08:50:37 EDT 2011
Author: tolusha
Date: 2011-07-01 08:50:37 -0400 (Fri, 01 Jul 2011)
New Revision: 4579
Modified:
kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/services/naming/InitialContextBinder.java
Log:
EXOJCR-1397: Create method which allow to bind with already existed reference object
Modified: kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/services/naming/InitialContextBinder.java
===================================================================
--- kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/services/naming/InitialContextBinder.java 2011-07-01 12:35:58 UTC (rev 4578)
+++ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/services/naming/InitialContextBinder.java 2011-07-01 12:50:37 UTC (rev 4579)
@@ -107,7 +107,7 @@
Map<String, Reference> importedRefs = readBindings();
for (Entry<String, Reference> entry : importedRefs.entrySet())
{
- bind(entry.getKey(), entry.getValue());
+ bindInternally(entry.getKey(), entry.getValue());
}
}
}
@@ -150,12 +150,33 @@
reference.add(new StringRefAddr(entry.getKey(), entry.getValue()));
}
- bind(bindName, reference);
+ bindInternally(bindName, reference);
saveBindings();
}
/**
+ * Binds the reference in initial contexts and persists list of all binded
+ * references into file.
+ *
+ * @param bindName
+ * bind name
+ * @param reference
+ * reference
+ * @throws NamingException
+ * if error occurs due to binding
+ * @throws FileNotFoundException
+ * @throws XMLStreamException
+ */
+ public void bind(String bindName, Reference reference) throws NamingException, FileNotFoundException,
+ XMLStreamException
+ {
+ bindInternally(bindName, reference);
+
+ saveBindings();
+ }
+
+ /**
* Returns reference associated with defined name.
*
* @param bindName the name on which the reference was binded.
@@ -165,7 +186,7 @@
return bindings.get(bindName);
}
- private void bind(String bindName, Reference reference) throws NamingException
+ private void bindInternally(String bindName, Reference reference) throws NamingException
{
try
{
More information about the exo-jcr-commits
mailing list