1 28 29 30 package com.caucho.server.port; 31 32 import com.caucho.management.server.AbstractManagedObject; 33 import com.caucho.management.server.PortMXBean; 34 35 public class PortAdmin extends AbstractManagedObject 36 implements PortMXBean 37 { 38 private Port _port; 39 40 public PortAdmin(Port port) 41 { 42 _port = port; 43 } 44 45 public String getName() 46 { 47 String addr = _port.getAddress(); 48 49 if (addr == null) 50 addr = "INADDR_ANY"; 51 52 return addr + '-' + _port.getPort(); 53 } 54 55 public String getProtocolName() 56 { 57 return _port.getProtocolName(); 58 } 59 60 public String getAddress() 61 { 62 return _port.getAddress(); 63 } 64 65 public int getPort() 66 { 67 return _port.getPort(); 68 } 69 70 public int getConnectionMax() 71 { 72 return _port.getConnectionMax(); 73 } 74 75 public int getKeepaliveMax() 76 { 77 return _port.getKeepaliveMax(); 78 } 79 80 public long getKeepaliveTimeout() 81 { 82 return _port.getKeepaliveTimeout(); 83 } 84 85 public boolean isSSL() 86 { 87 return _port.isSSL(); 88 } 89 90 public long getSocketTimeout() 91 { 92 return _port.getSocketTimeout(); 93 } 94 95 public String getState() 96 { 97 return _port.getLifecycleState().getStateName(); 98 } 99 100 public int getThreadCount() 101 { 102 return _port.getThreadCount(); 103 } 104 105 public int getThreadActiveCount() 106 { 107 return _port.getActiveThreadCount(); 108 } 109 110 public int getThreadIdleCount() 111 { 112 return _port.getIdleThreadCount(); 113 } 114 115 public int getThreadKeepaliveCount() 116 { 117 return _port.getKeepaliveConnectionCount(); 118 } 119 120 public int getSelectKeepaliveCount() 121 { 122 return _port.getSelectConnectionCount(); 123 } 124 125 public long getRequestCountTotal() 126 { 127 return _port.getLifetimeRequestCount(); 128 } 129 130 public long getKeepaliveCountTotal() 131 { 132 return _port.getLifetimeKeepaliveCount(); 133 } 134 135 public long getClientDisconnectCountTotal() 136 { 137 return _port.getLifetimeClientDisconnectCount(); 138 } 139 140 public long getRequestTimeTotal() 141 { 142 return _port.getLifetimeRequestTime(); 143 } 144 145 public long getReadBytesTotal() 146 { 147 return _port.getLifetimeReadBytes(); 148 } 149 150 public long getWriteBytesTotal() 151 { 152 return _port.getLifetimeWriteBytes(); 153 } 154 155 void register() 156 { 157 registerSelf(); 158 } 159 160 public String toString() 161 { 162 return "PortAdmin[" + getObjectName() + "]"; 163 } 164 165 } 166 | Popular Tags |