PageRenderTime 24ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/seam-jms-forge-plugin/src/main/java/org/jboss/seam/jms/descriptors/hornetq/QueueDescriptor.java

https://github.com/grkvlt/jms
Java | 59 lines | 35 code | 2 blank | 22 comment | 0 complexity | c4f3f3bc5639db4816a1807ddea64adf MD5 | raw file
  1. /*
  2. * JBoss, Home of Professional Open Source
  3. * Copyright 2011 Red Hat Inc. and/or its affiliates and other contributors
  4. * as indicated by the @authors tag. All rights reserved.
  5. * See the copyright.txt in the distribution for a
  6. * full listing of individual contributors.
  7. *
  8. * Licensed under the Apache License, Version 2.0 (the "License");
  9. * you may not use this file except in compliance with the License.
  10. * You may obtain a copy of the License at
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. package org.jboss.seam.jms.descriptors.hornetq;
  19. import org.jboss.shrinkwrap.descriptor.api.Node;
  20. /**
  21. * QueueDescriptor - describes a queue in the HornetQJMS xml file.
  22. *
  23. * @author <a href="mailto:john.d.ament@gmail.com">John Ament</a>
  24. */
  25. public class QueueDescriptor {
  26. private final Node configuration;
  27. private final HornetQJMSDescriptorImpl parent;
  28. QueueDescriptor(Node configuration,HornetQJMSDescriptorImpl parent)
  29. {
  30. this.configuration = configuration;
  31. this.parent = parent;
  32. }
  33. public QueueDescriptor name(String name)
  34. {
  35. configuration.attribute("name",name);
  36. return this;
  37. }
  38. public QueueDescriptor entry(String name)
  39. {
  40. configuration.getOrCreate("entry").attribute("name",name);
  41. return this;
  42. }
  43. public QueueDescriptor durable(boolean durable)
  44. {
  45. configuration.getOrCreate("durable").text(durable);
  46. return this;
  47. }
  48. public QueueDescriptor filter(String filter)
  49. {
  50. configuration.getOrCreate("filter").text(filter);
  51. return this;
  52. }
  53. public HornetQJMSDescriptorImpl parent()
  54. {
  55. return parent;
  56. }
  57. }