private String getResourceId(String beanName, String resourceId, String type, AppResources appResources) throws OpenEJBException { return getResourceId(beanName, resourceId, type, null, appResources); }
private String getResourceId(final String beanName, final String resourceId, final String type, final AppResources appResources) throws OpenEJBException { return getResourceId(beanName, resourceId, type, null, appResources); }
private String getResourceId(final String beanName, final String resourceId, final String type, final AppResources appResources) throws OpenEJBException { return getResourceId(beanName, resourceId, type, null, appResources); }
private String installResource(String beanName, ResourceInfo resourceInfo) throws OpenEJBException { String resourceAdapterId = resourceInfo.properties.getProperty("ResourceAdapter"); if (resourceAdapterId != null) { String newResourceId = getResourceId(beanName, resourceAdapterId, null, null); if (resourceAdapterId != newResourceId) { resourceInfo.properties.setProperty("ResourceAdapter", newResourceId); } } String dataSourceId = resourceInfo.properties.getProperty("DataSource"); if (dataSourceId != null && dataSourceId.length() > 0) { String newResourceId = getResourceId(beanName, dataSourceId, null, null); if (dataSourceId != newResourceId) { resourceInfo.properties.setProperty("DataSource", newResourceId); } } configFactory.install(resourceInfo); return resourceInfo.id; }
private String installResource(final String beanName, final ResourceInfo resourceInfo) throws OpenEJBException { final String resourceAdapterId = resourceInfo.properties.getProperty("ResourceAdapter"); if (resourceAdapterId != null) { final String newResourceId = getResourceId(beanName, resourceAdapterId, null, null); if (!resourceAdapterId.equals(newResourceId)) { resourceInfo.properties.setProperty("ResourceAdapter", newResourceId); } } final String dataSourceId = resourceInfo.properties.getProperty("DataSource"); if (dataSourceId != null && dataSourceId.length() > 0) { final String newResourceId = getResourceId(beanName, dataSourceId, null, null); if (!dataSourceId.equals(newResourceId)) { resourceInfo.properties.setProperty("DataSource", newResourceId); } } configFactory.install(resourceInfo); return resourceInfo.id; }
private String installResource(final String beanName, final ResourceInfo resourceInfo) throws OpenEJBException { final String resourceAdapterId = resourceInfo.properties.getProperty("ResourceAdapter"); if (resourceAdapterId != null) { final String newResourceId = getResourceId(beanName, resourceAdapterId, null, null); if (!resourceAdapterId.equals(newResourceId)) { resourceInfo.properties.setProperty("ResourceAdapter", newResourceId); } } final String dataSourceId = resourceInfo.properties.getProperty("DataSource"); if (dataSourceId != null && dataSourceId.length() > 0) { final String newResourceId = getResourceId(beanName, dataSourceId, null, null); if (!dataSourceId.equals(newResourceId)) { resourceInfo.properties.setProperty("DataSource", newResourceId); } } configFactory.install(resourceInfo); return resourceInfo.id; }
private String createContainer(final Class<? extends ContainerInfo> containerInfoType, final EjbDeployment ejbDeployment, final EnterpriseBean bean) throws OpenEJBException { if (!autoCreateContainers) { throw new OpenEJBException("A container of type " + getType(bean) + " must be declared in the configuration file for bean: " + bean.getEjbName()); } // get the container info (data used to build the container) final ContainerInfo containerInfo = configFactory.configureService(containerInfoType); logger.info("Auto-creating a container for bean " + ejbDeployment.getDeploymentId() + ": Container(type=" + getType(bean) + ", id=" + containerInfo.id + ")"); // if the is an MDB container we need to resolve the resource adapter final String resourceAdapterId = containerInfo.properties.getProperty("ResourceAdapter"); if (resourceAdapterId != null) { final String newResourceId = getResourceId(ejbDeployment.getDeploymentId(), resourceAdapterId, null, null); if (resourceAdapterId.equals(newResourceId)) { containerInfo.properties.setProperty("ResourceAdapter", newResourceId); } } // install the container configFactory.install(containerInfo); return containerInfo.id; }
private String createContainer(final Class<? extends ContainerInfo> containerInfoType, final EjbDeployment ejbDeployment, final EnterpriseBean bean) throws OpenEJBException { if (!autoCreateContainers) { throw new OpenEJBException("A container of type " + getType(bean) + " must be declared in the configuration file for bean: " + bean.getEjbName()); } // get the container info (data used to build the container) final ContainerInfo containerInfo = configFactory.configureService(containerInfoType); logger.info("Auto-creating a container for bean " + ejbDeployment.getDeploymentId() + ": Container(type=" + getType(bean) + ", id=" + containerInfo.id + ")"); // if the is an MDB container we need to resolve the resource adapter final String resourceAdapterId = containerInfo.properties.getProperty("ResourceAdapter"); if (resourceAdapterId != null) { final String newResourceId = getResourceId(ejbDeployment.getDeploymentId(), resourceAdapterId, null, null); if (resourceAdapterId.equals(newResourceId)) { containerInfo.properties.setProperty("ResourceAdapter", newResourceId); } } // install the container configFactory.install(containerInfo); return containerInfo.id; }
private String createContainer(Class<? extends ContainerInfo> containerInfoType, EjbDeployment ejbDeployment, EnterpriseBean bean) throws OpenEJBException { if (!autoCreateContainers) { throw new OpenEJBException("A container of type " + getType(bean) + " must be declared in the configuration file for bean: " + bean.getEjbName()); } // get the container info (data used to build the container) ContainerInfo containerInfo = configFactory.configureService(containerInfoType); logger.info("Auto-creating a container for bean " + ejbDeployment.getDeploymentId() + ": Container(type=" + getType(bean) + ", id=" + containerInfo.id + ")"); // if the is an MDB container we need to resolve the resource adapter String resourceAdapterId = containerInfo.properties.getProperty("ResourceAdapter"); if (resourceAdapterId != null) { String newResourceId = getResourceId(ejbDeployment.getDeploymentId(), resourceAdapterId, null, null); if (resourceAdapterId != newResourceId) { containerInfo.properties.setProperty("ResourceAdapter", newResourceId); } } // install the container configFactory.install(containerInfo); return containerInfo.id; }
appResources); if (newId != null) { // app scoped resources, try to find it without creating it first id = getResourceId(ejbModule.getModuleId(), newId, refType, appResources); } else { id = getResourceId(ejbDeployment.getDeploymentId(), id, refType, appResources); id = getResourceId(ejbDeployment.getDeploymentId(), id, refType, appResources); ejbDeployment.addResourceLink(link); } else { final String id = getResourceId(ejbDeployment.getDeploymentId(), link.getResId(), refType, appResources); link.setResId(id); link.setResRefName(refName);
appResources); if (newId != null) { // app scoped resources, try to find it without creating it first id = getResourceId(ejbModule.getModuleId(), newId, refType, appResources); } else { id = getResourceId(ejbDeployment.getDeploymentId(), id, refType, appResources); id = getResourceId(ejbDeployment.getDeploymentId(), id, refType, appResources); ejbDeployment.addResourceLink(link); } else { final String id = getResourceId(ejbDeployment.getDeploymentId(), link.getResId(), refType, appResources); link.setResId(id); link.setResRefName(refName);
private void processResourceRef(ResourceRef ref, EjbDeployment ejbDeployment, AppResources appResources) throws OpenEJBException { // skip destinations with a global jndi name String mappedName = ref.getMappedName(); if (mappedName == null) mappedName = ""; if ((mappedName).startsWith("jndi:")){ return; } String refName = ref.getName(); String refType = ref.getType(); // skip references such as URLs which are automatically handled by the server if (ignoredReferenceTypes.contains(refType)) { return; } ResourceLink link = ejbDeployment.getResourceLink(refName); if (link == null) { String id = (mappedName.length() == 0) ? ref.getName() : mappedName; id = getResourceId(ejbDeployment.getDeploymentId(), id, refType, appResources); logger.info("Auto-linking resource-ref '" + refName + "' in bean " + ejbDeployment.getDeploymentId() + " to Resource(id=" + id + ")"); link = new ResourceLink(); link.setResId(id); link.setResRefName(refName); ejbDeployment.addResourceLink(link); } else { String id = getResourceId(ejbDeployment.getDeploymentId(), link.getResId(), refType, appResources); link.setResId(id); link.setResRefName(refName); } }
destinationId = getResourceId(moduleId, destinationId, ref.getType(), appResources); ref.setMappedName(destinationId);
destinationId = getResourceId(moduleId, destinationId, refType, appResources); } catch (final OpenEJBException ex) { if (!(ref instanceof ContextRef)) {
destinationId = getResourceId(moduleId, destinationId, refType, appResources); } catch (final OpenEJBException ex) { if (!(ref instanceof ContextRef)) {