@Override protected Object initAndInject(String className, List<? extends ConfigProperty> configs, ClassLoader cl) throws DeployException { try { Class clz = Class.forName(className, true, cl); Object o = clz.newInstance(); if (configs != null) { Injection injector = new Injection(); for (ConfigProperty cpmd : configs) { if (cpmd.isValueSet()) { if (XsdString.isNull(cpmd.getConfigPropertyType())) { injector.inject(o, cpmd.getConfigPropertyName().getValue(), cpmd.getConfigPropertyValue().getValue()); } else { injector.inject(o, cpmd.getConfigPropertyName().getValue(), cpmd.getConfigPropertyValue().getValue(), cpmd.getConfigPropertyType().getValue()); } } } } return o; } catch (Throwable t) { throw ConnectorLogger.ROOT_LOGGER.deploymentFailed(t, className); } }
@Override public Object initAndInject(String className, List<? extends ConfigProperty> configs, ClassLoader cl) throws DeployException { try { Class clz = Class.forName(className, true, cl); Object o = clz.newInstance(); if (configs != null) { Injection injector = new Injection(); for (ConfigProperty cpmd : configs) { if (cpmd.isValueSet()) { if (XsdString.isNull(cpmd.getConfigPropertyType())) { injector.inject(o, cpmd.getConfigPropertyName().getValue(), cpmd.getConfigPropertyValue().getValue()); } else { injector.inject(o, cpmd.getConfigPropertyName().getValue(), cpmd.getConfigPropertyValue().getValue(), cpmd.getConfigPropertyType().getValue()); } } } } return o; } catch (Throwable t) { throw ConnectorLogger.ROOT_LOGGER.deploymentFailed(t, className); } }
if (cdMetas.size() > 0) { for (org.jboss.jca.common.api.metadata.spec.ConnectionDefinition cdMeta : cdMetas) { raMcfClasses.add(cdMeta.getManagedConnectionFactoryClass().getValue()); if (aoMetas.size() > 0) { for (org.jboss.jca.common.api.metadata.spec.AdminObject aoMeta : aoMetas) { raAoClasses.add(aoMeta.getAdminobjectClass().getValue());
if (ra.getOutboundResourceadapter() != null) { for (ConnectionDefinition cd : ra.getOutboundResourceadapter().getConnectionDefinitions()) { if (cd.getConnectionFactoryInterface().getValue().equals(interfaceName)) cfInterface = cd.getConnectionFactoryInterface().getValue(); for (ConnectionDefinition cd : ra.getOutboundResourceadapter().getConnectionDefinitions()) { if (cd.getConnectionFactoryInterface().getValue().equals(cfInterface)) mcfClass = cd.getManagedConnectionFactoryClass().getValue();
/** * {@inheritDoc} */ public List<String> getRequiredWorkContexts() { List<String> result = new ArrayList<String>(requiredWorkContexts.size()); for (XsdString wc : requiredWorkContexts) result.add(wc.getValue()); return Collections.unmodifiableList(result); }
/** * {@inheritDoc} */ public String getResourceadapterClass() { if (XsdString.isNull(resourceadapterClass)) return null; return resourceadapterClass.getValue(); }
/** * {@inheritDoc} */ public String getModuleName() { if (XsdString.isNull(moduleName)) return null; return moduleName.getValue(); }
throws NoSuchMethodException String methodName = getOrIs + cpmd.getConfigPropertyName().getValue().substring(0, 1).toUpperCase(Locale.US); if (cpmd.getConfigPropertyName().getValue().length() > 1) methodName += cpmd.getConfigPropertyName().getValue().substring(1); sb = sb.append(" Property: " + cpmd.getConfigPropertyName().getValue()); sb = sb.append(" Type: " + method.getReturnType().getName());
@Override protected Object initAndInject(String className, List<? extends ConfigProperty> configs, ClassLoader cl) throws DeployException { try { Class clz = Class.forName(className, true, cl); Object o = clz.newInstance(); if (configs != null) { Injection injector = new Injection(); for (ConfigProperty cpmd : configs) { if (cpmd.isValueSet()) { if (XsdString.isNull(cpmd.getConfigPropertyType())) { injector.inject(o, cpmd.getConfigPropertyName().getValue(), cpmd.getConfigPropertyValue().getValue()); } else { injector.inject(o, cpmd.getConfigPropertyName().getValue(), cpmd.getConfigPropertyValue().getValue(), cpmd.getConfigPropertyType().getValue()); } } } } return o; } catch (Throwable t) { throw ConnectorLogger.ROOT_LOGGER.deploymentFailed(t, className); } }
@Override public Object initAndInject(String className, List<? extends ConfigProperty> configs, ClassLoader cl) throws DeployException { try { Class clz = Class.forName(className, true, cl); Object o = clz.newInstance(); if (configs != null) { Injection injector = new Injection(); for (ConfigProperty cpmd : configs) { if (cpmd.isValueSet()) { if (XsdString.isNull(cpmd.getConfigPropertyType())) { injector.inject(o, cpmd.getConfigPropertyName().getValue(), cpmd.getConfigPropertyValue().getValue()); } else { injector.inject(o, cpmd.getConfigPropertyName().getValue(), cpmd.getConfigPropertyValue().getValue(), cpmd.getConfigPropertyType().getValue()); } } } } return o; } catch (Throwable t) { throw ConnectorLogger.ROOT_LOGGER.deploymentFailed(t, className); } }
/** * Get the product name for the resource adapter * @param id The MDR identifier * @return The value */ private String getProductName(String id) { if (id == null || id.equals("")) return ""; try { Connector raXml = mdr.getResourceAdapter(id); if (raXml != null && !XsdString.isNull(raXml.getEisType())) { return raXml.getEisType().getValue(); } } catch (Throwable t) { log.debugf(t, "Exception while loading ra.xml: %s", id); } return ""; }
/** * Get the product version for the resource adapter * @param id The MDR identifier * @return The value */ private String getProductVersion(String id) { if (id == null || id.equals("")) return ""; try { Connector raXml = mdr.getResourceAdapter(id); if (raXml != null) { if (!XsdString.isNull(raXml.getResourceadapterVersion())) return raXml.getResourceadapterVersion().getValue(); } } catch (Throwable t) { log.debugf(t, "Exception while loading ra.xml: %s", id); } return ""; }
/** * {@inheritDoc} */ public void validate() throws ValidateException { boolean inboundOrOutbound = false; if (this.getOutboundResourceadapter() != null && this.getOutboundResourceadapter().validationAsBoolean()) inboundOrOutbound = true; if (this.getInboundResourceadapter() != null && this.getInboundResourceadapter().validationAsBoolean() && this.getResourceadapterClass() != null) inboundOrOutbound = true; if (!inboundOrOutbound && (XsdString.isNull(this.resourceadapterClass) || this.resourceadapterClass.getValue().trim().equals(""))) throw new ValidateException(bundle.invalidMetadataForResourceAdapter()); }
for (ConfigProperty c : original) if (ijProperties != null && ijProperties.containsKey(c.getConfigPropertyName().getValue())) XsdString newValue = new XsdString(ijProperties.get(c.getConfigPropertyName().getValue()), c .getConfigPropertyValue().getId(), c.getConfigPropertyValue().getTag()); ConfigProperty newProp = new ConfigPropertyImpl(c.getDescriptions(), c.getConfigPropertyName(),
@Override protected ManagedConnectionFactory createMcf(XaDataSource ds, String uniqueId, ClassLoader cl) throws NotFoundException, Exception, DeployException { Merger merger = new Merger(); Connector md = mdr.getResourceAdapter(uniqueId); md = merger.mergeConnectorAndDs(ds, md); // Get the first connection definition as there is only one ResourceAdapter ra = md.getResourceadapter(); List<ConnectionDefinition> cds = ra.getOutboundResourceadapter().getConnectionDefinitions(); ConnectionDefinition cd = cds.get(0); // ManagedConnectionFactory ManagedConnectionFactory mcf = (ManagedConnectionFactory) initAndInject(cd.getManagedConnectionFactoryClass() .getValue(), cd.getConfigProperties(), cl); initAndInjectClassLoaderPlugin(mcf, ds); return mcf; }
@Override protected ManagedConnectionFactory createMcf(DataSource ds, String uniqueId, ClassLoader cl) throws NotFoundException, Exception, DeployException { Merger merger = new Merger(); Connector md = mdr.getResourceAdapter(uniqueId); md = merger.mergeConnectorAndDs(ds, md); // Get the first connection definition as there is only one ResourceAdapter ra = md.getResourceadapter(); List<ConnectionDefinition> cds = ra.getOutboundResourceadapter().getConnectionDefinitions(); ConnectionDefinition cd = cds.get(0); // ManagedConnectionFactory ManagedConnectionFactory mcf = (ManagedConnectionFactory) initAndInject(cd.getManagedConnectionFactoryClass() .getValue(), cd.getConfigProperties(), cl); initAndInjectClassLoaderPlugin(mcf, ds); return mcf; }