[jboss-cvs] JBossAS SVN: r73828 - projects/ejb3/trunk/common/src/main/java/org/jboss/ejb3/common/registrar/spi.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri May 30 04:03:36 EDT 2008
Author: ALRubinger
Date: 2008-05-30 04:03:36 -0400 (Fri, 30 May 2008)
New Revision: 73828
Modified:
projects/ejb3/trunk/common/src/main/java/org/jboss/ejb3/common/registrar/spi/Ejb3RegistrarLocator.java
projects/ejb3/trunk/common/src/main/java/org/jboss/ejb3/common/registrar/spi/NotBoundException.java
Log:
[EJBTHREE-1379] NotBoundException is now unchecked
Modified: projects/ejb3/trunk/common/src/main/java/org/jboss/ejb3/common/registrar/spi/Ejb3RegistrarLocator.java
===================================================================
--- projects/ejb3/trunk/common/src/main/java/org/jboss/ejb3/common/registrar/spi/Ejb3RegistrarLocator.java 2008-05-30 06:27:36 UTC (rev 73827)
+++ projects/ejb3/trunk/common/src/main/java/org/jboss/ejb3/common/registrar/spi/Ejb3RegistrarLocator.java 2008-05-30 08:03:36 UTC (rev 73828)
@@ -75,15 +75,16 @@
* a RuntimeException will be thrown
*
* @return
+ * @throws NotBoundException
*/
- public static Ejb3Registrar locateRegistrar()
+ public static Ejb3Registrar locateRegistrar() throws NotBoundException
{
// If no registrar implementation has been set
if (Ejb3RegistrarLocator.instance == null)
{
// Throw unchecked exception to the user
- throw new RuntimeException(new NotBoundException("Could not retrieve " + Ejb3Registrar.class.getSimpleName()
- + " as a registrar implementation has not yet been bound."));
+ throw new NotBoundException("Could not retrieve " + Ejb3Registrar.class.getSimpleName()
+ + " as a registrar implementation has not yet been bound.");
}
// Return the registrar
@@ -112,6 +113,17 @@
log.debug("Bound " + Ejb3Registrar.class.getSimpleName() + ": " + registrar);
}
+ /**
+ * Returns whether or not the Ejb3Registrar
+ * has been bound to this Process
+ *
+ * @return
+ */
+ public static boolean isRegistrarBound()
+ {
+ return Ejb3RegistrarLocator.instance != null;
+ }
+
// --------------------------------------------------------------------------------||
// Accessors / Mutators -----------------------------------------------------------||
// --------------------------------------------------------------------------------||
Modified: projects/ejb3/trunk/common/src/main/java/org/jboss/ejb3/common/registrar/spi/NotBoundException.java
===================================================================
--- projects/ejb3/trunk/common/src/main/java/org/jboss/ejb3/common/registrar/spi/NotBoundException.java 2008-05-30 06:27:36 UTC (rev 73827)
+++ projects/ejb3/trunk/common/src/main/java/org/jboss/ejb3/common/registrar/spi/NotBoundException.java 2008-05-30 08:03:36 UTC (rev 73828)
@@ -25,13 +25,13 @@
* NotBoundException
*
* Signals that an operation cannot complete because
- * a requested object could not be found in the Ejb3Registry
+ * a requested object could not be found
*
* @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
* @version $Revision: $
* @see {@link Ejb3Registrar}
*/
-public class NotBoundException extends Exception
+public class NotBoundException extends RuntimeException
{
// --------------------------------------------------------------------------------||
More information about the jboss-cvs-commits
mailing list