[webbeans-commits] Webbeans SVN: r288 - ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb.
webbeans-commits at lists.jboss.org
webbeans-commits at lists.jboss.org
Sun Nov 9 09:57:41 EST 2008
Author: gavin.king at jboss.com
Date: 2008-11-09 09:57:41 -0500 (Sun, 09 Nov 2008)
New Revision: 288
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/DefaultEnterpriseBeanLookup.java
Log:
wire in the lookup method
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/DefaultEnterpriseBeanLookup.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/DefaultEnterpriseBeanLookup.java 2008-11-09 08:00:48 UTC (rev 287)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/DefaultEnterpriseBeanLookup.java 2008-11-09 14:57:41 UTC (rev 288)
@@ -12,15 +12,14 @@
@Standard
public class DefaultEnterpriseBeanLookup implements EnterpriseBeanLookup
{
+ private Map<String, EjbMetaData<?>> ejbMetaDataMap = new HashMap<String, EjbMetaData<?>>();
+
public Object lookup(String ejbName)
{
- // TODO Auto-generated method stub
- return null;
+ return lookup( ejbMetaDataMap.get(ejbName) );
}
- private Map<String, EjbMetaData<?>> ejbMetaDataMap = new HashMap<String, EjbMetaData<?>>();
-
- // TODO Should this be static?
- public <T> T lookup(EjbMetaData<T> ejb)
+
+ public static <T> T lookup(EjbMetaData<T> ejb)
{
if (ejb.getEjbLinkJndiName() != null)
{
@@ -36,20 +35,11 @@
}
}
- @SuppressWarnings("unchecked")
+ //TODO: this method needs to get called at startup
public <T> EjbMetaData<T> registerEjbMetaData(Class<? extends T> clazz)
{
- // TODO replace with an application lookup
- if (!ejbMetaDataMap.containsKey(clazz))
- {
- EjbMetaData<T> ejbMetaData = new EjbMetaData<T>(clazz);
- ejbMetaDataMap.put(ejbMetaData.getEjbName(), ejbMetaData);
- return ejbMetaData;
- }
- else
- {
- return (EjbMetaData<T>) ejbMetaDataMap.get(clazz);
- }
-
+ EjbMetaData<T> ejbMetaData = new EjbMetaData<T>(clazz);
+ ejbMetaDataMap.put(ejbMetaData.getEjbName(), ejbMetaData);
+ return ejbMetaData;
}
}
More information about the weld-commits
mailing list