@Override protected void processBeanMetaData(final EnterpriseBeanMetaData beanMetaData, final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final SecurityRoleRefsMetaData securityRoleRefs = beanMetaData.getSecurityRoleRefs(); if (securityRoleRefs == null) { return; } final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final EEModuleDescription moduleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION); final EJBComponentDescription ejbComponentDescription = (EJBComponentDescription) moduleDescription.getComponentByName(beanMetaData.getEjbName()); for (final SecurityRoleRefMetaData securityRoleRef : securityRoleRefs) { final String fromRole = securityRoleRef.getRoleName(); String toRole = securityRoleRef.getRoleLink(); if (fromRole == null || fromRole.trim().isEmpty()) { throw EjbLogger.ROOT_LOGGER.roleNamesIsNull(ejbComponentDescription.getEJBName()); } // if role-link hasn't been specified, then it links to the same role name as the one specified // in the role-name if (toRole == null) { toRole = fromRole; } ejbComponentDescription.linkSecurityRoles(fromRole, toRole); } } }
ComponentDescription bean = moduleDescription.getComponentByName(beanName); if (appclient) { if (bean == null) {
private static EJBEndpoint newEjbEndpoint(final PortComponentMetaData portComponentMD, final EEModuleDescription moduleDescription, final Set<String> securityRoles) { final String ejbName = portComponentMD.getEjbLink(); final SessionBeanComponentDescription sessionBean = (SessionBeanComponentDescription)moduleDescription.getComponentByName(ejbName); final String seiIfaceClassName = portComponentMD.getServiceEndpointInterface(); final EJBViewDescription ejbViewDescription = sessionBean.addWebserviceEndpointView(seiIfaceClassName); // JSR 109 - Version 1.3 - 6.2.2.4 Security // For EJB based service implementations, Handlers run after method level authorization has occurred. // JSR 109 - Version 1.3 - 6.2.2.5 Transaction // Handlers run under the transaction context of the component they are associated with. sessionBean.getConfigurators().addLast(new JAXRPCHandlersConfigurator()); final ServiceName ejbViewName = ejbViewDescription.getServiceName(); return new EJBEndpoint(sessionBean, ejbViewName, securityRoles, null, false, null); }
@Override protected void processBeanMetaData(final EnterpriseBeanMetaData beanMetaData, final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final SecurityRoleRefsMetaData securityRoleRefs = beanMetaData.getSecurityRoleRefs(); if (securityRoleRefs == null) { return; } final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final EEModuleDescription moduleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION); final EJBComponentDescription ejbComponentDescription = (EJBComponentDescription) moduleDescription.getComponentByName(beanMetaData.getEjbName()); for (final SecurityRoleRefMetaData securityRoleRef : securityRoleRefs) { final String fromRole = securityRoleRef.getRoleName(); String toRole = securityRoleRef.getRoleLink(); if (fromRole == null || fromRole.trim().isEmpty()) { throw MESSAGES.roleNamesIsNull(ejbComponentDescription.getEJBName()); } // if role-link hasn't been specified, then it links to the same role name as the one specified // in the role-name if (toRole == null) { toRole = fromRole; } ejbComponentDescription.linkSecurityRoles(fromRole, toRole); } } }
ComponentDescription bean = moduleDescription.getComponentByName(beanName); if (appclient) { if (bean == null) {