001 /**
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements. See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License. You may obtain a copy of the License at
008 *
009 * http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017
018 package org.apache.camel.spring;
019
020 import javax.xml.bind.annotation.XmlAccessType;
021 import javax.xml.bind.annotation.XmlAccessorType;
022 import javax.xml.bind.annotation.XmlAttribute;
023 import javax.xml.bind.annotation.XmlRootElement;
024
025 import org.apache.camel.model.IdentifiedType;
026
027 /**
028 * The JAXB type class for the configuration of jmxAgent
029 *
030 * @version $Revision: 781314 $
031 */
032 @XmlRootElement(name = "jmxAgent")
033 @XmlAccessorType(XmlAccessType.FIELD)
034 public class CamelJMXAgentDefinition extends IdentifiedType {
035
036 /**
037 * Disable JMI (default false)
038 */
039 @XmlAttribute(required = false)
040 private Boolean disabled = Boolean.FALSE;
041
042 /**
043 * Only register processor if a custom id was defined for it.
044 */
045 @XmlAttribute(required = false)
046 private Boolean onlyRegisterProcessorWithCustomId = Boolean.FALSE;
047
048 /**
049 * RMI connector registry port (default 1099)
050 */
051 @XmlAttribute(required = false)
052 private Integer registryPort;
053
054 /**
055 * RMI connector server port (default -1 not used)
056 */
057 @XmlAttribute(required = false)
058 private Integer connectorPort;
059
060 /**
061 * MBean server default domain name (default org.apache.camel)
062 */
063 @XmlAttribute(required = false)
064 private String mbeanServerDefaultDomain;
065
066 /**
067 * MBean object domain name (default org.apache.camel)
068 */
069 @XmlAttribute(required = false)
070 private String mbeanObjectDomainName;
071
072 /**
073 * JMX Service URL path (default /jmxrmi)
074 */
075 @XmlAttribute(required = false)
076 private String serviceUrlPath;
077
078 /**
079 * A flag that indicates whether the agent should be created
080 */
081 @XmlAttribute(required = false)
082 private Boolean createConnector = Boolean.TRUE;
083
084 /**
085 * A flag that indicates whether the platform mbean server should be used
086 */
087 @XmlAttribute(required = false)
088 private Boolean usePlatformMBeanServer = Boolean.TRUE;
089
090 public Integer getConnectorPort() {
091 return connectorPort;
092 }
093
094 public void setConnectorPort(Integer value) {
095 connectorPort = value;
096 }
097
098 public Integer getRegistryPort() {
099 return registryPort;
100 }
101
102 public void setRegistryPort(Integer value) {
103 registryPort = value;
104 }
105
106 public String getMbeanServerDefaultDomain() {
107 return mbeanServerDefaultDomain;
108 }
109
110 public void setMbeanServerDefaultDomain(String value) {
111 mbeanServerDefaultDomain = value;
112 }
113
114 public String getMbeanObjectDomainName() {
115 return mbeanObjectDomainName;
116 }
117
118 public void setMbeanObjectDomainName(String value) {
119 mbeanObjectDomainName = value;
120 }
121
122 public String getServiceUrlPath() {
123 return serviceUrlPath;
124 }
125
126 public void setServiceUrlPath(String value) {
127 serviceUrlPath = value;
128 }
129
130 public Boolean isCreateConnector() {
131 return createConnector;
132 }
133
134 public void setCreateConnector(Boolean value) {
135 createConnector = value != null ? value : Boolean.FALSE;
136 }
137
138 public Boolean isUsePlatformMBeanServer() {
139 return usePlatformMBeanServer;
140 }
141
142 public void setUsePlatformMBeanServer(Boolean value) {
143 usePlatformMBeanServer = value != null ? value : Boolean.FALSE;
144 }
145
146 public Boolean getOnlyRegisterProcessorWithCustomId() {
147 return onlyRegisterProcessorWithCustomId;
148 }
149
150 public void setOnlyRegisterProcessorWithCustomId(Boolean onlyRegisterProcessorWithCustomId) {
151 this.onlyRegisterProcessorWithCustomId = onlyRegisterProcessorWithCustomId;
152 }
153
154 public Boolean isDisabled() {
155 return disabled;
156 }
157
158 public void setDisabled(Boolean value) {
159 disabled = value != null ? value : Boolean.FALSE;
160 }
161
162 @Override
163 public String toString() {
164 StringBuilder sb = new StringBuilder();
165 sb.append("CamelJMXAgent[");
166 sb.append("usePlatformMBeanServer=").append(usePlatformMBeanServer);
167 if (createConnector != null) {
168 sb.append(", createConnector=").append(createConnector);
169 }
170 if (connectorPort != null) {
171 sb.append(", connectorPort=").append(connectorPort);
172 }
173 if (registryPort != null) {
174 sb.append(", registryPort=").append(registryPort);
175 }
176 if (serviceUrlPath != null) {
177 sb.append(", serviceUrlPath=").append(serviceUrlPath);
178 }
179 if (mbeanServerDefaultDomain != null) {
180 sb.append(", mbeanServerDefaultDomain=").append(mbeanServerDefaultDomain);
181 }
182 if (mbeanObjectDomainName != null) {
183 sb.append(", mbeanObjectDomainName=").append(mbeanObjectDomainName);
184 }
185 sb.append("]");
186 return sb.toString();
187 }
188
189 }