protected String[] getMethodParams(MethodParametersMetaData methodParametersMetaData) { if (methodParametersMetaData == null) { return null; } return methodParametersMetaData.toArray(new String[0]); }
void addInterceptorBinding(final InterceptorBindingMetaData interceptorBinding) { this.interceptorBindings.add(interceptorBinding); } }
public static Method resolveMethod(final NamedMethodMetaData methodData, final Class<?> componentClass, final DeploymentReflectionIndex reflectionIndex) throws DeploymentUnitProcessingException { return resolveMethod(methodData.getMethodName(), methodData.getMethodParams(), componentClass, reflectionIndex); }
private Properties getActivationConfigProperties(final ActivationConfigMetaData activationConfig) { final Properties activationConfigProps = new Properties(); if (activationConfig == null || activationConfig.getActivationConfigProperties() == null) { return activationConfigProps; } final ActivationConfigPropertiesMetaData activationConfigPropertiesMetaData = activationConfig.getActivationConfigProperties(); for (ActivationConfigPropertyMetaData activationConfigProp : activationConfigPropertiesMetaData) { if (activationConfigProp == null) { continue; } final String propName = activationConfigProp.getActivationConfigPropertyName(); final String propValue = activationConfigProp.getValue(); if (propName != null) { activationConfigProps.put(propName, propValue); } } return activationConfigProps; }
public static Method resolveMethod(final MethodMetaData methodData, final Class<?> componentClass, final DeploymentReflectionIndex reflectionIndex) throws DeploymentUnitProcessingException { return resolveMethod(methodData.getMethodName(), methodData.getMethodParams(), componentClass, reflectionIndex); }
@Override protected void handleDeploymentDescriptor(final DeploymentUnit deploymentUnit, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final StatefulComponentDescription componentConfiguration) throws DeploymentUnitProcessingException { final SessionBeanMetaData data = componentConfiguration.getDescriptorData(); if (data == null) { return; } if (data instanceof SessionBean31MetaData) { SessionBean31MetaData sessionBean31MetaData = (SessionBean31MetaData) data; final StatefulTimeoutMetaData statefulTimeout = sessionBean31MetaData.getStatefulTimeout(); if (statefulTimeout != null) { TimeUnit unit = TimeUnit.MINUTES; if (statefulTimeout.getUnit() != null) { unit = statefulTimeout.getUnit(); } componentConfiguration.setStatefulTimeout(new StatefulTimeoutInfo(statefulTimeout.getTimeout(), unit)); } } } }
static EnterpriseBeansMetaData getEnterpriseBeansMetaData(final DeploymentUnit deploymentUnit) { final EjbJarMetaData jarMetaData = deploymentUnit.getAttachment(EjbDeploymentAttachmentKeys.EJB_JAR_METADATA); if (jarMetaData == null) return null; return jarMetaData.getEnterpriseBeans(); }
static <B extends EnterpriseBeanMetaData> B getEnterpriseBeanMetaData(final DeploymentUnit deploymentUnit, final String name, final Class<B> expectedType) { final EnterpriseBeansMetaData enterpriseBeansMetaData = getEnterpriseBeansMetaData(deploymentUnit); if (enterpriseBeansMetaData == null) return null; return expectedType.cast(enterpriseBeansMetaData.get(name)); }
@Override protected void handleDeploymentDescriptor(final DeploymentUnit deploymentUnit, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final EJBComponentDescription componentConfiguration) throws DeploymentUnitProcessingException { final EnterpriseBeanMetaData beanMetaData = componentConfiguration.getDescriptorData(); if(componentConfiguration.isEntity() || beanMetaData == null) { return; } final TransactionManagementType type = componentConfiguration.getDescriptorData().getTransactionType(); if(type != null) { componentConfiguration.setTransactionManagementType(type); } } }
@Override protected void processBeanMetaData(final DeploymentUnit deploymentUnit, final EnterpriseBeanMetaData enterpriseBeanMetaData) throws DeploymentUnitProcessingException { if (enterpriseBeanMetaData.isMessageDriven()) { assert enterpriseBeanMetaData instanceof MessageDrivenBeanMetaData : enterpriseBeanMetaData + " is not a MessageDrivenBeanMetaData"; processMessageDrivenBeanMetaData(deploymentUnit, (MessageDrivenBeanMetaData) enterpriseBeanMetaData); } }
@Override protected void processBeanMetaData(final DeploymentUnit deploymentUnit, final EnterpriseBeanMetaData enterpriseBeanMetaData) throws DeploymentUnitProcessingException { if (enterpriseBeanMetaData.isSession()) { assert enterpriseBeanMetaData instanceof SessionBeanMetaData : enterpriseBeanMetaData + " is not a SessionBeanMetaData"; processSessionBeanMetaData(deploymentUnit, (SessionBeanMetaData) enterpriseBeanMetaData); } }
private EJBMethodPermission createEjbMethodPermission(Method invokedMethod, EJBComponent ejbComponent, MethodInterfaceType methodIntfType) { return new EJBMethodPermission(ejbComponent.getComponentName(), methodIntfType.name(), invokedMethod); }
private void processSessionBean31(final SessionBean31MetaData sessionBean31MetaData, final SessionBeanComponentDescription sessionBeanComponentDescription) { // no-interface view if (sessionBean31MetaData.isNoInterfaceBean()) { sessionBeanComponentDescription.addNoInterfaceView(); } }
private static SessionBeanComponentDescription.SessionBeanType descriptionOf(final SessionType sessionType) { if (sessionType == null) return null; switch (sessionType) { case Stateless: return SessionBeanComponentDescription.SessionBeanType.STATELESS; case Stateful: return SessionBeanComponentDescription.SessionBeanType.STATEFUL; case Singleton: return SessionBeanComponentDescription.SessionBeanType.SINGLETON; default: throw EjbLogger.ROOT_LOGGER.unknownSessionBeanType(sessionType.name()); } }
@Override public EjbJarMetaData parse(final XMLStreamReader reader, final PropertyReplacer propertyReplacer) throws XMLStreamException { final EjbJarMetaData metaData = new EjbJarMetaData(EjbJarVersion.EJB_3_1); processAttributes(metaData, reader); processElements(metaData, reader, propertyReplacer); return metaData; } }
@Override protected void handleDeploymentDescriptor(final DeploymentUnit deploymentUnit, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final SessionBeanComponentDescription componentConfiguration) throws DeploymentUnitProcessingException { if (componentConfiguration.getDescriptorData() == null) { return; } SessionBeanMetaData data = componentConfiguration.getDescriptorData(); if (data instanceof SessionBean31MetaData) { SessionBean31MetaData descriptor = (SessionBean31MetaData) data; final ConcurrencyManagementType type = descriptor.getConcurrencyManagementType(); if (type != null) { componentConfiguration.setConcurrencyManagementType(type); } } } }
@Override protected void handleDeploymentDescriptor(final DeploymentUnit deploymentUnit, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final EJBComponentDescription description) throws DeploymentUnitProcessingException { if (description.getDescriptorData() == null) { return; } final SecurityRoleRefsMetaData roleRefs = description.getDescriptorData().getSecurityRoleRefs(); if (roleRefs != null) { for(SecurityRoleRefMetaData ref : roleRefs) { description.addDeclaredRoles(ref.getRoleName()); } } } }
private boolean isEjbVersionGreaterThanOrEqualTo32(final DeploymentUnit deploymentUnit) { if (deploymentUnit == null) { return false; } final EjbJarMetaData ejbJarMetaData = deploymentUnit.getAttachment(EjbDeploymentAttachmentKeys.EJB_JAR_METADATA); // if there's no EjbJarMetadata then it means that there's no ejb-jar.xml. That effectively means that the version of this EJB deployment is the "latest" // which in this case (i.e. starting WildFly 8 version) is "greater than or equal to 3.2". Hence return true. if (ejbJarMetaData == null) { return true; } // let the ejb jar metadata tell us what the version is return ejbJarMetaData.isVersionGreaterThanOrEqual(EjbJarVersion.EJB_3_2); }
public static Collection<Method> resolveMethods(final NamedMethodMetaData methodData, final Class<?> componentClass, final DeploymentReflectionIndex reflectionIndex) throws DeploymentUnitProcessingException { return resolveMethods(methodData.getMethodName(), methodData.getMethodParams(), componentClass, reflectionIndex); }