[jboss-cvs] JBossAS SVN: r82187 - projects/ejb3/trunk/common/src/main/java/org/jboss/ejb3/common/kernel.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Dec 10 06:58:21 EST 2008
Author: alesj
Date: 2008-12-10 06:58:21 -0500 (Wed, 10 Dec 2008)
New Revision: 82187
Modified:
projects/ejb3/trunk/common/src/main/java/org/jboss/ejb3/common/kernel/DefaultHandleFactory.java
projects/ejb3/trunk/common/src/main/java/org/jboss/ejb3/common/kernel/Handle.java
projects/ejb3/trunk/common/src/main/java/org/jboss/ejb3/common/kernel/HandleFactory.java
Log:
[EJBTHREE-1617]; extend factory with alias.
Modified: projects/ejb3/trunk/common/src/main/java/org/jboss/ejb3/common/kernel/DefaultHandleFactory.java
===================================================================
--- projects/ejb3/trunk/common/src/main/java/org/jboss/ejb3/common/kernel/DefaultHandleFactory.java 2008-12-10 11:54:03 UTC (rev 82186)
+++ projects/ejb3/trunk/common/src/main/java/org/jboss/ejb3/common/kernel/DefaultHandleFactory.java 2008-12-10 11:58:21 UTC (rev 82187)
@@ -22,6 +22,8 @@
package org.jboss.ejb3.common.kernel;
import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.dependency.spi.ScopeInfo;
+import org.jboss.metadata.spi.scope.ScopeKey;
/**
* The default handle factory.
@@ -48,11 +50,21 @@
public Handle createHandle(ControllerContext context)
{
+ return createHandle(context, context.getName());
+ }
+
+ public Handle createHandle(ControllerContext context, Object alias)
+ {
if (context == null)
throw new IllegalArgumentException("Null context");
+ if (alias == null)
+ throw new IllegalArgumentException("Null alias");
- // TODO - check scoped context
+ ScopeInfo scopeInfo = context.getScopeInfo();
+ ScopeKey scopeKey = scopeInfo.getInstallScope();
+ if (scopeKey != null)
+ return new ScopeKeyHandle(scopeKey, alias);
- return new UniqueNameHandle(context.getName());
+ return new UniqueNameHandle(alias);
}
}
\ No newline at end of file
Modified: projects/ejb3/trunk/common/src/main/java/org/jboss/ejb3/common/kernel/Handle.java
===================================================================
--- projects/ejb3/trunk/common/src/main/java/org/jboss/ejb3/common/kernel/Handle.java 2008-12-10 11:54:03 UTC (rev 82186)
+++ projects/ejb3/trunk/common/src/main/java/org/jboss/ejb3/common/kernel/Handle.java 2008-12-10 11:58:21 UTC (rev 82187)
@@ -26,7 +26,7 @@
import org.jboss.kernel.Kernel;
/**
- * The MC bean handle.
+ * The serializable MC bean handle.
*
* @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
*/
Modified: projects/ejb3/trunk/common/src/main/java/org/jboss/ejb3/common/kernel/HandleFactory.java
===================================================================
--- projects/ejb3/trunk/common/src/main/java/org/jboss/ejb3/common/kernel/HandleFactory.java 2008-12-10 11:54:03 UTC (rev 82186)
+++ projects/ejb3/trunk/common/src/main/java/org/jboss/ejb3/common/kernel/HandleFactory.java 2008-12-10 11:58:21 UTC (rev 82187)
@@ -37,4 +37,13 @@
* @return context's handle
*/
Handle createHandle(ControllerContext context);
+
+ /**
+ * Create handle for an alias.
+ *
+ * @param context the context
+ * @param alias the context's alias
+ * @return contgext's handle
+ */
+ Handle createHandle(ControllerContext context, Object alias);
}
\ No newline at end of file
More information about the jboss-cvs-commits
mailing list