[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: Need a NamedObject SimpleMetaType
adrian@jboss.org
do-not-reply at jboss.com
Fri Aug 3 10:39:53 EDT 2007
"scott.stark at jboss.org" wrote : The name of the ManagedObject is generally not useful for referencing as its a DeploymentUnit attachment name. This is not usable for a datasource referencing a security domain whose deployment type and attachment type won't be known.
|
If the name is not usable then we should change it.
I remember putting a comment somewhere that I thought the current
use of the name was wrong.
IIRC, it is only currently used to know the key to which
the attachment should be put back in the attachments.
anonymous wrote :
| You don't think the Name type belongs here, the ManagedObjectRegistry, or both?
|
Both.
I don't expect that there will be a bus in the managed project, just the spi to allow references to be resolved.
Its also not sufficient to just have the name in the registry. I also need to be able to validate that the source the name is bound to supports the expected property type. I guess this requires the use of the GenericMetaType on the property and source to check that the expected type exists. However, if the source supports an extension of an interface the property wants, this cannot be determined from the classname comparision GenericMetaType supports. The source would have to declare a GenericMetaType for each interface.
Based on your "SecurityDomain" example then I don't see this as anything
more than a name with qualifier.
i.e. SecurityDomain/Default.
The trivial requirement could be served from the following
pseudo markup.
| public class ConnectionManagerMetaData
| {
| @ManagedObjectRef(type="SecurityDomain');
| public void setSecurityDomain(String securityDomain);
| }
|
| @MangedObject
| public class SecurityDeployment
| {
| @ManagedProperty
| Collection<SecurityPolicy> getPolicies();
| }
|
| public SecurityPolicyMetaData
| {
| @ManagedObjectID(type="SecurityDomain")
| public String getName();
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4070629#4070629
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4070629
More information about the jboss-dev-forums
mailing list