JBossMetaData merge/override rules
aloubyansky Jun 5, 2008 9:42 AMThere are at least two sources of metadata: annotations and xml. Whatever approach we choose to represent them, we have to define which information is added (i.e. overriding metadata complements the original) during the merge and which one is completely redefined by the overriding metadata.
For example, in case of security, should the permissions from the XML (if present) replace the permissions defined with annotations completely or extend them?
I think, in general, the answer may depend on the type of metadata in question?
There maybe even a special annotation/xml element which would say how the merge should be done? Or maybe even result in a deployment error for something that must not be overriden? Anyway, let's define the defaults.
I've been writing some tests for every metadata type. But I am still not sure about some of them and would like to clarify.
In simple words for the following types what should be a complete replacement and what should be merged as "addAll()" overriding data with the same key (customizing). I added (addAll) where it seems to me it should be.
From JBossEnterpriseBeanMetaData
- InvokerBindingsMetaData (allAll)
- IORSecurityConfigMetaData
- JBossEnvironmentRefsGroupMetaData (addAll?)
- MethodAttributesMetaData (addAll)
- AnnotationsMetaData
- IgnoreDependencyMetaData (addAll)
- PoolConfigMetaData (addAll)
- JndiRefsMetaData (addAll)
From JBossSessionBeanMetaData
- BusinessLocalsMetaData
- BusinessRemotesMetaData
- InitMethodsMetaData
- RemoveMethodsMetaData
- AroundInvokesMetaData
- LifecycleCallbacksMetaData
- LifecycleCallbacksMetaData
- SecurityRoleRefsMetaData
- List remoteBindings
- ClusterConfigMetaData
- PortComponent
- SecurityIdentityMetaData
- CacheConfigMetaData
From JBossEntityBeanMetaData
- CMPFieldsMetaData (should it be ever overriden?)
- QueriesMetaData (only cutomization of the existing)
- CacheInvalidationConfigMetaData (customize existing)
From JBossMessageDrivenBeanMetaData
- ActivationConfigMetaData (addAll)
From JBossConsumerBeanMetaData
The following should probably be changed to Maps defining the keys for the types to make it easier identify the same metadata piece?
private List messageProperties = null;
private List producers = null;
private List localProducers = null;
From JBossMetaData
- RelationsMetaData (addAll)
- LoaderRepositoryMetaData (addAll)
- WebservicesMetaData (addAll)
- JBossEnterpriseBeansMetaData (addAll)
- ResourceManagersMetaData (addAll)
- InvokerProxyBindingsMetaData (addAll)
- ContainerConfigurationsMetaData (addAll)
- InterceptorsMetaData
- Map<String, RunAsIdentityMetaData> runAsIdentity
From JBossAssemblyDeploymentDescriptor
- SecurityRolesMetaData
- MethodPermissionsMetaData (addAll)
- ContainerTransactionsMetaData (addAll)
- InterceptorBindingsMetaData
- MessageDestinationsMetaData
- ExcludeListMetaData
- ApplicationExceptionsMetaData
In a number of types there are fields of primitive boolean types. It may make sense to switch to the wrapper to differentiate between the default and non-set value.