/* (non-Javadoc)
  * @see org.jboss.arquillian.impl.configuration.api.ArquillianDescriptor#getDefaultProtocol()
  */
 @Override
 public DefaultProtocolDef getDefaultProtocol() {
   if (model.getSingle("protocol") != null) {
     return new DefaultProtocolDefImpl(getDescriptorName(), model, model.getSingle("protocol"));
   }
   return null;
 }
 @Override
 public Map<String, String> getInitParams() {
   Map<String, String> result = new HashMap<String, String>();
   List<Node> params = filter.get("init-param");
   for (Node node : params) {
     result.put(node.textValue("param-name"), node.textValue("param-value"));
   }
   return result;
 }
 /* (non-Javadoc)
  * @see org.jboss.arquillian.impl.configuration.api.ArquillianDescriptor#getGroups()
  */
 @Override
 public List<GroupDef> getGroups() {
   List<GroupDef> groups = new ArrayList<GroupDef>();
   for (Node group : model.get("group")) {
     groups.add(new GroupDefImpl(getDescriptorName(), model, group));
   }
   return groups;
 }
 @Override
 public List<ExtensionDef> getExtensions() {
   List<ExtensionDef> extensions = new ArrayList<ExtensionDef>();
   for (Node extension : model.get("extension")) {
     extensions.add(new ExtensionDefImpl(getDescriptorName(), model, extension));
   }
   return extensions;
 }
 /* (non-Javadoc)
  * @see org.jboss.arquillian.impl.configuration.api.ArquillianDescriptor#getContainers()
  */
 @Override
 public List<ContainerDef> getContainers() {
   List<ContainerDef> containers = new ArrayList<ContainerDef>();
   for (Node container : model.get("container")) {
     containers.add(new ContainerDefImpl(getDescriptorName(), model, container));
   }
   return containers;
 }
Exemplo n.º 6
0
 private void readRecursive(Node target, org.w3c.dom.Node source) {
   readAttributes(target, source);
   NodeList sourceChildren = source.getChildNodes();
   if (sourceChildren != null) {
     for (int i = 0; i < sourceChildren.getLength(); i++) {
       org.w3c.dom.Node child = sourceChildren.item(i);
       if (child.getNodeType() != org.w3c.dom.Node.TEXT_NODE) {
         Node newTarget = target.create(child.getNodeName());
         if (onlyTextChildren(child)) {
           newTarget.text(child.getTextContent());
           readAttributes(newTarget, child);
         } else {
           readRecursive(newTarget, child);
         }
       }
     }
   }
 }
Exemplo n.º 7
0
 private void readAttributes(Node target, org.w3c.dom.Node source) {
   NamedNodeMap attributes = source.getAttributes();
   if (attributes != null) {
     for (int i = 0; i < attributes.getLength(); i++) {
       org.w3c.dom.Node attribute = attributes.item(i);
       target.attribute(attribute.getNodeName(), attribute.getNodeValue());
     }
   }
 }
 @Override
 public ExtensionDef extension(String name) {
   return new ExtensionDefImpl(getDescriptorName(), model, model.create("extension"))
       .setExtensionName(name);
 }
 /* (non-Javadoc)
  * @see org.jboss.arquillian.impl.configuration.api.ArquillianDescriptor#group(java.lang.String)
  */
 @Override
 public GroupDef group(String name) {
   return new GroupDefImpl(getDescriptorName(), model, model.create("group")).setGroupName(name);
 }
 public ContainerDef container(String name) {
   return new ContainerDefImpl(getDescriptorName(), model, model.create("container"))
       .setContainerName(name);
 }
 /* (non-Javadoc)
  * @see org.jboss.arquillian.impl.configuration.api.ArquillianDescriptor#engine()
  */
 @Override
 public EngineDef engine() {
   return new EngineDefImpl(getDescriptorName(), model, model.getOrCreate("engine"));
 }
Exemplo n.º 12
0
 @Override
 public String getName() {
   return filter.textValue("filter-name");
 }
 /* (non-Javadoc)
  * @see org.jboss.arquillian.impl.configuration.api.ArquillianDescriptor#defaultProtocol()
  */
 @Override
 public DefaultProtocolDef defaultProtocol(String type) {
   return new DefaultProtocolDefImpl(getDescriptorName(), model, model.getOrCreate("protocol"))
       .setType(type);
 }
Exemplo n.º 14
0
 @Override
 public FilterDef name(String name) {
   filter.getOrCreate("filter-name").text(name);
   return this;
 }
Exemplo n.º 15
0
 @Override
 public FilterDef asyncSupported(boolean value) {
   filter.getOrCreate("async-supported").text(value);
   return this;
 }
Exemplo n.º 16
0
 public TopicDescriptor topic(String name, String jndi) {
   return new TopicDescriptor(configuration.getOrCreate("topic@name=" + name), this)
       .name(name)
       .entry(jndi);
 }
Exemplo n.º 17
0
 @Override
 public boolean isAsyncSupported() {
   return Strings.isTrue(filter.textValue("async-supported"));
 }
Exemplo n.º 18
0
 @Override
 public FilterDef filterClass(String clazz) {
   filter.getOrCreate("filter-class").text(clazz);
   return this;
 }
Exemplo n.º 19
0
 @Override
 public String getFilterClass() {
   return filter.textValue("filter-class");
 }
 public QueueDef queue(String name) {
   Node queue = model.getOrCreate("queue").attribute("name", name);
   return new QueueDef(model, queue);
 }
Exemplo n.º 21
0
 public QueueDescriptor queue(String name, String jndi) {
   return new QueueDescriptor(configuration.getOrCreate("queue@name=" + name), this)
       .name(name)
       .entry(jndi);
 }