Exemplo n.º 1
0
  /**
   * 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, Application application) {
    _name = serviceConfig.getQName();
    _application = application;
    if (serviceConfig.getInterface() != null) {
      _serviceInterface = serviceConfig.getInterface().getInterface();
    }
    _promotedService = getPromotedService(application, serviceConfig);
    _gateways = new ArrayList<Binding>();

    int idx = 1;
    for (BindingModel bindingModel : serviceConfig.getBindings()) {
      // Generate binding name for now until tooling and config are updated to expose it
      String name = bindingModel.getType() + idx++;
      _gateways.add(new BaseBinding(bindingModel.getType(), name, bindingModel.toString()));
    }
  }
Exemplo n.º 2
0
 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;
 }