|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Monitor | Line # 31 | 0 | - | 0 | 0 | - |
-1.0
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| No Tests | |||
| 1 | /* | |
| 2 | * Copyright 2009 Ben Gidley | |
| 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 | * | |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 | |
| 9 | * | |
| 10 | * Unless required by applicable law or agreed to in writing, software | |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 13 | * See the License for the specific language governing permissions and | |
| 14 | * limitations under the License. | |
| 15 | */ | |
| 16 | ||
| 17 | package uk.co.gidley.jmxmonitor.monitoring; | |
| 18 | ||
| 19 | import javax.management.MBeanServerConnection; | |
| 20 | import javax.management.ObjectName; | |
| 21 | ||
| 22 | /** | |
| 23 | * A monitor retrieves data from a remote source | |
| 24 | * <p/> | |
| 25 | * Monitors are initialised by their monitoring group. On initialisation they are passed details of what to monitor and | |
| 26 | * the mbeanconnection. | |
| 27 | * <p/> | |
| 28 | * Monitors don't need to recover from failed connections. They should throw a reading failed exception. Once this has | |
| 29 | * occurred the controlling process will not run that monitor again. It will disgard it and initialise a replacement. | |
| 30 | */ | |
| 31 | public interface Monitor { | |
| 32 | ||
| 33 | /** | |
| 34 | * The name of the monitor This is defined in the scope of the monitor group | |
| 35 | * @return | |
| 36 | */ | |
| 37 | public String getName(); | |
| 38 | ||
| 39 | /** | |
| 40 | * The reading is typically a base type or a String. Other items can be used but you need to be sure EL can handle | |
| 41 | * them | |
| 42 | * | |
| 43 | * @return | |
| 44 | */ | |
| 45 | public Object getReading() throws ReadingFailedException; | |
| 46 | } | |
|
||||||||||||