[Design of POJO Server] - Re: ManagedOperation aspects for the ProfileService.Manageme
by alesj
"adrian(a)jboss.org" wrote :
| We need to find a way to remove the getClassLoader()
| and make it an implementation detail, or introduce a permission check
| into the implementations. Exposing classloaders in public methods is a security hole.
|
| See Class.getClassLoader() or Thread.currentThread().getContextClassLoader()
| for the kind of checks required.
|
Is this enough:
| public ClassLoader getClassLoader() throws Throwable
| {
| SecurityManager sm = System.getSecurityManager();
| if (sm != null)
| sm.checkPermission(SecurityConstants.GET_CLASSLOADER_PERMISSION);
| return Configurator.getClassLoader(getBeanMetaData());
| }
|
Or I need to 'find' something equivalent for the ccl in
| public ClassLoader getClassLoader() {
| ClassLoader cl = getClassLoader0();
| if (cl == null)
| return null;
| SecurityManager sm = System.getSecurityManager();
| if (sm != null) {
| ClassLoader ccl = ClassLoader.getCallerClassLoader();
| if (ccl != null && ccl != cl && !cl.isAncestor(ccl)) {
| sm.checkPermission(SecurityConstants.GET_CLASSLOADER_PERMISSION);
| }
| }
| return cl;
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4087263#4087263
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4087263
18 years, 6 months
[Design of POJO Server] - Re: Unifying metadata
by scott.stark@jboss.org
"adrian(a)jboss.org" wrote :
| This is how you define it generically
|
| | public class ListElementWildcard
| | {
| | private List<Element> wildcard;
| |
| | public List<Element> getWildcard()
| | {
| | return wildcard;
| | }
| |
| | @XmlAnyElement(lax=true)
| | public void setWildcard(List<Element> wildcard)
| | {
| | this.wildcard = wildcard;
| | }
| |
|
| You can also make it recognise specific types, e.g. we could define
| the known JMSContainerInvoker config, etc. by adding @XmlElements
| and specific types but then you need to make List<Object>
| if you also want it to have raw Elements as well as real types.
|
| The real problem is that it just isn't implemented
| (at least in the version in the JBossXB project)
|
| | @XmlType(name="invoker-proxy-bindingType")
| | public class InvokerProxyBindingMetaData extends NamedMetaDataWithDescriptions
| | {
| | ...
| |
| | /** The proxy factory config */
| | // TODO DOM private Element proxyFactoryConfig;
| |
I had unquoted this section in the merged jbossxb project, and that is what produced the errors seen in the JBXB-109 issue. Even if I change this to:
| @XmlType(name="invoker-proxy-bindingType")
| public class InvokerProxyBindingMetaData extends NamedMetaDataWithDescriptions
| {
| /** The proxy factory config */
| private List<Element> proxyFactoryConfig;
| ...
|
| public List<Element> getProxyFactoryConfig()
| {
| return proxyFactoryConfig;
| }
|
| @XmlAnyElement(lax=true)
| public void setProxyFactoryConfig(List<Element> proxyFactoryConfig)
| {
| this.proxyFactoryConfig = proxyFactoryConfig;
| }
| }
|
I'm seeing the same error, which is happening on an xml fragment that does not even have the proxy-factory-config element:
anonymous wrote :
| Caused by: java.lang.ClassCastException: java.util.ArrayList
| at org.jboss.javaee.metadata.support.MappedAnnotationMetaData.add(MappedAnnotationMetaData.java:39)
| at org.jboss.xb.builder.runtime.CollectionPropertyHandler.handle(CollectionPropertyHandler.java:133)
| ... 40 more
|
|
If you or Alexey can look into the JBXB-109 issue it would help.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4087261#4087261
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4087261
18 years, 6 months
[Design of POJO Server] - Re: Unifying metadata
by adrian@jboss.org
"adrian(a)jboss.org" wrote :
| This works in the MC stuff, so its obviously not defined correctly in the annotations
| for the ejb stuff.
|
This is how you define it generically
| public class ListElementWildcard
| {
| private List<Element> wildcard;
|
| public List<Element> getWildcard()
| {
| return wildcard;
| }
|
| @XmlAnyElement(lax=true)
| public void setWildcard(List<Element> wildcard)
| {
| this.wildcard = wildcard;
| }
|
You can also make it recognise specific types, e.g. we could define
the known JMSContainerInvoker config, etc. by adding @XmlElements
and specific types but then you need to make List
if you also want it to have raw Elements.
The real problem is that it just isn't implemented
(at least in the version in the JBossXB project)
| @XmlType(name="invoker-proxy-bindingType")
| public class InvokerProxyBindingMetaData extends NamedMetaDataWithDescriptions
| {
| ...
|
| /** The proxy factory config */
| // TODO DOM private Element proxyFactoryConfig;
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4087232#4087232
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4087232
18 years, 6 months