[jboss-cvs] JBossAS SVN: r67762 - projects/microcontainer/trunk/docs/User_Guide/src/main/docbook.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Dec 3 03:52:37 EST 2007
Author: newtonm
Date: 2007-12-03 03:52:37 -0500 (Mon, 03 Dec 2007)
New Revision: 67762
Modified:
projects/microcontainer/trunk/docs/User_Guide/src/main/docbook/User_Guide.xml
Log:
Refactored JNDI description.
Modified: projects/microcontainer/trunk/docs/User_Guide/src/main/docbook/User_Guide.xml
===================================================================
--- projects/microcontainer/trunk/docs/User_Guide/src/main/docbook/User_Guide.xml 2007-12-03 08:50:26 UTC (rev 67761)
+++ projects/microcontainer/trunk/docs/User_Guide/src/main/docbook/User_Guide.xml 2007-12-03 08:52:37 UTC (rev 67762)
@@ -875,8 +875,8 @@
ControllerContext context = controller.getInstalledContext(HRSERVICE);
if (context != null) { manager = (HRManager) context.getTarget(); }</programlisting>
<para>Handing out kernel references to every client that looks up a service represents a significant risk as it provides wide-spread access to the microcontainer configuration. It would be better to apply the ServiceLocator pattern and have a class that performs lookups on behalf of the clients. Better still we could pass the bean references, together with their names, to the ServiceLocator at deployment time using a lifecycle callback so that it could look them up without knowing about the microcontainer at all. Undeployment would subsequently remove the bean references from the ServiceLocator to prevent further lookups. </para>
- <para>While it would not be too difficult to write our own ServiceLocator implementation we can save time and follow industry standards by integrating an existing one such as JBoss NS that implements the Java Naming and Directory Interface (JNDI) specification. JNDI enables clients to access different, possibly multiple, naming services using a common API. </para>
- <para>All that we need to do is create an instance of JBoss NS using the microcontainer and then add a lifecycle callback to perform the binding and unbinding of our bean references during deployment/undeployment. We can then mark the bean classes that we wish to do this for using annotations and find them at runtime using the shorthand pointcut expression as shown earlier.</para>
+ <para>While it would not be too difficult to write our own ServiceLocator implementation to do this we can save time by integrating an existing one such as JBoss Naming Service (JBoss NS). This has the additional benefit of complying to the Java Naming and Directory Interface (JNDI) specification. JNDI enables clients to access different, possibly multiple, naming services using a common API. </para>
+ <para>All that we need to do is create an instance of JBoss NS using the microcontainer and then add a lifecycle callback to perform the binding and unbinding of our bean references during deployment/undeployment. We can then mark the bean classes that we wish to bind references for using annotations and find them at runtime using the shorthand pointcut expression as shown earlier.</para>
</section>
</chapter>
<chapter>
More information about the jboss-cvs-commits
mailing list