[JBoss Seam] - Modular pluggable components application
by trouby
Hey,
I'm trying to build an application platform which all of its layers can be affected by pluggable components,
I assume such a design could be achieved if each component (in my example seam component) can be affected by some kind of external packages,
There are few problems I see around this design,
First of all, I'm not sure if seam can help here, and if there are any assistance for affecting a component behaviors externally,
JavaEE, its packaging design does not support such a model, OSGI model could fit here exactly but I can't see how this is done in jboss without using external platforms, probably archiving a jar per component can partially solve the problem, but I guess these jars must be apart of the application and configuration descriptors must be modified when new components being deployed.
Nuxeo (OSS ecm) created a runtime platform which implements an OSGI model for JavaEE(especially Jboss app server), but I'm trying to find some more natural solution,
Well, I guess this is not only a seam question, but having a discussion about how seam can help in designing such an application could be interesting :-)
Thanks,
Asaf
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4104083#4104083
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4104083
18 years, 8 months
[JBoss Seam] - Re: s:selectItems and subclasses
by MSchmidke
Seam Version is 2.0.0.CR1.
JSF RI from JBoss 4.2.
No stack trace available since the exception is silently caught.
Have a look at JSF RI MenuRenderer.java lines 535 ff:
| try {
| newValue = context.getApplication().getExpressionFactory().
| coerceToType(itemValue, type);
| } catch (Exception e) {
| // this should catch an ELException, but there is a bug
| // in ExpressionFactory.coerceToType() in GF
| newValue = null;
| }
|
So, I think it is not a bug of Seam, but it is a limitation of JSF which appears when using Seam UI components (it might appear without Seam, but it will appear with Seam), and since Seam is nothing but repairing things which are missing in the other frameworks, it would be nice if Seam could repair even this.
I have worked around this by replacing the MenuRenderer class, changing getCurrentSelectedValues() method: Instead of
| if (size > 0) {
| // get the type of the first element - Should
| // we assume that all elements of the List are
| // the same type?
| return list.toArray((Object[]) Array.newInstance(
| list.iterator().next().getClass(),
| size));
| } else {
| return ((Collection) value).toArray();
| }
|
I have
| if (size > 0) {
| // get the type of the first element - Should
| // we assume that all elements of the List are
| // the same type?
| return list.toArray((Object[]) Array.newInstance(
| getObjectClass(list.iterator().next()),
| size));
| } else {
| return ((Collection) value).toArray();
| }
|
with
| private Class getObjectClass(Object o) {
| Class r = o.getClass();
| if (r.getName().contains("$$")) {
| r = r.getSuperclass();
| }
| return r;
| }
|
This method changes the class from "Proxy-For-A" to "A", so that even Bs and Cs may match.
This is clearly a hack, but for the moment, it works for me.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4104078#4104078
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4104078
18 years, 8 months