Top Description Inners Fields Constructors Methods
org.glassfish.grizzly.http.jmx

public Class KeepAlive

extends JmxObject
Class Inheritance
Annotations
@ManagedObject
@Description:The configuration for HTTP keep-alive connections.
Imports
java.io.IOException, java.util.concurrent.atomic.AtomicInteger, org.glassfish.grizzly.Closeable, .Connection, .GenericCloseListener, .CloseType, org.glassfish.grizzly.http.KeepAliveProbe, org.glassfish.grizzly.monitoring.jmx.JmxObject, org.glassfish.gmbal.Description, .GmbalMBean, .ManagedAttribute, .ManagedObject, org.glassfish.grizzly.jmxbase.GrizzlyJmxManager

JMX management object for org.glassfish.grizzly.http.KeepAlive.
Since
2.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private final KeepAlive
private final AtomicInteger
keepAliveConnectionsCount

The number of live keep-alive connections.

private final AtomicInteger
keepAliveHitsCount

The number of requests processed on a keep-alive connections.

private final KeepAlive.JMXKeepAliveProbe
keepAliveProbe

The JMXKeepAliveProbe used to track keep-alive statistics.

private final AtomicInteger
keepAliveRefusesCount

The number of times keep-alive mode was refused.

private final AtomicInteger
keepAliveTimeoutsCount

The number of times idle keep-alive connections were closed by timeout.

Constructor Summary

AccessConstructor and Description
public
KeepAlive(KeepAlive keepAlive)

Constructs a new JMX managed KeepAlive for the specified org.glassfish.grizzly.http.KeepAlive instance.

Method Summary

Modifier and TypeMethod and Description
public int
getConnectionsCount()

Returns: the number live keep-alive connections.

public int
getHitsCount()

Returns: the number of requests processed on a keep-alive connections.

public int
public String
public int
public int
getRefusesCount()

Returns: the number of times keep-alive mode was refused.

public int
getTimeoutsCount()

Returns: the number of times idle keep-alive connections were closed by timeout.

protected void
onDeregister(GrizzlyJmxManager mom)

Implements abstract org.glassfish.grizzly.monitoring.jmx.JmxObject.onDeregister.

Method will be called right after this JmxObject is unregistered by the JMX manager.

protected void
onRegister(GrizzlyJmxManager mom, GmbalMBean bean)

Implements abstract org.glassfish.grizzly.monitoring.jmx.JmxObject.onRegister.

Method will be called right after this JmxObject is registered by the JMX manager.

Field Detail

keepAliveback to summary
private final KeepAlive keepAlive

The org.glassfish.grizzly.http.KeepAlive being managed.

keepAliveConnectionsCountback to summary
private final AtomicInteger keepAliveConnectionsCount

The number of live keep-alive connections.

keepAliveHitsCountback to summary
private final AtomicInteger keepAliveHitsCount

The number of requests processed on a keep-alive connections.

keepAliveProbeback to summary
private final KeepAlive.JMXKeepAliveProbe keepAliveProbe

The JMXKeepAliveProbe used to track keep-alive statistics.

keepAliveRefusesCountback to summary
private final AtomicInteger keepAliveRefusesCount

The number of times keep-alive mode was refused.

keepAliveTimeoutsCountback to summary
private final AtomicInteger keepAliveTimeoutsCount

The number of times idle keep-alive connections were closed by timeout.

Constructor Detail

KeepAliveback to summary
public KeepAlive(KeepAlive keepAlive)

Constructs a new JMX managed KeepAlive for the specified org.glassfish.grizzly.http.KeepAlive instance.

Parameters
keepAlive:KeepAlive

the org.glassfish.grizzly.http.KeepAlive to manage.

Method Detail

getConnectionsCountback to summary
public int getConnectionsCount()
Returns:int

the number live keep-alive connections.

Annotations
@ManagedAttribute
id:live-connections-count
@Description:The number of live keep-alive connections
getHitsCountback to summary
public int getHitsCount()
Returns:int

the number of requests processed on a keep-alive connections.

Annotations
@ManagedAttribute
id:hits-count
@Description:The number of requests processed on a keep-alive connections.
getIdleTimeoutInSecondsback to summary
public int getIdleTimeoutInSeconds()
Annotations
@ManagedAttribute
id:idle-timeout-seconds
@Description:The time period keep-alive connection may stay idle
See Also
org.glassfish.grizzly.http.KeepAlive#getIdleTimeoutInSeconds()
getJmxNameback to summary
public String getJmxName()

Implements abstract org.glassfish.grizzly.monitoring.jmx.JmxObject.getJmxName.

Annotations
@Override
getMaxRequestsCountback to summary
public int getMaxRequestsCount()
Annotations
@ManagedAttribute
id:max-requests-count
@Description:the max number of HTTP requests allowed to be processed on one keep-alive connection
See Also
org.glassfish.grizzly.http.KeepAlive#getMaxRequestsCount()
getRefusesCountback to summary
public int getRefusesCount()
Returns:int

the number of times keep-alive mode was refused.

Annotations
@ManagedAttribute
id:refuses-count
@Description:The number of times keep-alive mode was refused.
getTimeoutsCountback to summary
public int getTimeoutsCount()
Returns:int

the number of times idle keep-alive connections were closed by timeout.

Annotations
@ManagedAttribute
id:timeouts-count
@Description:The number of times idle keep-alive connections were closed by timeout.
onDeregisterback to summary
protected void onDeregister(GrizzlyJmxManager mom)

Implements abstract org.glassfish.grizzly.monitoring.jmx.JmxObject.onDeregister.

Doc from org.glassfish.grizzly.monitoring.jmx.JmxObject.onDeregister.

Method will be called right after this JmxObject is unregistered by the JMX manager.

When invoked, this method will remove the KeepAliveProbe added by the onRegister(GrizzlyJmxManager, GmbalMBean) call.

Annotations
@Override
onRegisterback to summary
protected void onRegister(GrizzlyJmxManager mom, GmbalMBean bean)

Implements abstract org.glassfish.grizzly.monitoring.jmx.JmxObject.onRegister.

Doc from org.glassfish.grizzly.monitoring.jmx.JmxObject.onRegister.

Method will be called right after this JmxObject is registered by the JMX manager.

When invoked, this method will add a KeepAliveProbe to track statistics.

Annotations
@Override
org.glassfish.grizzly.http.jmx back to summary

private final Class KeepAlive.JMXKeepAliveProbe

extends Object
implements KeepAliveProbe
Class Inheritance
All Implemented Interfaces
org.glassfish.grizzly.http.KeepAliveProbe

JMX statistic gathering KeepAliveProbe.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
onConnectionAcceptEvent(Connection<L> connection)

Implements org.glassfish.grizzly.http.KeepAliveProbe.onConnectionAcceptEvent.

Method will be called, when new keep-alive HTTP connection is getting established.

public void
onHitEvent(Connection<L> connection, int requestCounter)

Implements org.glassfish.grizzly.http.KeepAliveProbe.onHitEvent.

Method will be called, when HTTP request comes on a kept alive connection.

public void
onRefuseEvent(Connection<L> connection)

Implements org.glassfish.grizzly.http.KeepAliveProbe.onRefuseEvent.

Method will be called, when the Connection could be used in the keep alive mode, but due to KeepAlive config limitations it will be closed.

public void
onTimeoutEvent(Connection<L> connection)

Implements org.glassfish.grizzly.http.KeepAliveProbe.onTimeoutEvent.

Method will be called, when the keep alive Connection idle timeout expired.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

JMXKeepAliveProbeback to summary
private JMXKeepAliveProbe()

Method Detail

onConnectionAcceptEventback to summary
public void onConnectionAcceptEvent(Connection<L> connection)

Implements org.glassfish.grizzly.http.KeepAliveProbe.onConnectionAcceptEvent.

Doc from org.glassfish.grizzly.http.KeepAliveProbe.onConnectionAcceptEvent.

Method will be called, when new keep-alive HTTP connection is getting established. This method is getting invoked, when 1st HTTP request processing completes, but the Connection will be kept alive to process next HTTP request.

Annotations
@Override
onHitEventback to summary
public void onHitEvent(Connection<L> connection, int requestCounter)

Implements org.glassfish.grizzly.http.KeepAliveProbe.onHitEvent.

Doc from org.glassfish.grizzly.http.KeepAliveProbe.onHitEvent.

Method will be called, when HTTP request comes on a kept alive connection.

Annotations
@Override
onRefuseEventback to summary
public void onRefuseEvent(Connection<L> connection)

Implements org.glassfish.grizzly.http.KeepAliveProbe.onRefuseEvent.

Doc from org.glassfish.grizzly.http.KeepAliveProbe.onRefuseEvent.

Method will be called, when the Connection could be used in the keep alive mode, but due to KeepAlive config limitations it will be closed.

Annotations
@Override
onTimeoutEventback to summary
public void onTimeoutEvent(Connection<L> connection)

Implements org.glassfish.grizzly.http.KeepAliveProbe.onTimeoutEvent.

Doc from org.glassfish.grizzly.http.KeepAliveProbe.onTimeoutEvent.

Method will be called, when the keep alive Connection idle timeout expired.

Annotations
@Override