MCPcopy Create free account
hub / github.com/apache/tomcat / getService

Method getService

java/org/apache/catalina/mbeans/MBeanFactory.java:167–190  ·  view source on GitHub ↗
(ObjectName oname)

Source from the content-addressed store, hash-verified

165
166
167 private Service getService(ObjectName oname) throws Exception {
168
169 if (container instanceof Service) {
170 // Don't bother checking the domain - this is the only option
171 return (Service) container;
172 }
173
174 StandardService service = null;
175 String domain = oname.getDomain();
176 if (container instanceof Server) {
177 Service[] services = ((Server) container).findServices();
178 for (Service value : services) {
179 service = (StandardService) value;
180 if (domain.equals(service.getObjectName().getDomain())) {
181 break;
182 }
183 }
184 }
185 if (service == null || !service.getObjectName().getDomain().equals(domain)) {
186 throw new Exception(sm.getString("mBeanFactory.noService", domain));
187 }
188 return service;
189
190 }
191
192
193 /**

Callers 9

createConnectorMethod · 0.95
createStandardContextMethod · 0.95
createStandardHostMethod · 0.95
removeConnectorMethod · 0.95
removeContextMethod · 0.95
removeHostMethod · 0.95
removeServiceMethod · 0.95

Calls 5

getDomainMethod · 0.65
findServicesMethod · 0.65
equalsMethod · 0.65
getObjectNameMethod · 0.65
getStringMethod · 0.65

Tested by

no test coverage detected