1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one 3 * or more contributor license agreements. See the NOTICE file 4 * distributed with this work for additional information 5 * regarding copyright ownership. The ASF licenses this file 6 * to you under the Apache License, Version 2.0 (the 7 * "License"); you may not use this file except in compliance 8 * with the License. You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, 13 * software distributed under the License is distributed on an 14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 * KIND, either express or implied. See the License for the 16 * specific language governing permissions and limitations 17 * under the License. 18 * 19 */ 20 package org.apache.mina.integration.jmx; 21 22 import java.util.Date; 23 24 /** 25 * MBean interface for the session manager, it's used for instrumenting IoSession 26 * @author The Apache Directory Project (mina-dev@directory.apache.org) 27 * @version $Rev: 555855 $, $Date: 2007-07-13 12:19:00 +0900 (Fri, 13 Jul 2007) $ 28 */ 29 public interface IoSessionManagerMBean { 30 /** 31 * is the session is connected 32 * @return connection status 33 */ 34 public boolean isConnected(); 35 36 /** 37 * bytes read from the beginning 38 * @return total of bytes read 39 */ 40 public long getReadBytes(); 41 42 /** 43 * bytes written from the beginning 44 * @return total of bytes written 45 */ 46 public long getWrittenBytes(); 47 48 /** 49 * PDU decoded from the beginning. Only revelent if a ProtocolCodecFilter is installed. 50 * @return Number of read messages 51 */ 52 public long getReadMessages(); 53 54 /** 55 * PDU encoded from the beginning. Only revelent if a ProtocolCodecFilter is installed. 56 * @return Number of written messages 57 */ 58 public long getWrittenMessages(); 59 60 /** 61 * close the session 62 */ 63 public void close() throws InterruptedException; 64 65 /** 66 * when the session was created 67 * @return the date of session creation 68 */ 69 public Date getCreationTime(); 70 71 /** 72 * last time the session processed an IO 73 * @return date of last IO 74 */ 75 public Date getLastIoTime(); 76 77 /** 78 * last time the session processed a write 79 * @return date of last write 80 */ 81 public Date getLastWriteTime(); 82 83 /** 84 * last time the session processed an read 85 * @return date of last read 86 */ 87 public Date getLastReadTime(); 88 89 /** 90 * get the list of filters installed in the filter chain 91 * @return array of filter names 92 */ 93 public String[] getInstalledFilters(); 94 95 /** 96 * add a logging filter at end of the chain 97 */ 98 public void addLastLoggingFilter(); 99 100 /** 101 * remove the logging filter at end of the chain 102 */ 103 public void removeLastLoggingFilter(); 104 105 /** 106 * add a logging filter at begining of the chain 107 */ 108 public void addFirstLoggingFilter(); 109 110 /** 111 * remove the logging filter at begining of the chain 112 */ 113 public void removeFirstLoggingFilter(); 114 115 /** 116 * read and write IDLE time 117 * @return idle time in milli-seconds 118 */ 119 public long getBothIdleTime(); 120 121 /** 122 * read IDLE time 123 * @return read idle time in milli-seconds 124 */ 125 public long getReadIdleTime(); 126 127 /** 128 * write IDLE time 129 * @return write idle time in milli-seconds 130 */ 131 public long getWriteIdleTime(); 132 133 /** 134 * get the read bytes per second throughput 135 * works only if a stat collector is inspecting this session, 136 * @return read bytes per seconds 137 */ 138 public float getByteReadThroughtput(); 139 140 /** 141 * get the written bytes per second throughput 142 * works only if a stat collector is inspecting this session, 143 * @return written bytes per seconds 144 */ 145 public float getByteWrittenThroughtput(); 146 147 /** 148 * get the read messages per second throughput 149 * works only if a stat collector is inspecting this session, and only if a ProtocolDecoderFilter is used 150 * @return read messages per seconds 151 */ 152 public float getMessageReadThroughtput(); 153 154 /** 155 * get the written messages per second throughput 156 * works only if a stat collector is inspecting this session, and only if a ProtocolDecoderFilter is used 157 * @return written messages per seconds 158 */ 159 public float getMessageWrittenThroughtput(); 160 161 }