[Design the new POJO MicroContainer] - New Lifecycle aspects is wrong
by adrian@jboss.org
This relates to this long discussion thread:
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=101253
I finally got chance to look at what has been done for this and it is wrong.
1) Type safety
I quite like the idea of the BeanInfo.getDependencies()
returning a builder rather than just names so it can be called back
with additional context on what it needs to work on.
But this needs to be type safe.
e.g. This code shows the problem (the cast - which isn't even checked properly!)
| // add custom dependencies (e.g. AOP layer).
| List<Object> dependencies = info.getDependencies(md);
| log.trace("Extra dependencies for " + context.getName() + " " + dependencies);
| if (dependencies != null)
| {
| for (Object dependencyItem : dependencies)
| {
| ((DependencyBuilderListItem)dependencyItem).addDependency(context);
| }
| }
|
2) BeanMetaData is not a place to store runtime information
that is what the ControllerContext is for.
You should not be modifying the BeanMetaData. This is information
that the user/client is requesting. Any additional information runtime information
should be stored in the ControllerContext, i.e. linked in via DependencyInfo/Item
This is how the initial runtime/additional depedencies were coded and that rule
must be maintained.
Ales also made the same mistake, so I guess we need a big warning
message on BeanMetaData to stop people adding things to the model
that are not declartive (intended to be declared by the user)? :-)
3) Too much of this implementation detail is being leaked into spi.
e.g. the KernelControllerContext interface
| /**
| * Get the lifecycle callbacks for a particular state.
| *
| * @param state the state callbacks refer to
| * @return List<LifecycleCallbackMetaData>
| */
| List<LifecycleCallbackMetaData> getLifecycleCallbacks(ControllerState state);
|
Besides what I said on the other thread that this is too POJO specifc,
it is also an implementation detail that should not need to be exposed on the interface.
This is also something else that I've tried to maintain in the Microcontainer api.
If the processing is generic state that is going to be useful for all implementations
of an interface then it belongs on thatinterface, Otherwise it should be
a method specific to an implementation and the integration should use
"private api". e.g. I wouldn't have a problem if this was on the
Abstract[Kernel]ControllerContext.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4033088#4033088
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4033088
17 years, 10 months
[Design of Security on JBoss] - Problems while configuring server.policy file
by jahnviv
Hi,
I want to grant permission to MBeans and MBeanServer of my web application i.e. these MBeans and MBeanServer are application specific, it has nothing to do with JBoss.
I am assigning this permission in server.policy file. It already has default permission java.security.AllPermission. So it overrides the MBean specific permission given by me. Now I have removed AllPermission and give some minimum permission required from this link :
http://wiki.jboss.org/wiki/Wiki.jsp?page=ConfiguringAJavaSecurityManager
Now it gives error regarding deploy folder. The stacktrace is given below:
15:21:10,350 ERROR [MainDeployer] could not create deployment: file:/C:/Java/jboss-4.0.2/server/all/deploy/jboss-aop.deployer/
org.jboss.deployment.DeploymentException: MBeanTrustPermission(register) not implied by protection domain of mbean class: org.jboss.aop.deployment.AspectManagerService, pd: ProtectionDomain (file:/C:/Java/jboss-4.0.2/server/all/tmp/deploy/tmp25826jboss-aspect-library.jar <no certificates>)
org.jboss.mx.loading.UnifiedClassLoader3@1546dbc{ url=file:/C:/Java/jboss-4.0.2/server/all/deploy/jboss-aop.deployer/ ,addedOrder=3}
<no principals>
java.security.Permissions@c4d04d (
(java.net.SocketPermission localhost:1024- listen,resolve)
(java.net.SocketPermission * connect,resolve)
(java.net.SocketPermission * connect,resolve)
(java.net.SocketPermission localhost:1024- listen,resolve)
(javax.security.auth.AuthPermission createLoginContext.*)
(unresolved javax.management.MBeanServerPermission findMBeanServer null)
(unresolved javax.management.MBeanServerPermission findMBeanServer null)
(unresolved javax.management.MBeanPermission org.jboss.mx.modelmbean.XMBean#*[JMImplementation:type=MBeanRegistry] *)
(unresolved javax.management.MBeanPermission org.jboss.mx.modelmbean.XMBean#*[JMImplementation:type=MBeanRegistry] *)
(java.lang.RuntimePermission accessClassInPackage.*)
(java.lang.RuntimePermission queuePrintJob)
(java.lang.RuntimePermission org.jboss.security.SecurityAssociation.getSubject)
(java.lang.RuntimePermission stopThread)
(java.util.PropertyPermission java.version read)
(java.util.PropertyPermission java.vm.name read)
(java.util.PropertyPermission java.vm.vendor read)
(java.util.PropertyPermission os.name read)
(java.util.PropertyPermission java.vendor.url read)
(java.util.PropertyPermission java.vm.specification.vendor read)
(java.util.PropertyPermission os.version read)
(java.util.PropertyPermission java.specification.vendor read)
(java.util.PropertyPermission java.class.version read)
(java.util.PropertyPermission java.specification.name read)
(java.util.PropertyPermission file.separator read)
(java.util.PropertyPermission os.arch read)
(java.util.PropertyPermission java.vm.version read)
(java.util.PropertyPermission java.vendor read)
(java.util.PropertyPermission java.specification.version read)
(java.util.PropertyPermission java.vm.specification.version read)
(java.util.PropertyPermission java.vm.specification.name read)
(java.util.PropertyPermission * read)
(java.util.PropertyPermission path.separator read)
(java.util.PropertyPermission line.separator read)
(java.io.FilePermission C:/Java/jboss-4.0.2/server/all/- read,write,delete)
(java.io.FilePermission C:/Java/jboss-4.0.2/- read,write,delete)
(java.io.FilePermission C:\j2sdk1.4.2_08\jre/- read,write,delete)
(java.io.FilePermission C:/Java/jboss-4.0.2/server/all/- read,write,delete)
(java.io.FilePermission C:/Java/jboss-4.0.2/- read,write,delete)
(java.io.FilePermission C:\j2sdk1.4.2_08\jre/- read,write,delete)
(java.io.FilePermission C:\Java\jboss-4.0.2\server\all\tmp\deploy\tmp25826jboss-aspect-library.jar read)
(java.io.FilePermission C:\Java\jboss-4.0.2\server\all\deploy\jboss-aop.deployer read)
)
; - nested throwable: (java.lang.SecurityException: MBeanTrustPermission(register) not implied by protection domain of mbean class: org.jboss.aop.deployment.AspectManagerService, pd: ProtectionDomain (file:/C:/Java/jboss-4.0.2/server/all/tmp/deploy/tmp25826jboss-aspect-library.jar <no certificates>)
org.jboss.mx.loading.UnifiedClassLoader3@1546dbc{ url=file:/C:/Java/jboss-4.0.2/server/all/deploy/jboss-aop.deployer/ ,addedOrder=3}
<no principals>
java.security.Permissions@c4d04d (
(java.net.SocketPermission localhost:1024- listen,resolve)
(java.net.SocketPermission * connect,resolve)
(java.net.SocketPermission * connect,resolve)
(java.net.SocketPermission localhost:1024- listen,resolve)
(javax.security.auth.AuthPermission createLoginContext.*)
(unresolved javax.management.MBeanServerPermission findMBeanServer null)
(unresolved javax.management.MBeanServerPermission findMBeanServer null)
(unresolved javax.management.MBeanPermission org.jboss.mx.modelmbean.XMBean#*[JMImplementation:type=MBeanRegistry] *)
(unresolved javax.management.MBeanPermission org.jboss.mx.modelmbean.XMBean#*[JMImplementation:type=MBeanRegistry] *)
(java.lang.RuntimePermission accessClassInPackage.*)
(java.lang.RuntimePermission queuePrintJob)
(java.lang.RuntimePermission org.jboss.security.SecurityAssociation.getSubject)
(java.lang.RuntimePermission stopThread)
(java.util.PropertyPermission java.version read)
.....
Any clues??
Thanks.
Jahnvi
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4033074#4033074
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4033074
17 years, 10 months