directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r441331 - in /directory/trunks/mina/integration-jmx/src/main/java/org/apache/mina/integration/jmx: IoServiceManager.java IoServiceManagerMBean.java IoSessionManager.java IoSessionManagerMBean.java package.html
Date Fri, 08 Sep 2006 01:45:45 GMT
Author: trustin
Date: Thu Sep  7 18:45:44 2006
New Revision: 441331

URL: http://svn.apache.org/viewvc?view=rev&rev=441331
Log:
Added small documentation to integration-jmx


Added:
    directory/trunks/mina/integration-jmx/src/main/java/org/apache/mina/integration/jmx/package.html
Modified:
    directory/trunks/mina/integration-jmx/src/main/java/org/apache/mina/integration/jmx/IoServiceManager.java
  (contents, props changed)
    directory/trunks/mina/integration-jmx/src/main/java/org/apache/mina/integration/jmx/IoServiceManagerMBean.java
  (contents, props changed)
    directory/trunks/mina/integration-jmx/src/main/java/org/apache/mina/integration/jmx/IoSessionManager.java
  (contents, props changed)
    directory/trunks/mina/integration-jmx/src/main/java/org/apache/mina/integration/jmx/IoSessionManagerMBean.java
  (contents, props changed)

Modified: directory/trunks/mina/integration-jmx/src/main/java/org/apache/mina/integration/jmx/IoServiceManager.java
URL: http://svn.apache.org/viewvc/directory/trunks/mina/integration-jmx/src/main/java/org/apache/mina/integration/jmx/IoServiceManager.java?view=diff&rev=441331&r1=441330&r2=441331
==============================================================================
--- directory/trunks/mina/integration-jmx/src/main/java/org/apache/mina/integration/jmx/IoServiceManager.java
(original)
+++ directory/trunks/mina/integration-jmx/src/main/java/org/apache/mina/integration/jmx/IoServiceManager.java
Thu Sep  7 18:45:44 2006
@@ -23,10 +23,7 @@
 import java.net.SocketAddress;
 import java.util.Iterator;
 
-import org.apache.mina.common.IoHandler;
 import org.apache.mina.common.IoService;
-import org.apache.mina.common.IoServiceConfig;
-import org.apache.mina.common.IoServiceListener;
 import org.apache.mina.common.IoSession;
 import org.apache.mina.management.IoSessionStat;
 import org.apache.mina.management.StatCollector;
@@ -34,6 +31,7 @@
 
 /**
  * @author The Apache Directory Project (mina-dev@directory.apache.org)
+ * @version $Rev$, $Date$
  */
 public class IoServiceManager implements IoServiceManagerMBean
 {

Propchange: directory/trunks/mina/integration-jmx/src/main/java/org/apache/mina/integration/jmx/IoServiceManager.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Modified: directory/trunks/mina/integration-jmx/src/main/java/org/apache/mina/integration/jmx/IoServiceManagerMBean.java
URL: http://svn.apache.org/viewvc/directory/trunks/mina/integration-jmx/src/main/java/org/apache/mina/integration/jmx/IoServiceManagerMBean.java?view=diff&rev=441331&r1=441330&r2=441331
==============================================================================
--- directory/trunks/mina/integration-jmx/src/main/java/org/apache/mina/integration/jmx/IoServiceManagerMBean.java
(original)
+++ directory/trunks/mina/integration-jmx/src/main/java/org/apache/mina/integration/jmx/IoServiceManagerMBean.java
Thu Sep  7 18:45:44 2006
@@ -21,6 +21,7 @@
 
 /**
  * @author The Apache Directory Project (mina-dev@directory.apache.org)
+ * @version $Rev$, $Date$
  */
 public interface IoServiceManagerMBean
 {

Propchange: directory/trunks/mina/integration-jmx/src/main/java/org/apache/mina/integration/jmx/IoServiceManagerMBean.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Modified: directory/trunks/mina/integration-jmx/src/main/java/org/apache/mina/integration/jmx/IoSessionManager.java
URL: http://svn.apache.org/viewvc/directory/trunks/mina/integration-jmx/src/main/java/org/apache/mina/integration/jmx/IoSessionManager.java?view=diff&rev=441331&r1=441330&r2=441331
==============================================================================
--- directory/trunks/mina/integration-jmx/src/main/java/org/apache/mina/integration/jmx/IoSessionManager.java
(original)
+++ directory/trunks/mina/integration-jmx/src/main/java/org/apache/mina/integration/jmx/IoSessionManager.java
Thu Sep  7 18:45:44 2006
@@ -35,6 +35,7 @@
 
 /**
  * @author The Apache Directory Project (mina-dev@directory.apache.org)
+ * @version $Rev$, $Date$
  */
 public class IoSessionManager implements IoSessionManagerMBean
 {

Propchange: directory/trunks/mina/integration-jmx/src/main/java/org/apache/mina/integration/jmx/IoSessionManager.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Modified: directory/trunks/mina/integration-jmx/src/main/java/org/apache/mina/integration/jmx/IoSessionManagerMBean.java
URL: http://svn.apache.org/viewvc/directory/trunks/mina/integration-jmx/src/main/java/org/apache/mina/integration/jmx/IoSessionManagerMBean.java?view=diff&rev=441331&r1=441330&r2=441331
==============================================================================
--- directory/trunks/mina/integration-jmx/src/main/java/org/apache/mina/integration/jmx/IoSessionManagerMBean.java
(original)
+++ directory/trunks/mina/integration-jmx/src/main/java/org/apache/mina/integration/jmx/IoSessionManagerMBean.java
Thu Sep  7 18:45:44 2006
@@ -26,6 +26,7 @@
 /**
  * MBean interface for the session manager, it's used for instrumenting IoSession 
  * @author The Apache Directory Project (mina-dev@directory.apache.org)
+ * @version $Rev$, $Date$
  */
 public interface IoSessionManagerMBean
 {

Propchange: directory/trunks/mina/integration-jmx/src/main/java/org/apache/mina/integration/jmx/IoSessionManagerMBean.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Added: directory/trunks/mina/integration-jmx/src/main/java/org/apache/mina/integration/jmx/package.html
URL: http://svn.apache.org/viewvc/directory/trunks/mina/integration-jmx/src/main/java/org/apache/mina/integration/jmx/package.html?view=auto&rev=441331
==============================================================================
--- directory/trunks/mina/integration-jmx/src/main/java/org/apache/mina/integration/jmx/package.html
(added)
+++ directory/trunks/mina/integration-jmx/src/main/java/org/apache/mina/integration/jmx/package.html
Thu Sep  7 18:45:44 2006
@@ -0,0 +1,72 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+</head>
+<body>
+JMX (Java Management eXtension) integration
+
+<h2>Monitoring Your MINA Services and Sessions</h3>
+
+<h3>Monitoring an IoService</h3>
+<pre>
+acceptor = new SocketAcceptor();
+       
+try
+{
+    IoServiceManager iosm = new IoServiceManager(acceptor);
+    MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();  
+    ObjectName name = new ObjectName( "com.acme.test:type=IoServiceManager,name=MyMINAServer"
);
+    mbs.registerMBean( iosm, name );
+}
+catch( JMException e )
+{
+    logger.error( "JMX Exception: ", e );
+}
+</pre>
+
+<h3>Monitoring an IoSession</h3>
+
+Each session is registered to MBean server individually.
+
+<pre>
+acceptor.addListener( new IoServiceListener()
+{
+    public void serviceActivated( IoService service, SocketAddress serviceAddress, IoHandler
handler, IoServiceConfig config )
+    {
+    }
+
+    public void serviceDeactivated( IoService service, SocketAddress serviceAddress, IoHandler
handler, IoServiceConfig config )
+    {
+    }
+
+    public void sessionCreated( IoSession session )
+    {
+        try
+        {
+            IoSessionManager sessMgr = new IoSessionManager( session );
+            MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();  
+            ObjectName name = new ObjectName( "com.acme.test.session:type=IoSessionManager,name="
+ session.getRemoteAddress().toString().replace( ':', '/' ) );
+            mbs.registerMBean( sessMgr, name );
+        }
+        catch( JMException e )
+        {
+            logger.error( "JMX Exception: ", e );
+        }      
+    }
+
+    public void sessionDestroyed( IoSession session )
+    {
+        try
+        {
+            ObjectName name = new ObjectName( "com.acme.test.session:type=IoSessionManager,name="
+ session.getRemoteAddress().toString().replace( ':', '/' ) );
+            ManagementFactory.getPlatformMBeanServer().unregisterMBean( name );
+        }
+        catch( JMException e )
+        {
+            logger.error( "JMX Exception: ", e );
+        }      
+    }
+});
+</pre>
+</body>
+</html>



Mime
View raw message