[Design of POJO Server] - Re: VFS Permissions - JBMICROCONT-149
by adrian@jboss.org
"alesj" wrote : "flavia.rainone(a)jboss.com" wrote :
| | I think we should wait for Kabir to return from his vacation (next Monday) to see what he says about this.
| |
| It's not an AOP issue.
| AOP just uses VFS's in-memory mechanism.
|
| The issue is whether we should create some reproduceable
| url for in-memory stuff in InMemoryClassesDeployer.
|
| But I still don't see how this would help Anil's security issue,
| as it would still be a vfs url - which is THE topic of this discussion.
|
| There is no way to turn it into 'real' url, no matter what we do before.
Can't you change the in memory vfs context construction to allow you to
specify the "RealURL". The InMemoryClassesDeployer would populate it with
the "RealURL" of the VFS (Sub)Deployment.
Then VFSUtils.getRealURL() would then automatically return whatever you specify
when it delegates to the in memory vfs context.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4190905#4190905
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4190905
17 years, 4 months
[Design the new POJO MicroContainer] - Re: UnwrapValueUnitTestCase.testCollectionUnwrap failure on
by adrian@jboss.org
"alesj" wrote : What about if we built our own String key?
The toString() in openjdk looks like this:
| public String toString() {
| StringBuilder sb = new StringBuilder();
|
| if (ownerType != null) {
| if (ownerType instanceof Class)
| sb.append(((Class)ownerType).getName());
| else
| sb.append(ownerType.toString()); // HERE!
|
| sb.append(".");
|
| if (ownerType instanceof ParameterizedTypeImpl) {
| // Find simple name of nested type by removing the
| // shared prefix with owner.
| sb.append(rawType.getName().replace( ((ParameterizedTypeImpl)ownerType).rawType.getName() + "$",
| ""));
| } else
| sb.append(rawType.getName());
| } else
| sb.append(rawType.getName());
|
| if (actualTypeArguments != null &&
| actualTypeArguments.length > 0) {
| sb.append("<");
| boolean first = true;
| for(Type t: actualTypeArguments) {
| if (!first)
| sb.append(", ");
| if (t instanceof Class)
| sb.append(((Class)t).getName());
| else
| sb.append(t.toString()); // HERE!
| first = false;
| }
| sb.append(">");
| }
|
| return sb.toString();
|
But note the the code I've marked HERE! which in turn would also need fixing
if we assume these reflective objects don't have valid toString()s
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4190901#4190901
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4190901
17 years, 4 months
[Design the new POJO MicroContainer] - Re: UnwrapValueUnitTestCase.testCollectionUnwrap failure on
by adrian@jboss.org
I think I've found A problem? But I'm still not sure
if this is the cause of the problem seen.
The issue is that DefaultMetaValueFactory::unwrapCollection() has this
| BeanInfo collectionInfo;
| // null is not instance of
| if (type instanceof ClassInfo)
| {
| collectionInfo = configuration.getBeanInfo(type);
| }
|
Which if you look in AbstractBeanInfoFactory has this caching
| public BeanInfo getBeanInfo(ClassAdapter classAdapter, BeanAccessMode accessMode)
| {
| if (classAdapter == null)
| throw new IllegalArgumentException("Null class adapter.");
| if (accessMode == null)
| accessMode = BeanAccessMode.STANDARD;
|
| synchronized (cache)
| {
| ClassLoader cl = classAdapter.getClassLoader();
| ClassInfo classInfo = classAdapter.getClassInfo();
| String className = classInfo.getName();
| Map<String, Map<BeanAccessMode, BeanInfo>> map = cache.get(cl);
|
The issue being that for ParameterizedClassInfo, classInfo.getName()
effectively maps to getRawType().getName() (actually this is done
through the super construction of the DelegateClassInfo).
Then the next step in unwrapCollection is to use the ClassInfo of the
BeanInfo to get the componentType
| ClassInfo classInfo = collectionInfo.getClassInfo();
| Collection collection = (Collection)createNewInstance(collectionInfo);
|
| TypeInfo componentType = classInfo.getComponentType();
|
which should be the raw type?
Clearly, the caching in AbstractBeanInfoFactory shouldn't be using
classInfo.getName() in its caching.
Or if it is going to use that, then ParameterizedClassInfo needs to override getName()
to return the generic name (but I'm not sure what that would break?).
Parameterized types should get their own BeanInfo, e.g.
| // This is a parameterized type with one Object property "something"
| public class GenericBean<T>
| {
| private T t;
| public T getSomething() { return t; }
| public void setSomething() { this.t = t; }
| }
|
| // This is a parameterized type with one **String** property "something"
| public class StringBean extends GenericBean<String> {}
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4190899#4190899
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4190899
17 years, 4 months
[Design of POJO Server] - Re: VFS Permissions - JBMICROCONT-149
by flavia.rainone@jboss.com
Regarding the AOP part of this discussion, I have no idea of what needs to be done, I am an AOP expert, but not an AOP-VFS integration expert ;-)
I think we should wait for Kabir to return from his vacation (next Monday) to see what he says about this.
Disclaimer: I'm not Ales, Adrian, Scott, Kabir, Anil, etc, etc, etc. :P
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4190889#4190889
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4190889
17 years, 4 months