PageRenderTime 70ms CodeModel.GetById 28ms RepoModel.GetById 1ms app.codeStats 0ms

/jca/src/main/java/org/switchyard/component/jca/deploy/JCAInflowDeploymentMetaData.java

https://github.com/objectiser/switchyard-components
Java | 237 lines | 84 code | 34 blank | 119 comment | 0 complexity | 102b9eb454a46b4a030a48d6d14097d9 MD5 | raw file
  1. /*
  2. * Copyright 2013 Red Hat Inc. and/or its affiliates and other contributors.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. * http://www.apache.org/licenses/LICENSE-2.0
  8. * Unless required by applicable law or agreed to in writing, software
  9. * distributed under the License is distributed on an "AS IS" BASIS,
  10. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. * See the License for the specific language governing permissions and
  12. * limitations under the License.
  13. */
  14. package org.switchyard.component.jca.deploy;
  15. import javax.resource.spi.ActivationSpec;
  16. import javax.resource.spi.ResourceAdapter;
  17. import javax.transaction.TransactionManager;
  18. import org.switchyard.component.jca.endpoint.AbstractInflowEndpoint;
  19. /**
  20. * JCA inflow deployment metadata.
  21. *
  22. * @author <a href="mailto:tm.igarashi@gmail.com">Tomohisa Igarashi</a>
  23. */
  24. public class JCAInflowDeploymentMetaData {
  25. private Class<?> _listenerInterface = null;
  26. private AbstractInflowEndpoint _messageEndpoint = null;
  27. private ResourceAdapter _resourceAdapter = null;
  28. private ActivationSpec _activationSpec = null;
  29. private ClassLoader _applicationClassLoader = null;
  30. private TransactionManager _transactionManager = null;
  31. private boolean _transacted = false;
  32. private boolean _useBatchCommit = false;
  33. private int _batchSize = 0;
  34. private long _batchTimeout = 0;
  35. /**
  36. * get listener interface.
  37. *
  38. * @return listener interface
  39. */
  40. public Class<?> getListenerInterface() {
  41. return _listenerInterface;
  42. }
  43. /**
  44. * set listener interface.
  45. *
  46. * @param listenerInterface listener interface
  47. * @return {@link JCAInflowDeploymentMetaData} to support method chaining
  48. */
  49. public JCAInflowDeploymentMetaData setListenerInterface(Class<?> listenerInterface) {
  50. this._listenerInterface = listenerInterface;
  51. return this;
  52. }
  53. /**
  54. * get message endpoint.
  55. *
  56. * @return concrete subclass of {@link AbstractInflowEndpoint}
  57. */
  58. public AbstractInflowEndpoint getMessageEndpoint() {
  59. return _messageEndpoint;
  60. }
  61. /**
  62. * set message endpoint.
  63. *
  64. * @param messageEndpoint concrete subclass of {@link AbstractInflowEndpoint} to set
  65. * @return {@link JCAInflowDeploymentMetaData} to support method chaining
  66. */
  67. public JCAInflowDeploymentMetaData setMessageEndpoint(AbstractInflowEndpoint messageEndpoint) {
  68. this._messageEndpoint = messageEndpoint;
  69. return this;
  70. }
  71. /**
  72. * get {@link ResourceAdapter}.
  73. *
  74. * @return [@link ResourceAdapter}
  75. */
  76. public ResourceAdapter getResourceAdapter() {
  77. return _resourceAdapter;
  78. }
  79. /**
  80. * set {@link ResourceAdapter}.
  81. *
  82. * @param resourceAdapter {@link ResourceAdapter} to set
  83. * @return {@link JCAInflowDeploymentMetaData} to support method chaining
  84. */
  85. public JCAInflowDeploymentMetaData setResourceAdapter(ResourceAdapter resourceAdapter) {
  86. this._resourceAdapter = resourceAdapter;
  87. return this;
  88. }
  89. /**
  90. * get {@link ActivationSpec}.
  91. *
  92. * @return {@link ActivationSpec}
  93. */
  94. public ActivationSpec getActivationSpec() {
  95. return _activationSpec;
  96. }
  97. /**
  98. * set {@link ActivationSpec}.
  99. *
  100. * @param activationSpec {@link ActivationSpec} to set.
  101. * @return {@link JCAInflowDeploymentMetaData} to support method chaining
  102. */
  103. public JCAInflowDeploymentMetaData setActivationSpec(ActivationSpec activationSpec) {
  104. this._activationSpec = activationSpec;
  105. return this;
  106. }
  107. /**
  108. * get application class loader.
  109. *
  110. * @return application class loader
  111. */
  112. public ClassLoader getApplicationClassLoader() {
  113. return _applicationClassLoader;
  114. }
  115. /**
  116. * set application class loader.
  117. *
  118. * @param applicationClassLoader {@link ClassLoader} to set
  119. * @return {@link JCAInflowDeploymentMetaData} to support method chaining
  120. */
  121. public JCAInflowDeploymentMetaData setApplicationClassLoader(ClassLoader applicationClassLoader) {
  122. this._applicationClassLoader = applicationClassLoader;
  123. return this;
  124. }
  125. /**
  126. * get {@link TransactionManager}.
  127. *
  128. * @return {@link TransactionManager}
  129. */
  130. public TransactionManager getTransactionManager() {
  131. return _transactionManager;
  132. }
  133. /**
  134. * set {@link TransactionManager}.
  135. *
  136. * @param transactionManager {@link TransactionManager} to set
  137. * @return {@link JCAInflowDeploymentMetaData} to support method chaining
  138. */
  139. public JCAInflowDeploymentMetaData setTransactionManager(TransactionManager transactionManager) {
  140. this._transactionManager = transactionManager;
  141. return this;
  142. }
  143. /**
  144. * get is delivery transacted.
  145. *
  146. * @return true if transacted
  147. */
  148. public boolean isDeliveryTransacted() {
  149. return _transacted;
  150. }
  151. /**
  152. * set delivery transacted.
  153. *
  154. * @param transacted true if transacted
  155. * @return {@link JCAInflowDeploymentMetaData} to support method chaining
  156. */
  157. public JCAInflowDeploymentMetaData setDeliveryTransacted(boolean transacted) {
  158. _transacted = transacted;
  159. return this;
  160. }
  161. /**
  162. * get if bacth commit is enabled.
  163. * @return true if bactch commit is enabled
  164. */
  165. public boolean useBatchCommit() {
  166. return _useBatchCommit;
  167. }
  168. /**
  169. * set if batch commit is enabled.
  170. * @param useBatchCommit true if batch commit should be enabled
  171. */
  172. public void setUseBatchCommit(boolean useBatchCommit) {
  173. this._useBatchCommit = useBatchCommit;
  174. }
  175. /**
  176. * get batch size.
  177. * @return batch size
  178. */
  179. public int getBatchSize() {
  180. return _batchSize;
  181. }
  182. /**
  183. * set batch size.
  184. * @param batchSize batch size
  185. */
  186. public void setBatchSize(int batchSize) {
  187. this._batchSize = batchSize;
  188. }
  189. /**
  190. * get batch timeout.
  191. * @return batch timeout in milliseconds
  192. */
  193. public long getBatchTimeout() {
  194. return _batchTimeout;
  195. }
  196. /**
  197. * set batch timeout.
  198. * @param batchTimeout batch timeout in milliseconds
  199. */
  200. public void setBatchTimeout(long batchTimeout) {
  201. this._batchTimeout = batchTimeout;
  202. }
  203. }