oh thanks, yup, will do that. LieGrue, strub
--- Gurkan Erdogdu <[email protected]> schrieb am So, 21.2.2010: > Von: Gurkan Erdogdu <[email protected]> > Betreff: Re: AW: svn commit: r912404 - in > /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans: > component/ container/ context/creational/ intercept/ intercept/webbeans/ > proxy/ util/ > An: [email protected] > Datum: Sonntag, 21. Februar, 2010 23:00 Uhr > Mark; > > > testProxySerialization(org.apache.webbeans.newtests.contexts.SerializationTest) > > > This test is failed!. Could you add it to ignore list until > new version of Javassist? > > > --Gurkan > > > ________________________________ > From: Mark Struberg <[email protected]> > To: [email protected] > Sent: Sun, February 21, 2010 11:25:11 PM > Subject: AW: svn commit: r912404 - in > /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans: > component/ container/ context/creational/ intercept/ > intercept/webbeans/ proxy/ util/ > > please note that you use the patched javassist version [1] > to make the serialisation work. > > The patch has already been submitted to JBoss [2]. > > LieGrue, > strub > > [1] http://github.com/struberg/javassist > [2] https://jira.jboss.org/jira/browse/JASSIST-97 > > --- [email protected] > <[email protected]> > schrieb am So, 21.2.2010: > > > Von: [email protected] > <[email protected]> > > Betreff: svn commit: r912404 - in > /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans: > component/ container/ context/creational/ intercept/ > intercept/webbeans/ proxy/ util/ > > An: [email protected] > > Datum: Sonntag, 21. Februar, 2010 22:10 Uhr > > Author: struberg > > Date: Sun Feb 21 21:10:44 2010 > > New Revision: 912404 > > > > URL: http://svn.apache.org/viewvc?rev=912404&view=rev > > Log: > > OWB-6 further passiation and CreationalContext fixes > > > > Added: > > > > > openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/creational/DependentCreationalContext.java > > Modified: > > > > > openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BeanManagerBean.java > > > > > openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ConversationBean.java > > > > > openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ExtensionBean.java > > > > > openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java > > > > > openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/creational/CreationalContextImpl.java > > > > > openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandler.java > > > > > openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/webbeans/WebBeansInterceptor.java > > > > > openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/JavassistProxyFactory.java > > > > > openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java > > > > Modified: > > > openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BeanManagerBean.java > > URL: > > http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BeanManagerBean.java?rev=912404&r1=912403&r2=912404&view=diff > > > ============================================================================== > > --- > > > openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BeanManagerBean.java > > (original) > > +++ > > > openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BeanManagerBean.java > > Sun Feb 21 21:10:44 2010 > > @@ -16,6 +16,7 @@ > > import > javax.enterprise.context.spi.CreationalContext; > > import javax.enterprise.inject.spi.BeanManager; > > > > +import > > > org.apache.webbeans.annotation.ApplicationScopeLiteral; > > import > org.apache.webbeans.container.BeanManagerImpl; > > > > public class BeanManagerBean extends > > AbstractOwbBean<BeanManager> > > @@ -34,6 +35,7 @@ > > { > > > > manager = BeanManagerImpl.getManager(); > > } > > + setImplScopeType(new > > ApplicationScopeLiteral()); > > > > return manager; > > } > > > > Modified: > > > openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ConversationBean.java > > URL: > > http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ConversationBean.java?rev=912404&r1=912403&r2=912404&view=diff > > > ============================================================================== > > --- > > > openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ConversationBean.java > > (original) > > +++ > > > openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ConversationBean.java > > Sun Feb 21 21:10:44 2010 > > @@ -16,6 +16,7 @@ > > import javax.enterprise.context.Conversation; > > import > javax.enterprise.context.spi.CreationalContext; > > > > +import > > > org.apache.webbeans.annotation.ApplicationScopeLiteral; > > import > org.apache.webbeans.conversation.ConversationImpl; > > import > > org.apache.webbeans.conversation.ConversationManager; > > import > org.apache.webbeans.spi.ConversationService; > > @@ -34,6 +35,7 @@ > > public ConversationBean() > > { > > > > super(WebBeansType.CONVERSATION, > > Conversation.class); > > + setImplScopeType(new > > ApplicationScopeLiteral()); > > } > > > > /** > > > > Modified: > > > openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ExtensionBean.java > > URL: > > http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ExtensionBean.java?rev=912404&r1=912403&r2=912404&view=diff > > > ============================================================================== > > --- > > > openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ExtensionBean.java > > (original) > > +++ > > > openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ExtensionBean.java > > Sun Feb 21 21:10:44 2010 > > @@ -15,6 +15,7 @@ > > > > import > javax.enterprise.context.spi.CreationalContext; > > > > +import > > > org.apache.webbeans.annotation.ApplicationScopeLiteral; > > import > > org.apache.webbeans.portable.events.ExtensionLoader; > > > > /** > > @@ -34,6 +35,7 @@ > > public > > ExtensionBean(Class<T> returnType) > > { > > > > > super(WebBeansType.EXTENSION,returnType); > > + setImplScopeType(new > > ApplicationScopeLiteral()); > > } > > > > /** > > > > Modified: > > > openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java > > URL: > > http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java?rev=912404&r1=912403&r2=912404&view=diff > > > ============================================================================== > > --- > > > openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java > > (original) > > +++ > > > openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java > > Sun Feb 21 21:10:44 2010 > > @@ -650,19 +650,23 @@ > > { > > > > ownerCreationalContextImpl = > > > (CreationalContextImpl<?>)ownerCreationalContext; > > } > > - > > > > > > + > > //Find the > injection > > point Bean > > Bean<Object> > > injectedBean = > > > (Bean<Object>)injectionResolver.getInjectionPointBean(injectionPoint); > > > > CreationalContextImpl<Object> > > injectedCreational = > > > (CreationalContextImpl<Object>)createCreationalContext(injectedBean); > > > > > > > if(WebBeansUtil.isDependent(injectedBean)) > > { > > > > - > > > injectedCreational.setOwnerCreational(ownerCreationalContextImpl); > > > > > + > > > injectedCreational.setOwnerCreational(ownerCreationalContextImpl); > > > > //Creating a new creational context for > > target bean instance > > > > instance = getReference(injectedBean, > > injectionPoint.getType(), injectedCreational); > > > > - //Add this > > dependent into bean dependent list > > - > > ownerCreationalContextImpl.addDependent(injectedBean, > > instance, injectedCreational); > > + // add > this > > dependent into bean dependent list > > + // only if > the > > member is not static and not already a proxy > > + if > > (!WebBeansUtil.isStaticInjection(injectionPoint) > && > > !JavassistProxyFactory.isProxyInstance(instance)) > > + { > > + > > > ownerCreationalContextImpl.addDependent(injectedBean, > > instance, injectedCreational); > > + } > > } > > > > else > > > > Modified: > > > openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/creational/CreationalContextImpl.java > > URL: > > http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/creational/CreationalContextImpl.java?rev=912404&r1=912403&r2=912404&view=diff > > > ============================================================================== > > --- > > > openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/creational/CreationalContextImpl.java > > (original) > > +++ > > > openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/creational/CreationalContextImpl.java > > Sun Feb 21 21:10:44 2010 > > @@ -42,54 +42,6 @@ > > > > private > > CreationalContextImpl<?> ownerCreational = > null; > > > > - private static class > > DependentCreationalContext<S> implements > Serializable > > - { > > - private static final > long > > serialVersionUID = 7107949019995422165L; > > - > > - private > > CreationalContext<S> creationalContext; > > - > > - private > Contextual<S> > > contextual; > > - > > - /** > > - * @return the > > creationalContext > > - */ > > - public > > CreationalContext<S> getCreationalContext() > > - { > > - return > > creationalContext; > > - } > > - > > - /** > > - * @param > > creationalContext the creationalContext to set > > - */ > > - public void > > setCreationalContext(CreationalContext<S> > > creationalContext) > > - { > > - > > this.creationalContext = creationalContext; > > - } > > - > > - /** > > - * @return the > > contextual > > - */ > > - public > Contextual<S> > > getContextual() > > - { > > - return > > contextual; > > - } > > - > > - /** > > - * @param > contextual > > the contextual to set > > - */ > > - public void > > setContextual(Contextual<S> contextual) > > - { > > - > this.contextual > > = contextual; > > - } > > - > > - public > > DependentCreationalContext(CreationalContext<S> > cc, > > Contextual<S> contextual) > > - { > > - > this.contextual > > = contextual; > > - > > this.creationalContext = cc; > > - } > > - } > > - > > - > > /** > > * Package private > > */ > > @@ -168,7 +120,7 @@ > > { > > T > > instance = (T)iterator.next(); > > > > DependentCreationalContext<T> > > dependent = > > > (DependentCreationalContext<T>)this.dependentObjects.get(instance); > > - > > dependent.getContextual().destroy(instance, > > > (CreationalContext<T>)dependent.getCreationalContext()); > > > > > > + > > dependent.getContextual().destroy(instance, > > dependent.getCreationalContext()); > > } > > > > > > this.dependentObjects.clear(); > > @@ -180,7 +132,7 @@ > > @Override > > public void release() > > { > > - removeDependents(); > > > > + removeDependents(); > > > > } > > > > > > Added: > > > openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/creational/DependentCreationalContext.java > > URL: > > http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/creational/DependentCreationalContext.java?rev=912404&view=auto > > > ============================================================================== > > --- > > > openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/creational/DependentCreationalContext.java > > (added) > > +++ > > > openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/creational/DependentCreationalContext.java > > Sun Feb 21 21:10:44 2010 > > @@ -0,0 +1,124 @@ > > +/* > > + * Licensed to the Apache Software Foundation > (ASF) > > under one or more > > + * contributor license agreements. See > the > > NOTICE file distributed with > > + * this work for additional information > regarding > > copyright ownership. > > + * The ASF licenses this file to You under the > > Apache License, Version 2.0 > > + * (the "License"); you may not use this file > except > > in compliance with > > + * the License. You may obtain a copy of > the > > License at > > + * > > + * http://www.apache.org/licenses/LICENSE-2.0 > > + * > > + * Unless required by applicable law or agreed > to in > > writing, software > > + * distributed under the License is distributed > on > > an "AS IS" BASIS, > > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY > KIND, > > either express or implied. > > + * See the License for the specific language > > governing permissions and > > + * limitations under the License. > > + */ > > +package org.apache.webbeans.context.creational; > > + > > +import java.io.IOException; > > +import java.io.InvalidClassException; > > +import java.io.NotSerializableException; > > +import java.io.ObjectInputStream; > > +import java.io.ObjectOutputStream; > > +import java.io.Serializable; > > + > > +import javax.enterprise.context.spi.Contextual; > > +import > javax.enterprise.context.spi.CreationalContext; > > + > > +import > org.apache.webbeans.container.BeanManagerImpl; > > +import org.apache.webbeans.util.WebBeansUtil; > > + > > +class DependentCreationalContext<S> implements > > Serializable > > +{ > > + private static final long > serialVersionUID = > > 7107949019995422165L; > > + > > + private CreationalContext<S> > > creationalContext; > > + > > + private Contextual<S> > contextual; > > + > > + /** > > + * @return the > creationalContext > > + */ > > + public CreationalContext<S> > > getCreationalContext() > > + { > > + return > creationalContext; > > + } > > + > > + /** > > + * @param creationalContext > the > > creationalContext to set > > + */ > > + public void > > setCreationalContext(CreationalContext<S> > > creationalContext) > > + { > > + this.creationalContext = > > creationalContext; > > + } > > + > > + /** > > + * @return the contextual > > + */ > > + public Contextual<S> > getContextual() > > + { > > + return contextual; > > + } > > + > > + /** > > + * @param contextual the > > contextual to set > > + */ > > + public void > > setContextual(Contextual<S> contextual) > > + { > > + this.contextual = > contextual; > > + } > > + > > + public > > DependentCreationalContext(CreationalContext<S> > cc, > > Contextual<S> contextual) > > + { > > + this.contextual = > contextual; > > + this.creationalContext = > cc; > > + } > > + > > + private synchronized void > > writeObject(ObjectOutputStream s) > > + throws IOException > > + { > > + > > s.writeLong(serialVersionUID); > > + > > + > > s.writeObject(creationalContext); > > + > > + String id = null; > > + if (contextual != null) > > + { > > + if ((id = > > WebBeansUtil.isPassivationCapable(contextual)) != > null) > > + { > > + > > > s.writeObject(id); > > + } > > + else > > + { > > + > > > throw new NotSerializableException("cannot serialize " > + > > contextual.toString()); > > + } > > + > > + } > > + else > > + { > > + > > s.writeObject(null); > > + } > > + } > > + > > + > > + @SuppressWarnings("unchecked") > > + private synchronized void > > readObject(ObjectInputStream s) > > + throws IOException, > ClassNotFoundException > > + { > > + long svId = > s.readLong(); > > + if (svId != > serialVersionUID) > > + { > > + throw new > > > InvalidClassException(this.getClass().getSimpleName()); > > + } > > + > > + creationalContext = > > (CreationalContext<S>) s.readObject(); > > + > > + String id = (String) > > s.readObject(); > > + if (id != null) > > + { > > + contextual > = > > (Contextual<S>) > > > BeanManagerImpl.getManager().getPassivationCapableBean(id); > > + } > > + } > > + > > +} > > \ No newline at end of file > > > > Modified: > > > openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandler.java > > URL: > > http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandler.java?rev=912404&r1=912403&r2=912404&view=diff > > > ============================================================================== > > --- > > > openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandler.java > > (original) > > +++ > > > openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandler.java > > Sun Feb 21 21:10:44 2010 > > @@ -372,23 +372,26 @@ > > > > private void > > writeObject(ObjectOutputStream s) throws IOException > > { > > + > > s.writeLong(serialVersionUID); > > > > > if(WebBeansUtil.isPassivationCapable(this.bean) > > != null) > > { > > - > s.writeByte(1); > > > > > s.writeUTF(this.bean.getId()); > > } > > else > > { > > > > logger.warn("Trying to serialize not > > passivated capable bean proxy : " + this.bean); > > - > s.writeByte(0); > > } > > } > > > > private void > > readObject(ObjectInputStream s) throws IOException, > > ClassNotFoundException > > { > > - if( s.readByte() == 1) > > + if( s.readLong() == > > serialVersionUID) > > { > > - this.bean > = > > > (OwbBean<?>)BeanManagerImpl.getManager().getPassivationCapableBean(s.readUTF()); > > + String > > passivationId = s.readUTF(); > > + if > > (passivationId != null) > > + { > > + > > > this.bean = > > > (OwbBean<?>)BeanManagerImpl.getManager().getPassivationCapableBean(passivationId); > > + } > > } > > else > > { > > > > Modified: > > > openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/webbeans/WebBeansInterceptor.java > > URL: > > http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/webbeans/WebBeansInterceptor.java?rev=912404&r1=912403&r2=912404&view=diff > > > ============================================================================== > > --- > > > openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/webbeans/WebBeansInterceptor.java > > (original) > > +++ > > > openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/webbeans/WebBeansInterceptor.java > > Sun Feb 21 21:10:44 2010 > > @@ -456,5 +456,10 @@ > > { > > return > > this.delegateBean.isAlternative(); > > } > > - > > + > > + @Override > > + public boolean isPassivationCapable() > > + { > > + return true; > > + } > > } > > \ No newline at end of file > > > > Modified: > > > openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/JavassistProxyFactory.java > > URL: > > http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/JavassistProxyFactory.java?rev=912404&r1=912403&r2=912404&view=diff > > > ============================================================================== > > --- > > > openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/JavassistProxyFactory.java > > (original) > > +++ > > > openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/JavassistProxyFactory.java > > Sun Feb 21 21:10:44 2010 > > @@ -205,5 +205,14 @@ > > > > return result; > > } > > + > > + /** > > + * @param o the object to > check > > + * @return > > <code>true</code> if the given object is > a > > proxy > > + */ > > + public static boolean > isProxyInstance(Object > > o) > > + { > > + return o instanceof > > ProxyObject; > > + } > > > > } > > > > Modified: > > > openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java > > URL: > > http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java?rev=912404&r1=912403&r2=912404&view=diff > > > ============================================================================== > > --- > > > openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java > > (original) > > +++ > > > openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java > > Sun Feb 21 21:10:44 2010 > > @@ -22,6 +22,7 @@ > > import > java.lang.reflect.InvocationTargetException; > > import java.lang.reflect.Member; > > import java.lang.reflect.Method; > > +import java.lang.reflect.Modifier; > > import java.lang.reflect.ParameterizedType; > > import java.lang.reflect.Type; > > import java.lang.reflect.TypeVariable; > > @@ -2731,5 +2732,25 @@ > > > > return managedBean; > > } > > + > > + /** > > + * Determines if the > injection is > > to be performed into a static field. > > + * > > + * @param injectionPoint > > + * @return > > <code>true</code> if the injection is into > a > > static field > > + */ > > + public static boolean > > isStaticInjection(InjectionPoint injectionPoint) > > + { > > + if (injectionPoint != > null) > > + { > > + Member > member = > > injectionPoint.getMember(); > > + if (member > != > > null && > Modifier.isStatic(member.getModifiers())) > > + { > > + > > > return true; > > + } > > + } > > + > > + return false; > > + } > > > > } > > \ No newline at end of file > > > > > > > > __________________________________________________ > Do You Yahoo!? > Sie sind Spam leid? Yahoo! Mail verfügt über einen > herausragenden Schutz gegen Massenmails. > http://mail.yahoo.com > > > > > ___________________________________________________________________ > Yahoo! Türkiye açıldı! http://yahoo.com.tr > İnternet üzerindeki en iyi içeriği Yahoo! Türkiye > sizlere sunuyor! __________________________________________________ Do You Yahoo!? Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. http://mail.yahoo.com
