use of org.jboss.as.ee.component.EEDefaultResourceJndiNames in project wildfly by wildfly.
the class WeldResourceInjectionServices method getEJBResourceName.
protected String getEJBResourceName(InjectionPoint injectionPoint, String proposedName) {
if (injectionPoint.getType() instanceof Class<?>) {
final Class<?> type = (Class<?>) injectionPoint.getType();
final String typeName = type.getName();
if (USER_TRANSACTION_CLASS_NAME.equals(typeName)) {
return USER_TRANSACTION_LOCATION;
} else if (HANDLE_DELEGATE_CLASS_NAME.equals(typeName)) {
WeldLogger.ROOT_LOGGER.injectionTypeNotValue(HANDLE_DELEGATE_CLASS_NAME, injectionPoint.getMember());
return proposedName;
} else if (ORB_CLASS_NAME.equals(typeName)) {
WeldLogger.ROOT_LOGGER.injectionTypeNotValue(ORB_CLASS_NAME, injectionPoint.getMember());
return proposedName;
} else if (TIMER_SERVICE_CLASS_NAME.equals(typeName)) {
WeldLogger.ROOT_LOGGER.injectionTypeNotValue(TIMER_SERVICE_CLASS_NAME, injectionPoint.getMember());
return proposedName;
} else if (EJB_CONTEXT_CLASS_NAME.equals(typeName) || EJB_SESSION_CONTEXT_CLASS_NAME.equals(typeName) || EJB_MESSAGE_DRIVEN_CONTEXT_CLASS_NAME.equals(typeName) || EJB_ENTITY_CONTEXT_CLASS_NAME.equals(typeName)) {
return EJB_CONTEXT_LOCATION;
} else if (WEB_SERVICE_CONTEXT_CLASS_NAME.equals(typeName)) {
//the whole CDI+bindings thing will likely be reviewed in EE8
return WEB_SERVICE_CONTEXT_CLASS_NAME;
} else if (TRANSACTION_SYNC_REGISTRY_CLASS_NAME.equals(typeName)) {
return TRANSACTION_SYNC_REGISTRY_LOCATION;
} else {
// EE default bindings
EEDefaultResourceJndiNames eeDefaultResourceJndiNames = moduleDescription.getDefaultResourceJndiNames();
if (eeDefaultResourceJndiNames.getContextService() != null && EE_CONTEXT_SERVICE_CLASS_NAME.equals(typeName)) {
return eeDefaultResourceJndiNames.getContextService();
} else if (eeDefaultResourceJndiNames.getDataSource() != null && EE_DATASOURCE_CLASS_NAME.equals(typeName)) {
return eeDefaultResourceJndiNames.getDataSource();
} else if (eeDefaultResourceJndiNames.getJmsConnectionFactory() != null && EE_JMS_CONNECTION_FACTORY_CLASS_NAME.equals(typeName)) {
return eeDefaultResourceJndiNames.getJmsConnectionFactory();
} else if (eeDefaultResourceJndiNames.getManagedExecutorService() != null && EE_MANAGED_EXECUTOR_SERVICE_CLASS_NAME.equals(typeName)) {
return eeDefaultResourceJndiNames.getManagedExecutorService();
} else if (eeDefaultResourceJndiNames.getManagedScheduledExecutorService() != null && EE_MANAGED_SCHEDULED_EXECUTOR_SERVICE_CLASS_NAME.equals(typeName)) {
return eeDefaultResourceJndiNames.getManagedScheduledExecutorService();
} else if (eeDefaultResourceJndiNames.getManagedThreadFactory() != null && EE_MANAGED_THREAD_FACTORY_CLASS_NAME.equals(typeName)) {
return eeDefaultResourceJndiNames.getManagedThreadFactory();
}
}
}
return proposedName;
}
use of org.jboss.as.ee.component.EEDefaultResourceJndiNames in project wildfly by wildfly.
the class DefaultBindingsConfigurationProcessor method deploy.
@Override
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
// store subsystem config in module description
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
final EEModuleDescription eeModuleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION);
if (eeModuleDescription != null) {
// set names only if these are not set yet
final EEDefaultResourceJndiNames defaultResourceJndiNames = eeModuleDescription.getDefaultResourceJndiNames();
if (defaultResourceJndiNames.getContextService() == null) {
defaultResourceJndiNames.setContextService(contextService);
}
if (defaultResourceJndiNames.getDataSource() == null) {
defaultResourceJndiNames.setDataSource(dataSource);
}
if (defaultResourceJndiNames.getJmsConnectionFactory() == null) {
defaultResourceJndiNames.setJmsConnectionFactory(jmsConnectionFactory);
}
if (defaultResourceJndiNames.getManagedExecutorService() == null) {
defaultResourceJndiNames.setManagedExecutorService(managedExecutorService);
}
if (defaultResourceJndiNames.getManagedScheduledExecutorService() == null) {
defaultResourceJndiNames.setManagedScheduledExecutorService(managedScheduledExecutorService);
}
if (defaultResourceJndiNames.getManagedThreadFactory() == null) {
defaultResourceJndiNames.setManagedThreadFactory(managedThreadFactory);
}
}
}
Aggregations