private String[] getCamelLabels() { if (_camelLabels == null) { List<String> list = new ArrayList<String>(); list.add(ComponentLabel.CAMEL.label()); ContextMapperModel cm_model = getModel(); if (cm_model != null) { BindingModel b_model = cm_model.getBindingModel(); if (b_model != null) { String e_label = EndpointLabel.toLabel(b_model.getType()); if (e_label != null) { list.add(e_label); } } } _camelLabels = list.toArray(new String[list.size()]); } return _camelLabels; }
/** * Create a new BaseService from the specified config model. * * @param serviceConfig the composite service config. * @param application the application containing the service. */ public BaseService(CompositeServiceModel serviceConfig, BaseApplication application) { _name = serviceConfig.getQName(); _application = application; if (serviceConfig.getInterface() != null) { _serviceInterface = serviceConfig.getInterface().getInterface(); } _promotedService = getPromotedService(application, serviceConfig); _gateways = new LinkedHashMap<String, Binding>(); int idx = 0; for (BindingModel bindingModel : serviceConfig.getBindings()) { // Generate binding name for now until tooling and config are updated to expose it ++idx; String name = bindingModel.getName() == null ? "_" + _name.getLocalPart() + "_" + bindingModel.getType() + "_" + idx : bindingModel.getName(); _gateways.put(name, new BaseBinding(_application, _name, bindingModel.getType(), name, bindingModel.toString())); } _throttling = new ServiceThrottling(this, serviceConfig.getExtensions()); }
@Override public ServiceHandler activateBinding(QName name, BindingModel config) { if (_raRepository == null) { throw JCAMessages.MESSAGES.resourceAdapterRepositoryMustBeInjectedToActivateJCAComponent(); } if (_transactionManager == null) { try { _transactionManager = (TransactionManager)new InitialContext().lookup(JBOSS_TRANSACTION_MANAGER); } catch (NamingException e) { throw JCAMessages.MESSAGES.unableToFindTransactionManagerInJNDIAt(JBOSS_TRANSACTION_MANAGER, e); } } if (config.isServiceBinding()) { return handleServiceBinding((JCABindingModel)config, name); } else { return handleReferenceBinding((JCABindingModel)config, name); } }
QName refQName = reference.getQName(); ++bindingCount; if (binding.getName() == null) { _log.debug("Initializing binding name for binding " + bindingCount + " for reference " + reference.getQName() + " for deployment " + getName()); binding.setName("_" + reference.getName() + "_" + binding.getType() + "_" + bindingCount); _log.debug("Deploying binding " + binding.getName() + " for reference " + reference.getQName() + " for deployment " + getName()); Activator activator = findActivator(binding.getType()); if (activator == null) { continue;
for (BindingModel binding : service.getBindings()) { bindingList.add(BindingModel.class.cast(binding)); bindingDescList.add(binding.getModelConfiguration().toString()); String namespace = binding.getModelConfiguration().getQName().getNamespaceURI(); MessageComposerModel model = new V1MessageComposerModel(namespace); if (className != null) { binding.setMessageComposer(model); switchYard.saveConfig();
for (BindingModel binding : service.getBindings()) { bindingList.add(BindingModel.class.cast(binding)); bindingDescList.add(binding.getModelConfiguration().toString()); String namespace = binding.getModelConfiguration().getQName().getNamespaceURI(); ContextMapperModel model = new V1ContextMapperModel(namespace); if (className != null) { model.setIncludeNamespaces(includeNamespaces); model.setExcludeNamespaces(excludeNamespaces); binding.setContextMapper(model); switchYard.saveConfig();
bindingDescList.add(binding.getModelConfiguration().toString()); return; binding.setOperationSelector(selector); switchYard.saveConfig();
@Override public Lifecycle getGatwayLifecycle(final QName serviceName, final String bindingName) { // TODO: look at a more efficient way of doing this for (Activation binding : _serviceBindings) { if (bindingName.equals(binding.getBindingModel().getName()) && serviceName.equals(binding.getName())) { return binding.getHandler(); } } for (Activation binding : _referenceBindings) { if (bindingName.equals(binding.getBindingModel().getName()) && serviceName.equals(binding.getName())) { return binding.getHandler(); } } return null; }
for (BindingModel binding : service.getBindings()) { ++bindingCount; if (binding.getName() == null) { _log.debug("Initializing binding name for binding " + bindingCount + " for service " + service.getQName() + " for deployment " + getName()); binding.setName("_" + service.getName() + "_" + binding.getType() + "_" + bindingCount); _log.debug("Deploying binding " + binding.getName() + " for service " + service.getQName() + " for deployment " + getName()); Activator activator = findActivator(binding.getType()); if (activator == null) { continue;
private String[] getCamelLabels() { if (_camelLabels == null) { List<String> list = new ArrayList<String>(); list.add(ComponentLabel.CAMEL.label()); ContextMapperModel cm_model = getModel(); if (cm_model != null) { BindingModel b_model = cm_model.getBindingModel(); if (b_model != null) { String e_label = EndpointLabel.toLabel(b_model.getType()); if (e_label != null) { list.add(e_label); } } } _camelLabels = list.toArray(new String[list.size()]); } return _camelLabels; }
/** * Create a new BaseReference from the specified config model. * * @param referenceConfig the composite reference config. * @param application the application containing the service. */ public BaseReference(CompositeReferenceModel referenceConfig, BaseApplication application) { _name = referenceConfig.getQName(); _application = application; if (referenceConfig.getInterface() != null) { _referenceInterface = referenceConfig.getInterface().getInterface(); } _promotedReference = referenceConfig.getPromote(); _gateways = new LinkedHashMap<String, Binding>(); int idx = 0; for (BindingModel bindingModel : referenceConfig.getBindings()) { // Generate binding name for now until tooling and config are updated to expose it ++idx; String name = bindingModel.getName() == null ? "_" + _name.getLocalPart() + "_" + bindingModel.getType() + "_" + idx : bindingModel.getName(); _gateways.put(name, new BaseBinding(_application, _name, bindingModel.getType(), name, bindingModel.toString())); } _operations = new LinkedList<ServiceOperation>(); for (org.switchyard.metadata.ServiceOperation so : getInterfaceOperations(referenceConfig.getInterface())) { _operations.add(new BaseServiceOperation(so.getName(), so.getExchangePattern().name(), so.getInputType(), so.getOutputType(), so.getFaultType())); } }