(ObjectName oname)
| 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 | /** |
no test coverage detected