// method-permission*
Map excludedMethodsByEjb = new HashMap();
MethodPermissionNode mpNode = new MethodPermissionNode();
for (Iterator e = bundleDescriptor.getEjbs().iterator();e.hasNext();) {
EjbDescriptor ejbDesc = (EjbDescriptor) e.next();
if (ejbDesc instanceof EjbMessageBeanDescriptor)
continue;
Vector excludedMethods = new Vector();
addMethodPermissions(ejbDesc, ejbDesc.getPermissionedMethodsByPermission(), excludedMethods, mpNode, assemblyNode);
addMethodPermissions(ejbDesc, ejbDesc.getStyledPermissionedMethodsByPermission(), excludedMethods, mpNode, assemblyNode);
if (excludedMethods.size()>0) {
excludedMethodsByEjb.put(ejbDesc, excludedMethods);
}
}
// container-transaction*
ContainerTransactionNode ctNode = new ContainerTransactionNode();
for (Iterator e = bundleDescriptor.getEjbs().iterator();e.hasNext();) {
EjbDescriptor ejbDesc = (EjbDescriptor) e.next();
ctNode.writeDescriptor(assemblyNode, EjbTagNames.CONTAINER_TRANSACTION, ejbDesc);
}
// interceptor-binding*
Set ejbsForInterceptors = bundleDescriptor.getEjbs();
InterceptorBindingNode interceptorBindingNode = new
InterceptorBindingNode();
for(Iterator itr = ejbsForInterceptors.iterator(); itr.hasNext();) {
EjbDescriptor ejbDesc = (EjbDescriptor) itr.next();
if( ejbDesc.getInterceptorClasses().size() > 0 ) {
interceptorBindingNode.writeBindings(assemblyNode,
ejbDesc);
}
}
// message-destination*
writeMessageDestinations
(assemblyNode, bundleDescriptor.getMessageDestinations().iterator());
// exclude-list*
if (excludedMethodsByEjb.size()>0) {
Node excludeListNode = this.appendChild(assemblyNode, EjbTagNames.EXCLUDE_LIST);
for (Iterator ejbs = excludedMethodsByEjb.keySet().iterator(); ejbs.hasNext();) {
EjbDescriptor ejbDesc = (EjbDescriptor) ejbs.next();
Vector excludedMethods = (Vector) excludedMethodsByEjb.get(ejbDesc);
MethodPermissionDescriptor mpd = new MethodPermissionDescriptor();
mpd.addMethodPermission(MethodPermission.getExcludedMethodPermission());
mpd.addMethods(excludedMethods);