openwebbeans-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gurkan Erdogdu <gurkanerdo...@yahoo.com>
Subject Re: svn commit: r1409751 - in /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy: ProxyFactory.java javassist/JavassistFactory.java
Date Thu, 15 Nov 2012 14:21:25 GMT
Currently no plan to switch. Probably remain in using javassist.


________________________________
 Kimden: Mark Struberg <struberg@yahoo.de>
Kime: "dev@openwebbeans.apache.org" <dev@openwebbeans.apache.org> 
Gönderildiği Tarih: 15 Kasım 2012 16:13 Perşembe
Konu: Re: svn commit: r1409751 - in /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy:
ProxyFactory.java javassist/JavassistFactory.java
 
Oki folks, good to know. Which means we need to take care about it in the future. 

Gurkan, do you plan to also switch to ASM in the middle future? Or will siwpas remain using
javassist?

In that case we should adopt our plans and add unit/integration tests for both. probably via
a maven profile?


LieGrue,
strub



----- Original Message -----
> From: Gurkan Erdogdu <gurkanerdogdu@yahoo.com>
> To: "dev@openwebbeans.apache.org" <dev@openwebbeans.apache.org>
> Cc: 
> Sent: Thursday, November 15, 2012 3:06 PM
> Subject: Re: svn commit: r1409751 - in /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy:
ProxyFactory.java javassist/JavassistFactory.java
> 
> In siwpas application server.
> 
> 
> 
> ________________________________
> Kimden: Romain Manni-Bucau <rmannibucau@gmail.com>
> Kime: dev@openwebbeans.apache.org 
> Gönderildiği Tarih: 15 Kasım 2012 16:02 Perşembe
> Konu: Re: Yan: svn commit: r1409751 - in 
> /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy: 
> ProxyFactory.java javassist/JavassistFactory.java
> 
> oops, ok this map is always empty in tomee....definitively a part of OWB to
> rework ;)
> 
> For my info where do you use it? in WAS?
> 
> *Romain Manni-Bucau*
> *Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
> *Blog: 
> **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
> *LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
> *Github: https://github.com/rmannibucau*
> 
> 
> 
> 
> 2012/11/15 Gurkan Erdogdu <gurkanerdogdu@yahoo.com>
> 
>>  Where is the location of this code in TomEE? (ProxyFactory #
>>  getEjbBeanProxyClass)
>> 
>> 
>>  ________________________________
>>   Kimden: Romain Manni-Bucau <rmannibucau@gmail.com>
>>  Kime: dev@openwebbeans.apache.org; Mark Struberg <struberg@yahoo.de>
>>  Gönderildiği Tarih: 15 Kasım 2012 15:53 Perşembe
>>  Konu: Re: svn commit: r1409751 - in
>>  /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy:
>>  ProxyFactory.java javassist/JavassistFactory.java
>> 
>>  +1 we use it pretty much in TomEE
>> 
>>  and not sure about the argument "the code is not used here so i can 
> change
>>  it"
>> 
>>  btw the separation could be reworked for sure
>> 
>>  *Romain Manni-Bucau*
>>  *Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
>>  *Blog: **http://rmannibucau.wordpress.com/*<
>>  http://rmannibucau.wordpress.com/>
>>  *LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
>>  *Github: https://github.com/rmannibucau*
>> 
>> 
>> 
>> 
>>  2012/11/15 Mark Struberg <struberg@yahoo.de>
>> 
>>  > Actually that code is used in TomEE afaik. We might think about better
>>  > separation between CDI and EJB in the end.
>>  >
>>  > Also this part would need unit test - another argument for creating a
>>  JIRA.
>>  >
>>  > LieGrue,
>>  > strub
>>  >
>>  >
>>  >
>>  >
>>  > ----- Original Message -----
>>  > > From: Gurkan Erdogdu <gurkanerdogdu@yahoo.com>
>>  > > To: "dev@openwebbeans.apache.org" 
> <dev@openwebbeans.apache.org>
>>  > > Cc:
>>  > > Sent: Thursday, November 15, 2012 2:16 PM
>>  > > Subject: Re: svn commit: r1409751 - in
>>  >
>>  /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy:
>>  > ProxyFactory.java javassist/JavassistFactory.java
>>  > >
>>  > > Hey Mark
>>  > >
>>  > >
>>  > > I don't think to create JIRA issues for every commit.  I 
> think that
>>  this
>>  > is
>>  > > not a big change, this method is not used in anywhere in the 
> codebase
>>  > and only
>>  > > used for EJB purposes. Someone removed this code while removing
>>  Javassist
>>  > > functionality and introduces regression. Sure to always open for 
> a big
>>  > changes!
>>  > >
>>  > >
>>  > > Gurkan
>>  > >
>>  > >
>>  > >
>>  > > ________________________________
>>  > > Kimden: Mark Struberg <struberg@yahoo.de>
>>  > > Kime: "dev@openwebbeans.apache.org"
>>  > > <dev@openwebbeans.apache.org>
>>  > > Gönderildiği Tarih: 15 Kasım 2012 15:10 Perşembe
>>  > > Konu: Re: svn commit: r1409751 - in
>>  > >
>>  >
>>  /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy:
>>  > > ProxyFactory.java javassist/JavassistFactory.java
>>  > >
>>  > > Gurkan, please create a JIRA for all other than cosmetical 
> changes!
>>  > > This is a pretty big change internally and really requires a JIRA
>>  entry.
>>  > >
>>  > > txs and LieGrue,
>>  > > strub
>>  > >
>>  > >
>>  > >
>>  > > ----- Original Message -----
>>  > >>  From: "gerdogdu@apache.org" 
> <gerdogdu@apache.org>
>>  > >>  To: commits@openwebbeans.apache.org
>>  > >>  Cc:
>>  > >>  Sent: Thursday, November 15, 2012 1:25 PM
>>  > >>  Subject: svn commit: r1409751 - in
>>  > >
>>  >
>>  /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy:
>>  > > ProxyFactory.java javassist/JavassistFactory.java
>>  > >>
>>  > >>  Author: gerdogdu
>>  > >>  Date: Thu Nov 15 12:25:17 2012
>>  > >>  New Revision: 1409751
>>  > >>
>>  > >>  URL: http://svn.apache.org/viewvc?rev=1409751&view=rev
>>  > >>  Log:
>>  > >>  Regression in Javassist remove updates
>>  > >>
>>  > >>  Modified:
>>  > >>
>>  > >>
>>  > >
>>  >
>> 
> openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/ProxyFactory.java
>>  > >>
>>  > >>
>>  > >
>>  >
>> 
> openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/javassist/JavassistFactory.java
>>  > >>
>>  > >>  Modified:
>>  > >>
>>  > >
>>  >
>> 
> openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/ProxyFactory.java
>>  > >>  URL:
>>  > >>
>>  > >
>>  >
>> 
> http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/ProxyFactory.java?rev=1409751&r1=1409750&r2=1409751&view=diff
>>  > >>
>>  > >
>>  >
>> 
> ==============================================================================
>>  > >>  ---
>>  > >>
>>  > >
>>  >
>> 
> openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/ProxyFactory.java
>>  > >
>>  > >>  (original)
>>  > >>  +++
>>  > >>
>>  > >
>>  >
>> 
> openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/ProxyFactory.java
>>  > >
>>  > >>  Thu Nov 15 12:25:17 2012
>>  > >>  @@ -22,6 +22,7 @@ import java.io.Serializable;
>>  > >>  import java.lang.reflect.Constructor;
>>  > >>  import java.lang.reflect.InvocationTargetException;
>>  > >>  import java.lang.reflect.Type;
>>  > >>  +import java.util.ArrayList;
>>  > >>  import java.util.HashSet;
>>  > >>  import java.util.Iterator;
>>  > >>  import java.util.List;
>>  > >>  @@ -106,12 +107,60 @@ public final class ProxyFactory
>>  > >>        */
>>  > >>       public Class<?> 
> getEjbBeanProxyClass(OwbBean<?> bean,
>>  > >>  Class<?> iface)
>>  > >>       {
>>  > >>  +        Class<?> proxyClass = null;
>>  > >>  +
>>  > >>           ConcurrentMap<Class<?>, Class<?>>
>>  > > typeToProxyClassMap
>>  > >>  = ejbProxyClasses.get(bean);
>>  > >>  -        if (typeToProxyClassMap != null)
>>  > >>  +        if (typeToProxyClassMap == null)
>>  > >>           {
>>  > >>  -            return typeToProxyClassMap.get(iface);
>>  > >>  +            typeToProxyClassMap = new 
> ConcurrentHashMap<Class<?>,
>>  > >
>>  > >>  Class<?>>();
>>  > >>  +            ConcurrentMap<Class<?>, 
> Class<?>>
>>  > > existingMap =
>>  > >>  ejbProxyClasses.putIfAbsent(bean, typeToProxyClassMap);
>>  > >>  +
>>  > >>  +            // use the map that beat us, because our new

> one
>>  > definitely
>>  > > had no
>>  > >>  classes in it.
>>  > >>  +            typeToProxyClassMap = (existingMap != null)
?
>>  existingMap
>>  > :
>>  > >>  typeToProxyClassMap;
>>  > >>           }
>>  > >>  -        return null;
>>  > >>  +
>>  > >>  +        proxyClass = typeToProxyClassMap.get(iface);
>>  > >>  +
>>  > >>  +        if (proxyClass == null)
>>  > >>  +        {
>>  > >>  +            Class<?> superClazz = null;
>>  > >>  +            List<Class<?>> list = new
>>  > >>  ArrayList<Class<?>>();
>>  > >>  +            Class<?>[] interfaces = null;
>>  > >>  +
>>  > >>  +            if (iface.isInterface())
>>  > >>  +            {
>>  > >>  +                list.add(iface);
>>  > >>  +            }
>>  > >>  +            else
>>  > >>  +            {
>>  > >>  +                // @LocalBean no-interface local view

> requested
>>  > >>  +                superClazz = iface;
>>  > >>  +                //Stateless beans with no interface
>>  > >>  +                //To failover bean instance
>>  > >>  +                Class<?>[] ifaces = 
> iface.getInterfaces();
>>  > >>  +                if(ifaces != null && ifaces.length

>>  0)
>>  > >>  +                {
>>  > >>  +                    //check for serializable
>>  > >>  +                    for(Class<?> temp : ifaces)
>>  > >>  +                    {
>>  > >>  +                        if(temp == Serializable.class)
>>  > >>  +                        {
>>  > >>  +                            list.add(Serializable.class);
>>  > >>  +                            break;
>>  > >>  +                        }
>>  > >>  +                    }
>>  > >>  +                }
>>  > >>  +            }
>>  > >>  +
>>  > >>  +            interfaces = new Class<?>[list.size()];
>>  > >>  +            interfaces = list.toArray(interfaces);
>>  > >>  +            proxyClass = factory.getProxyClass(superClazz,
>>  > interfaces);
>>  > >>  +
>>  > >>  +            typeToProxyClassMap.putIfAbsent(iface, 
> proxyClass);
>>  > >>  +            // don't care if we were beaten in updating

> the
>>  > >>  iface->proxyclass map
>>  > >>  +        }
>>  > >>  +
>>  > >>  +        return proxyClass;
>>  > >>       }
>>  > >>
>>  > >>       public Object createDecoratorDelegate(OwbBean<?>

> bean,
>>  > >>  DelegateHandler newDelegateHandler)
>>  > >>
>>  > >>  Modified:
>>  > >>
>>  > >
>>  >
>> 
> openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/javassist/JavassistFactory.java
>>  > >>  URL:
>>  > >>
>>  > >
>>  >
>> 
> http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/javassist/JavassistFactory.java?rev=1409751&r1=1409750&r2=1409751&view=diff
>>  > >>
>>  > >
>>  >
>> 
> ==============================================================================
>>  > >>  ---
>>  > >>
>>  > >
>>  >
>> 
> openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/javassist/JavassistFactory.java
>>  > >
>>  > >>  (original)
>>  > >>  +++
>>  > >>
>>  > >
>>  >
>> 
> openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/javassist/JavassistFactory.java
>>  > >
>>  > >>  Thu Nov 15 12:25:17 2012
>>  > >>  @@ -38,7 +38,10 @@ public class JavassistFactory
>>  > >>       {
>>  > >>           ProxyFactory fact = new ProxyFactory();
>>  > >>           fact.setInterfaces(interfaces);
>>  > >>  -        fact.setSuperclass(superClass);
>>  > >>  +        if(superClass != null)
>>  > >>  +        {
>>  > >>  +            fact.setSuperclass(superClass);
>>  > >>  +        }
>>  > >>           fact.setFilter(FinalizeMethodFilter.INSTANCE);
>>  > >>
>>  > >>           return getProxyClass(fact);
>>  > >>
>>  > >
>>  >
>
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message