[Design the new POJO MicroContainer] - Context ClassLoader - POJO
by adrian@jboss.org
Most of the containers are already setting the correct context classloader,
e.g. MBeans and EJB do it
But the POJO deployment runs with a "random" context classloader.
The changes required to fix this are:
1) Set the context classloader in the callbacks (e.g. instantiate, configure, create, start, etc.)
2) Add ClassLoaderMetaData - the POJO version of this class, not be confused with the
deployment metadata with the same name :-( - to use the classloader of the deployment
(if the -beans.xml or bean does not already override it to use an explicit classloader).
My preference in the past would be to make this an aspect (since it should arguably do it
for methods that are not part of the IOC protocol, e.g. runtime methods),
but I'm now convinced that the MC should be doing it itself.
First the MC should be able to run without AOP, so it isn't really the full solution.
(Of course you could argue that the feature is only available with AOP :-)
Second, there are times when you might want the correct classloader during
configuration, but use the caller's context classloader at runtime.
Third, configuring the aspect (even with a simple annotation) on every relevant POJO
would be a configuration nightmare.
So the solution I propose is set the context classloader in the IOC callbacks,
but require the aspect for this behaviour at runtime.
Also, this won't change the behaviour for standalone MC usage
since if the classloader is not configured (it will be always inside JBoss
since it will set to the deployment classloader when not configured)
it will just "redundantly" reset the classloader to context classloader, i.e. no change
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4122221#4122221
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4122221
18 years, 2 months
[Design the new POJO MicroContainer] - Re: ManagedObject attachment serialization
by adrian@jboss.org
The original intention was that the ManagedObject would be used by
the management layer to configure the attachments.
As such for remote management, the attachments needed to be serialzable
such that the remote management tool could use the ManagedObject api
to change the attachment, retriefve the object and place it in the preconfigured
part of the deployment.
The notion of ManagedObject has changed a lot since
the original design. i.e.
* ManagedProperty can exist by itself
* ManagedObject is just an implementation detail with a new api for the managed layer
You'd need to ask Scott, et. al. how they are adding the changed attachments
into the Deployment when doing work remotely to change/persist the values
in for example a remote agent.
If they don't have the metadata classes on the client side, I'd guess there
either needs to be some proxy work (possibly inside the deployment layer?)
that can reconstruct the attachment on the server side
from the "ManagedObject" or the Deployment itself is reconstructed on the
server side from the management artifacts?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4122204#4122204
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4122204
18 years, 2 months
[Design the new POJO MicroContainer] - Re: jboss-structure help needed
by adrian@jboss.org
"alesj" wrote : "anil.saldhana(a)jboss.com" wrote :
| | I tried the .xml files outside the METADataPath in the structure file in vain.
| |
| Can you try this:
|
| | <metaDataPath>
| | <path name="META-INF"/>
| | <path name=""/>
| | </metaDataPath>
| |
What on earth are you doing?
The -ds.xml files in the root are subdeployments and the login-config.xml
is a resource. None of these are metadata (unless you are going to write
a new securty deployer that creates policies from META-INF/login-config.xml).
| Can you please give me some examples of jboss-structure files?
|
Have you tried looking the testsuite?
For future reference, the jboss-structure.xml should have looked
something like this:
| <structure>
| <!-- Here I define the root context name="" -->
| <context>
| <path name=""/>
|
| <!-- metadata is in META-INF -->
| <metaDataPath>
| <path name="META-INF"/>
| </metaDataPath>
|
| <!-- Classpath is the root -->
| <classpath>
| <path name=""/>
| </classpath>
| </context>
|
| <!-- Here I define a subdeployment, it has not metadata or classpath since it is just a file-->
| <context name="notxfs-ds.xml"/>
|
| <!-- etc -->
| </structure>
|
But these should be the default rules anyway.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4122183#4122183
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4122183
18 years, 2 months
[Design the new POJO MicroContainer] - Re: jboss-structure help needed
by anil.saldhana@jboss.com
"scott.stark(a)jboss.org" wrote : A jboss-structure.xml should not be needed. The problem is that the local login-config.xml resource is not being found preferentially over the conf/login-config.xml. The DynamicLoginConfig service is loading that url:
|
| vfsfile:/home/svn/JBossHead/jboss-head/build/output/jboss-5.0.0.Beta4/server/default/conf/login-config.xml
|
|
| and so the custom login config names are all mapping to the default login config, and there are no users/roles.properties found.
|
Scott, I understand that the custom application policies are not being found, hence it is defaulting to "other". But what I do not understand is from where is the DynamicLoginConfigService kicking in, for this test case? It is neither explicitly defined in this test deployment nor anything is done from the test case.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4122157#4122157
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4122157
18 years, 2 months
[Design the new POJO MicroContainer] - Re: jboss-structure help needed
by alesj
"anil.saldhana(a)jboss.com" wrote : org.jboss.deployers.spi.DeploymentException: Only one file is allowed, found=[Ja
| | rEntryHandler(a)29129210[path=calleridentity-ds.xml context=file:/C:/cygwin/home/a
| | saldhana/jboss-5.0/jboss-head/testsuite/output/lib/jca-securedejb.jar real=jar:f
| | ile:/C:/cygwin/home/asaldhana/jboss-5.0/jboss-head/testsuite/output/lib/jca-secu
| | redejb.jar!/calleridentity-ds.xml], JarEntryHandler(a)15480059[path=notxfs-ds.xml
| | context=file:/C:/cygwin/home/asaldhana/jboss-5.0/jboss-head/testsuite/output/lib
| | /jca-securedejb.jar real=jar:file:/C:/cygwin/home/asaldhana/jboss-5.0/jboss-head
| | /testsuite/output/lib/jca-securedejb.jar!/notxfs-ds.xml]]
| | at org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.parse
| | (AbstractVFSParsingDeployer.java:108)
| | at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithO
| | utput.createMetaData(AbstractParsingDeployerWithOutput.java:225)
| | at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithO
| | utput.createMetaData(AbstractParsingDeployerWithOutput.java:199)
| | at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithO
| | utput.deploy(AbstractParsingDeployerWithOutput.java:162)
| |
Ah, yes, JBMICROCONT-184.
Need to touch on that subject asap.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4122089#4122089
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4122089
18 years, 2 months