[Design the new POJO MicroContainer] - Re: Need cleanup of the attachments api
by adrian@jboss.org
"scott.stark(a)jboss.org" wrote : "adrian(a)jboss.org" wrote : "bill.burke(a)jboss.com" wrote : Good cleanup ideas. I always avoided using DeploymentUnit interface for finding attachments as I didn't like how it merged parent and child attachment data in the lookup.
| |
| | That's a bug we identified a while ago.
| | It should only be doing the merge for components.
| What was that discussion? If I'm going to be updating this I want to get it all changed for 2.0.0.Beta3.
|
It was before Christmas sometime.
I looks like it might already have been fixed?
| AbstractDeploymentUnit:
| public Map<String, Object> getAttachments()
| {
| DeploymentContext parent = deploymentContext.getParent();
|
| // HERE Don't look at the parent when we are not a component
| if (deploymentContext.isComponent() == false)
| parent = null;
|
| HashMap<String, Object> result = new HashMap<String, Object>();
| if (parent != null)
| result.putAll(parent.getTransientAttachments().getAttachments());
|
Or maybe the fix missed part of the api?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4021232#4021232
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4021232
18 years, 10 months
[Design the new POJO MicroContainer] - Re: Scoped Kernels
by adrian@jboss.org
"alesj" wrote :
| "adrian(a)jboss.org" wrote :
| | There are a number of apis that need updating to understand Scope.
| | i.e. passing in the ScopeKey as an additional parameter.
| |
| | The old api should invoke the new api with the default scope.
| |
| | Retrieving the context is one of them.
| |
| | There are other apis that need to be able to retrieve all contexts in all scopes
| | and include the scope in the identity.
| | The checking of incomplete contexts in the kernel deployer
| | or the repository service is one of the latter.
| If you could just 'mark' all the necessary API methods that need updateing, I'll go and 'fix' them.
Anything that takes a "name" and returns a ControllerContext
is in the first category.
e.g.
| ControllerContext getInstalledContext(Object name);
|
Anyhing that returns a collection of controller contexts is in the second category
| Set<ControllerContext> getNotInstalled();
|
I don't think there is anything that returns a list of names
but there are places like the incomplete deployment code
that needs to understand that the full unique name is no longer just
getName() but also needs to use ConstrollerContext.getScopeKey()
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4021219#4021219
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4021219
18 years, 10 months
[Design the new POJO MicroContainer] - Re: Scoped Kernels
by alesj
"adrian(a)jboss.org" wrote :
| I don't understand this. 2 contexts in different scopes should not have
| the same ScopeKey.
|
The problem that I encountered was when I had two beans with the same class and same name deployed into 2 different scopes, I always got annotations meta data for the first one deployed --> obvious, since keys matched --> no scope differentiation.
"adrian(a)jboss.org" wrote :
| There are a number of apis that need updating to understand Scope.
| i.e. passing in the ScopeKey as an additional parameter.
|
| The old api should invoke the new api with the default scope.
|
| Retrieving the context is one of them.
|
| There are other apis that need to be able to retrieve all contexts in all scopes
| and include the scope in the identity.
| The checking of incomplete contexts in the kernel deployer
| or the repository service is one of the latter.
If you could just 'mark' all the necessary API methods that need updateing, I'll go and 'fix' them.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4021213#4021213
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4021213
18 years, 10 months
[Design the new POJO MicroContainer] - Re: Need cleanup of the attachments api
by adrian@jboss.org
"scott.stark(a)jboss.org" wrote :
| I suggest the following change to cleanup the usage and allow for true transient/non-managed attachments:
|
| 1. Remove the Attachments interface from DeploymentUnit.
| 2. Mirror the Attachments api in DeploymentUnit with an enum that indicates what bucket is being accessed. The non-enum version of getAttachment follows the existing order of accessing the PredeterminedManagedObjects, TransientManagedObjects and TransientAttachments. The non-enum version of addAttachment would populate the TransientManagedObjects contents.
| 3. To populate a non-managed attachment, one would have to use the call that takes the enum targetting the TransientAttachments list.
| 4. Drop the getTransientManagedObjects access from DeploymentUnit.
|
I don't see the need for the enum?
Better would be like the DeploymentContext, i.e.
have a getTransientManagedObjects() and getTransientAttachments();
You can leave the old methods in place (deprecate them?)
and populate the TransientManagedObjects like you suggest.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4021181#4021181
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4021181
18 years, 10 months