Refine search
private List<BindingConfiguration> getResourceRefEntries(final DeploymentUnit deploymentUnit, DeploymentDescriptorEnvironment environment, ClassLoader classLoader, DeploymentReflectionIndex deploymentReflectionIndex, ResourceInjectionTarget resourceInjectionTarget) throws DeploymentUnitProcessingException { List<BindingConfiguration> bindings = new ArrayList<BindingConfiguration>(); final EEResourceReferenceProcessorRegistry registry = deploymentUnit.getAttachment(Attachments.RESOURCE_REFERENCE_PROCESSOR_REGISTRY); final ResourceReferencesMetaData resourceRefs = environment.getEnvironment().getResourceReferences(); if (resourceRefs == null) { return bindings; name = resourceRef.getName(); } else { name = environment.getDefaultContext() + resourceRef.getName(); bindings.add(new BindingConfiguration(name, injectionSource));
return; // Skip non web deployments WarMetaData warMetaData = deploymentUnit.getAttachment(WarMetaData.ATTACHMENT_KEY); assert warMetaData != null; boolean fragmentFound = false; Map<String, WebFragmentMetaData> webFragments = warMetaData.getWebFragmentsMetaData(); List<ResourceRoot> resourceRoots = deploymentUnit.getAttachmentList(Attachments.RESOURCE_ROOTS); for (ResourceRoot resourceRoot : resourceRoots) { if (resourceRoot.getRoot().getName().toLowerCase(Locale.ENGLISH).endsWith(".jar")) { final DeploymentDescriptorEnvironment bindings = new DeploymentDescriptorEnvironment("java:module/env/", mergedMetaData.getJndiEnvironmentRefsGroup()); deploymentUnit.putAttachment(org.jboss.as.ee.component.Attachments.MODULE_DEPLOYMENT_DESCRIPTOR_ENVIRONMENT, bindings);
private List<BindingConfiguration> getEnvironmentEntries(final DeploymentDescriptorEnvironment environment, final ClassLoader classLoader, DeploymentReflectionIndex deploymentReflectionIndex, ResourceInjectionTarget resourceInjectionTarget) throws DeploymentUnitProcessingException { final List<BindingConfiguration> bindings = new ArrayList<BindingConfiguration>(); final EnvironmentEntriesMetaData envEntries = environment.getEnvironment().getEnvironmentEntries(); if (envEntries == null) { return bindings; name = envEntry.getName(); } else { name = environment.getDefaultContext() + envEntry.getEnvEntryName(); final BindingConfiguration bindingConfiguration; if (!isEmpty(lookup)) { bindingConfiguration = new BindingConfiguration(name, new LookupInjectionSource(lookup)); } else if (type.equals(String.class.getName())) { bindingConfiguration = new BindingConfiguration(name, new EnvEntryInjectionSource(value)); } else if (type.equals(Integer.class.getName()) || type.equals("int")) { bindingConfiguration = new BindingConfiguration(name, new EnvEntryInjectionSource(Integer.valueOf(value))); } else if (type.equals(Short.class.getName()) || type.equals("short")) { bindingConfiguration = new BindingConfiguration(name, new EnvEntryInjectionSource(Short.valueOf(value)));
private List<BindingConfiguration> getResourceEnvRefEntries(final DeploymentUnit deploymentUnit, final DeploymentDescriptorEnvironment environment, ClassLoader classLoader, DeploymentReflectionIndex deploymentReflectionIndex, ResourceInjectionTarget resourceInjectionTarget) throws DeploymentUnitProcessingException { List<BindingConfiguration> bindings = new ArrayList<BindingConfiguration>(); final ResourceEnvironmentReferencesMetaData resourceEnvRefs = environment.getEnvironment().getResourceEnvironmentReferences(); final EEResourceReferenceProcessorRegistry registry = deploymentUnit.getAttachment(Attachments.RESOURCE_REFERENCE_PROCESSOR_REGISTRY); if (resourceEnvRefs == null) { return bindings; name = resourceEnvRef.getName(); } else { name = environment.getDefaultContext() + resourceEnvRef.getName(); bindings.add(new BindingConfiguration(name, injectionSource));
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); if (!DeploymentTypeMarker.isType(DeploymentType.EAR, deploymentUnit)) { return; } final ResourceRoot deploymentRoot = deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.DEPLOYMENT_ROOT); final VirtualFile deploymentFile = deploymentRoot.getRoot(); EarMetaData earMetaData = handleSpecMetadata(deploymentFile, SpecDescriptorPropertyReplacement.propertyReplacer(deploymentUnit)); JBossAppMetaData jbossMetaData = handleJbossMetadata(deploymentFile, JBossDescriptorPropertyReplacement.propertyReplacer(deploymentUnit), deploymentUnit); if (earMetaData == null && jbossMetaData == null) { return; } // the jboss-app.xml has a distinct-name configured then attach it to the deployment unit if (jbossMetaData != null && jbossMetaData.getDistinctName() != null) { deploymentUnit.putAttachment(Attachments.DISTINCT_NAME, jbossMetaData.getDistinctName()); } JBossAppMetaData merged; if (earMetaData != null) { merged = new JBossAppMetaData(earMetaData.getEarVersion()); } else { merged = new JBossAppMetaData(); } JBossAppMetaDataMerger.merge(merged, jbossMetaData, earMetaData); deploymentUnit.putAttachment(Attachments.EAR_METADATA, merged); if (merged.getEarEnvironmentRefsGroup() != null) { final DeploymentDescriptorEnvironment bindings = new DeploymentDescriptorEnvironment("java:app/env/", merged.getEarEnvironmentRefsGroup()); deploymentUnit.putAttachment(org.jboss.as.ee.component.Attachments.MODULE_DEPLOYMENT_DESCRIPTOR_ENVIRONMENT, bindings); } }
final RemoteEnvironment remoteEnvironment = environment.getEnvironment(); List<BindingConfiguration> bindingDescriptions = new ArrayList<BindingConfiguration>(); EJBReferencesMetaData ejbRefs = remoteEnvironment.getEjbReferences(); if (ejbRefs != null) { for (EJBReferenceMetaData ejbRef : ejbRefs) { name = environment.getDefaultContext() + name; bindingConfiguration = new BindingConfiguration(name, new EjbLookupInjectionSource(lookup, remoteInterfaceType)); } else { bindingConfiguration = new BindingConfiguration(name, new LookupInjectionSource(lookup)); bindingConfiguration = new BindingConfiguration(name, ejbInjectionSource = new EjbInjectionSource(ejbName, remoteInterfaceType.getName(), name, deploymentUnit, appclient)); } else { bindingConfiguration = new BindingConfiguration(name, ejbInjectionSource = new EjbInjectionSource(remoteInterfaceType.getName(), name, deploymentUnit, appclient)); deploymentUnit.addToAttachmentList(EjbDeploymentAttachmentKeys.EJB_INJECTIONS, ejbInjectionSource); name = environment.getDefaultContext() + name; deploymentUnit.addToAttachmentList(EjbDeploymentAttachmentKeys.EJB_INJECTIONS, ejbInjectionSource);
@Override protected List<BindingConfiguration> processDescriptorEntries(final DeploymentUnit unit, final DeploymentDescriptorEnvironment environment, final ResourceInjectionTarget resourceInjectionTarget, final ComponentDescription componentDescription, final ClassLoader classLoader, final DeploymentReflectionIndex deploymentReflectionIndex, final EEApplicationClasses applicationClasses) throws DeploymentUnitProcessingException { final ServiceReferencesMetaData serviceRefsMD = environment.getEnvironment().getServiceReferences(); if (serviceRefsMD == null) { return Collections.<BindingConfiguration> emptyList(); } final List<BindingConfiguration> bindingDescriptions = new LinkedList<BindingConfiguration>(); for (final ServiceReferenceMetaData serviceRefMD : serviceRefsMD) { final UnifiedServiceRefMetaData serviceRefUMDM = getServiceRef(unit, componentDescription, serviceRefMD); final Module module = unit.getAttachment(Attachments.MODULE); final WSRefValueSource valueSource = new WSRefValueSource(serviceRefUMDM, module.getClassLoader()); final BindingConfiguration bindingConfiguration = new BindingConfiguration(serviceRefUMDM.getServiceRefName(), valueSource); bindingDescriptions.add(bindingConfiguration); final String serviceRefTypeName = serviceRefUMDM.getServiceRefType(); final Class<?> serviceRefType = getClass(classLoader, serviceRefTypeName); processInjectionTargets(resourceInjectionTarget, valueSource, classLoader, deploymentReflectionIndex, serviceRefMD, serviceRefType); } return bindingDescriptions; }
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final EEModuleDescription moduleDescription = deploymentUnit.getAttachment(org.jboss.as.ee.component.Attachments.EE_MODULE_DESCRIPTION); if (appclient) { if (bean == null) { for (final ComponentDescription component : deploymentUnit.getAttachmentList(Attachments.ADDITIONAL_RESOLVABLE_COMPONENTS)) { if (component.getComponentName().equals(beanName)) { bean = component; sessionBeanDescription.setDeploymentDescriptorEnvironment(new DeploymentDescriptorEnvironment("java:comp/env/", sessionBean));
final MessageDestinationReferencesMetaData messageDestinationReferences = environment.getEnvironment().getMessageDestinationReferences(); if (messageDestinationReferences == null) { return bindings; name = messageRef.getName(); } else { name = environment.getDefaultContext() + messageRef.getName(); final BindingConfiguration bindingConfiguration; if (!isEmpty(messageRef.getLookupName())) { bindingConfiguration = new BindingConfiguration(name, new LookupInjectionSource(messageRef.getLookupName())); bindings.add(bindingConfiguration); } else if (!isEmpty(messageRef.getMappedName())) { bindingConfiguration = new BindingConfiguration(name, new LookupInjectionSource(messageRef.getMappedName())); bindings.add(bindingConfiguration); } else if (!isEmpty(messageRef.getLink())) { final MessageDestinationInjectionSource messageDestinationInjectionSource = new MessageDestinationInjectionSource(messageRef.getLink(), name); bindingConfiguration = new BindingConfiguration(name, messageDestinationInjectionSource); deploymentUnit.addToAttachmentList(Attachments.MESSAGE_DESTINATIONS, messageDestinationInjectionSource); bindings.add(bindingConfiguration); } else {
private void processMessageDrivenBeanMetaData(final DeploymentUnit deploymentUnit, final MessageDrivenBeanMetaData mdb) throws DeploymentUnitProcessingException { final EjbJarDescription ejbJarDescription = getEjbJarDescription(deploymentUnit); final String beanName = mdb.getName(); final String beanClassName = mdb.getEjbClass(); String messageListenerInterface = mdb.getMessagingType(); if (messageListenerInterface == null || messageListenerInterface.trim().isEmpty()) { // TODO: This isn't really correct to default to MessageListener messageListenerInterface = MessageListener.class.getName(); } final Properties activationConfigProps = getActivationConfigProperties(mdb.getActivationConfig()); final String defaultResourceAdapterName = this.getDefaultResourceAdapterName(deploymentUnit.getServiceRegistry()); final MessageDrivenComponentDescription mdbComponentDescription = new MessageDrivenComponentDescription(beanName, beanClassName, ejbJarDescription, deploymentUnit.getServiceName(), messageListenerInterface, activationConfigProps, defaultResourceAdapterName, mdb, defaultMdbPoolAvailable); mdbComponentDescription.setDeploymentDescriptorEnvironment(new DeploymentDescriptorEnvironment("java:comp/env/", mdb)); addComponent(deploymentUnit, mdbComponentDescription); }
final EjbJarMetaData metaData = deploymentUnit.getAttachment(EjbDeploymentAttachmentKeys.EJB_JAR_METADATA); final EEModuleDescription eeModuleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION); if (metaData == null) { return; final DeploymentDescriptorEnvironment environment = new DeploymentDescriptorEnvironment("java:comp/env", interceptor.getJndiEnvironmentRefsGroup()); eeModuleDescription.addInterceptorEnvironment(interceptor.getInterceptorClass(), new InterceptorEnvironment(environment));
final EntityBeanComponentDescription description = createDescription(beanName, beanClassName, ejbJarDescription, deploymentUnit.getServiceName(), entity); description.setDeploymentDescriptorEnvironment(new DeploymentDescriptorEnvironment("java:comp/env/", entity)); deploymentUnit.addToAttachmentList(Attachments.ADDITIONAL_RESOLVABLE_COMPONENTS, description); } else {
if (environment.getEnvironment() == null) { return bindingConfigurations; PersistenceUnitReferencesMetaData persistenceUnitRefs = environment.getEnvironment().getPersistenceUnitRefs(); name = environment.getDefaultContext() + name; bindingConfiguration = new BindingConfiguration(name, new LookupInjectionSource(lookup)); } else { InjectionSource puBindingSource = this.getPersistenceUnitBindingSource(deploymentUnit, persistenceUnitName); bindingConfiguration = new BindingConfiguration(name, puBindingSource);
final RemoteEnvironment remoteEnvironment = environment.getEnvironment(); if (remoteEnvironment == null) { return bindingConfigurations; name = environment.getDefaultContext() + name; bindingConfiguration = new BindingConfiguration(name, new LookupInjectionSource(lookup)); } else { PropertiesMetaData properties = puRef.getProperties(); SynchronizationType.SYNCHRONIZED: SynchronizationType.UNSYNCHRONIZED; InjectionSource pcBindingSource = this.getPersistenceContextBindingSource(deploymentUnit, persistenceUnitName, type, synchronizationType, map); bindingConfiguration = new BindingConfiguration(name, pcBindingSource);
public static void handleMethods(DeploymentDescriptorEnvironment env, EEModuleDescription eeModuleDescription, String defaultClassName) throws DeploymentUnitProcessingException { final RemoteEnvironment environment = env.getEnvironment(); LifecycleCallbacksMetaData postConstructs = environment.getPostConstructs(); if (postConstructs != null) { for (LifecycleCallbackMetaData postConstruct : postConstructs) { LifecycleCallbacksMetaData preDestroys = environment.getPreDestroys(); if (preDestroys != null) { for (LifecycleCallbackMetaData preDestroy : preDestroys) {
@Override protected List<BindingConfiguration> processDescriptorEntries(final DeploymentUnit deploymentUnit, final DeploymentDescriptorEnvironment environment, final ResourceInjectionTarget resourceInjectionTarget, final ComponentDescription componentDescription, final ClassLoader classLoader, final DeploymentReflectionIndex deploymentReflectionIndex, final EEApplicationClasses applicationClasses) throws DeploymentUnitProcessingException { DataSourcesMetaData dataSources = environment.getEnvironment().getDataSources(); if(dataSources != null) { List<BindingConfiguration> ret = new ArrayList<BindingConfiguration>(dataSources.size()); for(DataSourceMetaData dataSource : dataSources) { ret.add(getBindingConfiguration(dataSource)); } return ret; } return Collections.emptyList(); }
@Override protected List<BindingConfiguration> processDescriptorEntries(final DeploymentUnit deploymentUnit, final DeploymentDescriptorEnvironment environment, final ResourceInjectionTarget resourceInjectionTarget, final ComponentDescription componentDescription, final ClassLoader classLoader, final DeploymentReflectionIndex deploymentReflectionIndex, final EEApplicationClasses applicationClasses) throws DeploymentUnitProcessingException { final ResourceDefinitionInjectionSources injectionSources = new ResourceDefinitionInjectionSources(); processEnvironment(environment.getEnvironment(), injectionSources); if (injectionSources.bindingConfigurations != null) { return injectionSources.bindingConfigurations; } else { return Collections.emptyList(); } }
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); if (!DeploymentTypeMarker.isType(DeploymentType.EAR, deploymentUnit)) { return; } final ResourceRoot deploymentRoot = deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.DEPLOYMENT_ROOT); final VirtualFile deploymentFile = deploymentRoot.getRoot(); EarMetaData earMetaData = handleSpecMetadata(deploymentFile, SpecDescriptorPropertyReplacement.propertyReplacer(deploymentUnit)); JBossAppMetaData jbossMetaData = handleJbossMetadata(deploymentFile, JBossDescriptorPropertyReplacement.propertyReplacer(deploymentUnit), deploymentUnit); if (earMetaData == null && jbossMetaData == null) { return; } // the jboss-app.xml has a distinct-name configured then attach it to the deployment unit if (jbossMetaData != null && jbossMetaData.getDistinctName() != null) { deploymentUnit.putAttachment(Attachments.DISTINCT_NAME, jbossMetaData.getDistinctName()); } JBossAppMetaData merged; if (earMetaData != null) { merged = new JBossAppMetaData(earMetaData.getEarVersion()); } else { merged = new JBossAppMetaData(); } JBossAppMetaDataMerger.merge(merged, jbossMetaData, earMetaData); deploymentUnit.putAttachment(Attachments.EAR_METADATA, merged); if (merged.getEarEnvironmentRefsGroup() != null) { final DeploymentDescriptorEnvironment bindings = new DeploymentDescriptorEnvironment("java:app/env/", merged.getEarEnvironmentRefsGroup()); deploymentUnit.putAttachment(org.jboss.as.ee.component.Attachments.MODULE_DEPLOYMENT_DESCRIPTOR_ENVIRONMENT, bindings); } }
private List<BindingConfiguration> getResourceEnvRefEntries(final DeploymentUnit deploymentUnit, final DeploymentDescriptorEnvironment environment, ClassLoader classLoader, DeploymentReflectionIndex deploymentReflectionIndex, ResourceInjectionTarget resourceInjectionTarget) throws DeploymentUnitProcessingException { List<BindingConfiguration> bindings = new ArrayList<BindingConfiguration>(); final ResourceEnvironmentReferencesMetaData resourceEnvRefs = environment.getEnvironment().getResourceEnvironmentReferences(); final EEResourceReferenceProcessorRegistry registry = deploymentUnit.getAttachment(Attachments.RESOURCE_REFERENCE_PROCESSOR_REGISTRY); if (resourceEnvRefs == null) { return bindings; name = resourceEnvRef.getName(); } else { name = environment.getDefaultContext() + resourceEnvRef.getName(); bindings.add(new BindingConfiguration(name, injectionSource));
final RemoteEnvironment remoteEnvironment = environment.getEnvironment(); final DeploymentClassIndex index = deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.CLASS_INDEX); List<BindingConfiguration> bindingDescriptions = new ArrayList<BindingConfiguration>(); EJBReferencesMetaData ejbRefs = remoteEnvironment.getEjbReferences(); if (ejbRefs != null) { for (EJBReferenceMetaData ejbRef : ejbRefs) { name = environment.getDefaultContext() + name; bindingConfiguration = new BindingConfiguration(name, new EjbLookupInjectionSource(lookup, remoteInterfaceType)); } else { bindingConfiguration = new BindingConfiguration(name, new LookupInjectionSource(lookup)); bindingConfiguration = new BindingConfiguration(name, ejbInjectionSource = new EjbInjectionSource(ejbName, remoteInterfaceType.getName(), name, deploymentUnit, appclient)); } else { bindingConfiguration = new BindingConfiguration(name, ejbInjectionSource = new EjbInjectionSource(remoteInterfaceType.getName(), name, deploymentUnit, appclient)); deploymentUnit.addToAttachmentList(EjbDeploymentAttachmentKeys.EJB_INJECTIONS, ejbInjectionSource); name = environment.getDefaultContext() + name; deploymentUnit.addToAttachmentList(EjbDeploymentAttachmentKeys.EJB_INJECTIONS, ejbInjectionSource);