[Design of JBoss Portal] - Re: MetaBridge
by stan.silvert@jboss.com
"julien(a)jboss.com" wrote : Thanks Stan, however I precisely want to avoid to declare the servlet faces in web.xml in order to avoid to have the servlet container use the class already provided by the Java EE environment.
|
| that's why I would prefer plain delegation.
OK. I understand now.
In that case I think you would just need to set the context classloader in the init() method of your filter. I think that the filter is guaranteed to be loaded before the servlet, or maybe you can configure it that way using <load-on-startup>.
That way, the filter sets the context classloader in both init() and in doFilter(). When the application loader tries to load FacesServlet it will load the one in your WAR instead of the one that ships with the container.
I think that should work and it would be easier than wrapping the FacesServlet.
I'm a little weary of not declaring the FacesServlet in web.xml. I know that MyFaces relies on it to discover whether the application is path mapped or extension mapped.
Stan
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4063079#4063079
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4063079
18 years, 9 months
[Design the new POJO MicroContainer] - Re: ClassInfo being serializable
by adrian@jboss.org
I don't understand this new helper?
| Modified: projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/ClassInfoImpl.java
| ===================================================================
| --- projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/ClassInfoImpl.java 2007-07-11 14:58:35 UTC (rev 63972)
| +++ projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/ClassInfoImpl.java 2007-07-11 15:16:44 UTC (rev 63973)
| @@ -26,6 +26,9 @@
| import java.util.Collection;
| import java.util.HashMap;
| import java.util.Map;
| +import java.io.ObjectInputStream;
| +import java.io.IOException;
| +import java.io.ObjectOutputStream;
|
| import org.jboss.reflect.spi.ClassInfo;
| import org.jboss.reflect.spi.ConstructorInfo;
| @@ -108,27 +111,86 @@
| protected PackageInfo packageInfo;
|
| /** The class info helper */
| - protected ClassInfoHelper classInfoHelper;
| + protected transient ClassInfoHelper classInfoHelper;
|
| /** The type info factory */
| - protected TypeInfoFactory typeInfoFactory;
| + protected transient TypeInfoFactory typeInfoFactory;
|
| /** The attachments */
| private transient TypeInfoAttachments attachments;
|
| + /** The serialization helper */
| + private SerializationHelper serializationHelper;
|
I don't really understand why you are serializing any state
except the annotatedElement.
All you need to do is rehook into the typeinfo factory using some package
protected method and recreate the other state during deserialization
(most of it can be left to be initialized lazily?)
| public void readObject(...)
| {
| super.readObject(...);
| typeInfoFactory = new IntrospectionTypeInfoFactory(...);
| classInfoHelper = typeInfoFactory.getClassInfoHelper();
| // etc.
| }
|
In fact, a much more trivial mechanism would be to use "readResolve"
| Object readResolve()
| {
| IntrospectionTypeInfoFactory factory = new IntrospectionTypeInfoFactory();
| return factory.getTypeInfo(annotatedElement);
| }
|
Then you aren't creating multiple ClassInfo objects during deserialization,
especially if they are already present in the cache.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4063066#4063066
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4063066
18 years, 9 months
[Design the new POJO MicroContainer] - Re: ClassInfo being serializable
by alesj
"adrian(a)jboss.org" wrote :
| What a waste of memory.
|
:-)
"adrian(a)jboss.org" wrote :
| The solution should just involve reconnecting to that singleton (from the reflect
| implementation of ClassInfo) during deserialization.
|
I've introduced a new 'helper' which knows how to provide the three already existing helpers ClassInfoImpl needs - TypeInfoFactory, ClassInfoHelper and AnnotationHelper.
In the case of Introspection all three are implemented in one class: IntrospectionTypeInfoFactoryImpl.
I've just added IntrospectionDelegateHolder so that IntrospectionTypeInfoFactory remains almost the same, just impl TypeInfoFactory.
"adrian(a)jboss.org" wrote :
| You should just disable the serialization tests for the javassist versions
| and it to its outstanding jira tasks.
Done.
Yet to update tasks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4063045#4063045
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4063045
18 years, 9 months