コード例 #1
0
  public void deploy(DeploymentUnit unit) throws DeploymentException {
    Set<? extends RubyEndpointMetaData> allMetaData =
        unit.getAllMetaData(RubyEndpointMetaData.class);

    if (allMetaData.size() == 0) {
      return;
    }

    log.debug("deploying for: " + unit);

    BeanMetaData busMetaData =
        unit.getAttachment(BeanMetaData.class + "$cxf.bus", BeanMetaData.class);

    RubyDynamicClassLoader classLoader = unit.getAttachment(RubyDynamicClassLoader.class);

    for (RubyEndpointMetaData endpointMetaData : allMetaData) {
      String beanName = getBeanName(unit, endpointMetaData.getName());
      BeanMetaDataBuilder builder =
          BeanMetaDataBuilder.createBuilder(beanName, RubyTypeSpace.class.getName());

      builder.addPropertyMetaData("rubyPath", "jboss/databinding/" + endpointMetaData.getName());
      builder.addPropertyMetaData("wsdlLocation", endpointMetaData.getWsdlLocation());
      builder.addPropertyMetaData("rubyDynamicClassLoader", classLoader);

      ValueMetaData busInjection = builder.createInject(busMetaData.getName());
      builder.addPropertyMetaData("bus", busInjection);

      BeanMetaData beanMetaData = builder.getBeanMetaData();
      unit.addAttachment(
          BeanMetaData.class.getName() + "$databinding." + endpointMetaData.getName(),
          beanMetaData,
          BeanMetaData.class);
    }
  }
コード例 #2
0
 @Override
 public void deploy(DeploymentUnit unit) throws DeploymentException {
   if (unit.getAllMetaData(MessageProcessorMetaData.class).isEmpty()) {
     return;
   }
   PoolMetaData pool = AttachmentUtils.getAttachment(unit, "messaging", PoolMetaData.class);
   if (pool == null) {
     RubyApplicationMetaData envMetaData = unit.getAttachment(RubyApplicationMetaData.class);
     boolean devMode = envMetaData != null && envMetaData.isDevelopmentMode();
     pool = devMode ? new PoolMetaData("messaging", 1, 2) : new PoolMetaData("messaging");
     pool.setInstanceFactoryName(this.instanceFactoryName);
     AttachmentUtils.multipleAttach(unit, pool, "messaging");
   }
 }