}
private OutboundHandler handleReferenceBinding(JCABindingModel config, QName name) {
JCABindingModel jcaconfig = (JCABindingModel)config;
OutboundConnectionModel outboundConnectionModel = jcaconfig.getOutboundConnection();
if (outboundConnectionModel == null) {
throw JCAMessages.MESSAGES.noOutboundConnectionConfigured();
}
boolean managed = outboundConnectionModel.isManaged();
if (!managed) {
throw JCAMessages.MESSAGES.nonManagedScenarioIsNotSupportedYet();
}
ResourceAdapterModel resourceAdapterModel = outboundConnectionModel.getResourceAdapter();
if (resourceAdapterModel != null) {
Properties raProps = resourceAdapterModel.getProperties();
if (!raProps.isEmpty()) {
String raName = resourceAdapterModel.getName();
String raid = ConnectorServices.getRegisteredResourceAdapterIdentifier(stripDotRarSuffix(raName));
if (raid == null) {
throw JCAMessages.MESSAGES.uniqueKeyForResourceAdapter(raName);
}
ResourceAdapter resourceAdapter = null;
try {
resourceAdapter = _raRepository.getResourceAdapter(raid);
PropertyEditors.mapJavaBeanProperties(resourceAdapter, raProps);
} catch (Exception e) {
throw JCAMessages.MESSAGES.couldnTAcquireTheResourceAdapter(raName, e);
}
}
}
OutboundInteractionModel outboundInteractionModel = jcaconfig.getOutboundInteraction();
if (outboundInteractionModel == null) {
throw JCAMessages.MESSAGES.noOutboundInteractionConfigured();
}
ProcessorModel processorModel = outboundInteractionModel.getProcessor();
if (processorModel == null) {
throw JCAMessages.MESSAGES.noProcessorConfigured();
}
Properties processorProps = processorModel.getProperties();
AbstractOutboundProcessor processor = null;
String processorClassName = processorModel.getProcessorClassName();
Class<?> processorClass = null;
try {
processorClass = (Class<?>)_appClassLoader.loadClass(processorClassName);
processor = (AbstractOutboundProcessor) processorClass.newInstance();
if (!processorProps.isEmpty()) {
PropertyEditors.mapJavaBeanProperties(processor, processorProps);
}
} catch (Exception e) {
throw JCAMessages.MESSAGES.outboundProcessorClass(processorClassName, e);
}
ConnectionModel connectionModel = outboundConnectionModel.getConnection();
if (connectionModel == null) {
throw JCAMessages.MESSAGES.noConnectionConfigured();
}
String cfJndiName = connectionModel.getConnectionFactoryJNDIName();
Properties connProps = connectionModel.getProperties();