Author: nickarls
Date: 2008-10-29 10:03:54 -0400 (Wed, 29 Oct 2008)
New Revision: 207
Removed:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ClientProxy.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ProxyData.java
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/NormalContext.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/ClientProxyFactory.java
Log:
Minor. WS and comments.
Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ClientProxy.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ClientProxy.java 2008-10-29
10:58:20 UTC (rev 206)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ClientProxy.java 2008-10-29
14:03:54 UTC (rev 207)
@@ -1,26 +0,0 @@
-package org.jboss.webbeans;
-
-import javax.webbeans.manager.Bean;
-import javax.webbeans.manager.Context;
-import javax.webbeans.manager.Manager;
-
-public class ClientProxy<T>
-{
- private Bean<T> bean;
- private Manager manager;
-
- public ClientProxy(Bean<T> bean, Manager manager)
- {
- this.bean = bean;
- this.manager = manager;
- }
-
- public T getInstance()
- {
- Context context = manager.getContext(bean.getScopeType());
- T instance = context.get(bean, true);
- // wrap in proxy here
- return instance;
- }
-
-}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java 2008-10-29
10:58:20 UTC (rev 206)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java 2008-10-29
14:03:54 UTC (rev 207)
@@ -294,7 +294,8 @@
contextMap.getDependentContext().setActive(true);
if (getModelManager().getScopeModel(bean.getScopeType()).isNormal())
{
- return (T) getClientProxy(bean);
+ // TODO What *really* to proxy? The bean? The instance?
+ return (T) getClientProxy(bean).create();
}
else
{
Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ProxyData.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ProxyData.java 2008-10-29
10:58:20 UTC (rev 206)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ProxyData.java 2008-10-29
14:03:54 UTC (rev 207)
@@ -1,27 +0,0 @@
-package org.jboss.webbeans;
-
-import javax.webbeans.manager.Bean;
-import javax.webbeans.manager.Manager;
-
-public class ProxyData
-{
- private Bean<?> bean;
- private Manager manager;
-
- public ProxyData(Bean<?> bean, Manager manager)
- {
- this.bean = bean;
- this.manager = manager;
- }
-
- public Bean<?> getBean()
- {
- return bean;
- }
-
- public Manager getManager()
- {
- return manager;
- }
-
-}
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/NormalContext.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/NormalContext.java 2008-10-29
10:58:20 UTC (rev 206)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/NormalContext.java 2008-10-29
14:03:54 UTC (rev 207)
@@ -8,13 +8,13 @@
public abstract class NormalContext extends AbstractContext
{
-
private BeanMap beans;
public NormalContext(Class<? extends Annotation> scopeType)
{
super(scopeType);
beans = new BeanMap();
+ //TODO Are they active at creation?
active = true;
}
@@ -25,6 +25,7 @@
throw new ContextNotActiveException();
}
+ //TODO violation of specs. Why not just set active to false in destroy()?
if (beans == null)
{
// Context has been destroyed
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/ClientProxyFactory.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/ClientProxyFactory.java 2008-10-29
10:58:20 UTC (rev 206)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/ClientProxyFactory.java 2008-10-29
14:03:54 UTC (rev 207)
@@ -11,6 +11,9 @@
import javax.webbeans.manager.Context;
import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.test.beans.Tuna;
+import org.jboss.webbeans.test.mock.MockManagerImpl;
+import org.jboss.webbeans.test.util.Util;
public class ClientProxyFactory
{
Show replies by date