Java Code Examples for javax.resource.spi.ActivationSpec#setResourceAdapter()
The following examples show how to use
javax.resource.spi.ActivationSpec#setResourceAdapter() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GenericMessageEndpointManager.java From spring-analysis-note with MIT License | 6 votes |
/** * Prepares the message endpoint, and automatically activates it * if the "autoStartup" flag is set to "true". */ @Override public void afterPropertiesSet() throws ResourceException { if (getResourceAdapter() == null) { throw new IllegalArgumentException("Property 'resourceAdapter' is required"); } if (getMessageEndpointFactory() == null) { throw new IllegalArgumentException("Property 'messageEndpointFactory' is required"); } ActivationSpec activationSpec = getActivationSpec(); if (activationSpec == null) { throw new IllegalArgumentException("Property 'activationSpec' is required"); } if (activationSpec.getResourceAdapter() == null) { activationSpec.setResourceAdapter(getResourceAdapter()); } else if (activationSpec.getResourceAdapter() != getResourceAdapter()) { throw new IllegalArgumentException("ActivationSpec [" + activationSpec + "] is associated with a different ResourceAdapter: " + activationSpec.getResourceAdapter()); } }
Example 2
Source File: GenericMessageEndpointManager.java From java-technology-stack with MIT License | 6 votes |
/** * Prepares the message endpoint, and automatically activates it * if the "autoStartup" flag is set to "true". */ @Override public void afterPropertiesSet() throws ResourceException { if (getResourceAdapter() == null) { throw new IllegalArgumentException("Property 'resourceAdapter' is required"); } if (getMessageEndpointFactory() == null) { throw new IllegalArgumentException("Property 'messageEndpointFactory' is required"); } ActivationSpec activationSpec = getActivationSpec(); if (activationSpec == null) { throw new IllegalArgumentException("Property 'activationSpec' is required"); } if (activationSpec.getResourceAdapter() == null) { activationSpec.setResourceAdapter(getResourceAdapter()); } else if (activationSpec.getResourceAdapter() != getResourceAdapter()) { throw new IllegalArgumentException("ActivationSpec [" + activationSpec + "] is associated with a different ResourceAdapter: " + activationSpec.getResourceAdapter()); } }
Example 3
Source File: GenericMessageEndpointManager.java From lams with GNU General Public License v2.0 | 6 votes |
/** * Prepares the message endpoint, and automatically activates it * if the "autoStartup" flag is set to "true". */ @Override public void afterPropertiesSet() throws ResourceException { if (getResourceAdapter() == null) { throw new IllegalArgumentException("Property 'resourceAdapter' is required"); } if (getMessageEndpointFactory() == null) { throw new IllegalArgumentException("Property 'messageEndpointFactory' is required"); } ActivationSpec activationSpec = getActivationSpec(); if (activationSpec == null) { throw new IllegalArgumentException("Property 'activationSpec' is required"); } if (activationSpec.getResourceAdapter() == null) { activationSpec.setResourceAdapter(getResourceAdapter()); } else if (activationSpec.getResourceAdapter() != getResourceAdapter()) { throw new IllegalArgumentException("ActivationSpec [" + activationSpec + "] is associated with a different ResourceAdapter: " + activationSpec.getResourceAdapter()); } }
Example 4
Source File: GenericMessageEndpointManager.java From spring4-understanding with Apache License 2.0 | 6 votes |
/** * Prepares the message endpoint, and automatically activates it * if the "autoStartup" flag is set to "true". */ @Override public void afterPropertiesSet() throws ResourceException { if (getResourceAdapter() == null) { throw new IllegalArgumentException("Property 'resourceAdapter' is required"); } if (getMessageEndpointFactory() == null) { throw new IllegalArgumentException("Property 'messageEndpointFactory' is required"); } ActivationSpec activationSpec = getActivationSpec(); if (activationSpec == null) { throw new IllegalArgumentException("Property 'activationSpec' is required"); } if (activationSpec.getResourceAdapter() == null) { activationSpec.setResourceAdapter(getResourceAdapter()); } else if (activationSpec.getResourceAdapter() != getResourceAdapter()) { throw new IllegalArgumentException("ActivationSpec [" + activationSpec + "] is associated with a different ResourceAdapter: " + activationSpec.getResourceAdapter()); } }
Example 5
Source File: ResourceAdapterImpl.java From ironjacamar with Eclipse Public License 1.0 | 5 votes |
/** * {@inheritDoc} */ public void endpointActivation(MessageEndpointFactory mef, ActivationSpec as) throws Exception { if (mef == null) throw new Exception("MessageEndpointFactory is null"); if (as == null) throw new Exception("ActivationSpec is null"); as.setResourceAdapter(resourceAdapter); try { as.validate(); } catch (UnsupportedOperationException uoe) { // Ignore } if (is16) { verifyBeanValidation(as); } resourceAdapter.endpointActivation(mef, as); InflowRecovery ir = null; if (transactionIntegration != null && transactionIntegration.getRecoveryRegistry() != null) { XAResourceRecovery xar = transactionIntegration.createXAResourceRecovery(resourceAdapter, as, productName, productVersion); ir = new InflowRecoveryImpl(mef, as, xar, transactionIntegration.getRecoveryRegistry()); ir.activate(); } activeEndpoints.put(new Endpoint(mef, as), ir); }
Example 6
Source File: ActivationImpl.java From lams with GNU General Public License v2.0 | 4 votes |
/** * {@inheritDoc} */ public ActivationSpec createInstance() throws NotFoundException, InstantiationException, IllegalAccessException, ResourceException { Class<?> clz = activationSpecClass.get(); if (clz == null) throw new NotFoundException(bundle.activationSpecClassNotAvailable()); ResourceAdapter ra = rar.get(); if (ra == null) throw new NotFoundException(bundle.resourceAdapterNotAvailable()); ActivationSpec instance = ActivationSpec.class.cast(clz.newInstance()); instance.setResourceAdapter(ra); if (valueProperties != null && valueProperties.size() > 0) { Injection injector = new Injection(); Iterator<Map.Entry<String, String>> it = valueProperties.entrySet().iterator(); while (it.hasNext()) { String propertyName = null; String propertyValue = null; try { Map.Entry<String, String> entry = it.next(); propertyName = entry.getKey(); propertyValue = entry.getValue(); injector.inject(instance, propertyName, propertyValue); } catch (Throwable t) { log.debugf(t, "Ignoring: %s (%s)", propertyName, propertyValue); } } } return instance; }