<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=iso-8859-1">
<TITLE></TITLE>
<META NAME="GENERATOR" CONTENT="StarOffice 8 (Solaris x86)">
<META NAME="AUTHOR" CONTENT="Yamini">
<META NAME="CREATED" CONTENT="20071113;10510400">
<META NAME="CHANGEDBY" CONTENT="Yamini">
<META NAME="CHANGED" CONTENT="20071217;14301600">
<STYLE TYPE="text/css">
<!--
H2.western

Unknown macro: { font-family}

H2.cjk

Unknown macro: { font-family}

H2.ctl

Unknown macro: { font-family}

-->
</STYLE>
</HEAD>
<BODY LANG="en-US" DIR="LTR">
<H1 ALIGN=CENTER>Design Proposal for Extending GlassFish AMX</H1>
<P ALIGN=CENTER><BR><BR>
</P>
<H2 CLASS="western">Introduction</H2>
<P>This document describes a proposal for extending the existing AMX
support in GlassFish. The need for this is driven by the SailFin
requirement to provide AMX support for the new SailFin Mbeans.</P>
<P>In the current AMX support code, it is not possible to plug-in
external Mbeans. By external, we mean Mbeans developed outside of
GlassFish to support any new domain configuration elements. The new
AMX Mbeans should be loaded automatically during the runtime. So our
aim is to provide runtime pluggability for the newly added AMX
Mbeans. At the same time, AMX extension should be done such that it
should not affect the loading of regular GlassFish AMX Mbeans.</P>
<P>When SailFin is installed on top of GlassFish, it should load the
new SailFin AMX Mbeans as well.</P>
<P>We would like to target this feature for GlassFish 9.1.1</P>
<H2 CLASS="western">AMX Extension</H2>
<P>We can enable extended AMX support by using a system property
“<I>com.sun.appserv.pluggable.extensions.amx</I>” This
property will basically point to an implementation class exposing
methods to pass all the required information to AMX support. The
following interface
<I>com.sun.appserv.management.ext.support.ExtendedAMX</I> can be
exposed from AMX:</P>
<P><BR><BR>
</P>
<P><BR><BR>
</P>
<P><BR><BR>
</P>
<P><IMG SRC="http://wiki.glassfish.java.net/attach/Amx_extension.html/ExtendedAMX.jpg" NAME="graphics1" ALIGN=LEFT WIDTH=705 HEIGHT=635 BORDER=0><BR CLEAR=LEFT><BR><BR>
</P>
<P><I>package com.sun.appserv.management.ext.support; </I>
</P>
<P><I>import java.util.HashMap; </I>
</P>
<P><I>import java.util.Map; </I>
</P>
<P><I>/** </I>
</P>
<P><I>* Base interface implemented by external modules. </I>
</P>
<P><I>* All the extended AMX Support Features can be added here. </I>
</P>
<P><I>* This interface is <b>not</b> for public
consumption. </I>
</P>
<P><I>* </I>
</P>
<P><I>* @author: Yamini K B </I>
</P>
<P><I>*/ </I>
</P>
<P><I>public interface ExtendedAMX

Unknown macro: { </I></P><P><I>/** </I></P><P><I>* Get all external AMX interfaces. </I></P><P><I>* </I></P><P><I>* @return Class[] containing the interfaces. </I></P><P><I>*/ </I></P><P><I>public Class[] getExternalMbeanInterfaces(); </I></P><P><I>/** </I></P><P><I>* Get all the new config types. </I></P><P><I>* </I></P><P><I>* @return String[] containing the new config types. </I></P><P><I>*/ </I></P><P><I>public String[] getAllConfigTypes(); </I></P><P><I>/** </I></P><P><I>* Get the child types for a config type. </I></P><P><I>* </I></P><P><I>* @return Object[] containing all the child types. </I></P><P><I>*/ </I></P><P><I>public Object[] getAllChildTypes(); </I></P><P><I>/** </I></P><P><I>* Get all misc child types for a config type. </I></P><P><I>* </I></P><P><I>* @return String[)(] containing all the misc child types. </I></P><P><I>*/ </I></P><P><I>public String[)(] getAllMiscChildTypes(); </I></P><P><I>/** </I></P><P><I>* Get the old config types. </I></P><P><I>* </I></P><P><I>* @return Map containing the old config types. </I></P><P><I>*/ </I></P><P><I>public Map<String,String> getOldConfigTypes(); </I></P><P><I>/** </I></P><P><I>* Get the interface implementation classes </I></P><P><I>* </I></P><P><I>* @return Map conating the interface implementations. </I></P><P><I>*/ </I></P><P><I>public Map<String,String> getInterfaceImpls(); </I></P><P><I>/** </I></P><P><I>* Get the old monitor types. </I></P><P><I>* </I></P><P><I>* @return Map containing the old monitor types. </I></P><P><I>*/ </I></P><P><I>public Map<String,String> getOldMonitorTypes(); </I></P><P><I>/** </I></P><P><I>* Get all the new monitor types. </I></P><P><I>* </I></P><P><I>* @return String[] containing the new monitor types. </I></P><P><I>*/ </I></P><P><I>public String[] getAllServerRootMonitorTypes(); </I></P><P><I>/** </I></P><P><I>* Get the child types for a monitor type. </I></P><P><I>* </I></P><P><I>* @return Object[] containing all the monitor child types. </I></P><P><I>*/ </I></P><P><I>public Object[] getAllMonitorChildTypes(); </I></P><P><I>}

</I>
</P>
<H2 CLASS="western">getExternalMbeanInterfaces()</H2>
<P>Can return an array of the new AMX interfaces (like
SIPServiceConfig.class, SIPListenerConfig.class and so on..) This
will be consumed by <I>TypesMapper</I> during the initialization to
provide a mapping for the new types defined in <I>SIPXTypes</I>.</P>
<H2 CLASS="western">getAllConfigTypes(), getAllChildTypes()</H2>
<P>These methods can be used to define the containment. For example,
<SPAN STYLE="text-decoration: none"><I>SIPServiceConfig</I></SPAN>
needs to be within <I>ConfigConfig. </I><SPAN STYLE="font-style: normal">Likewise,
</SPAN><I>SIPListenerConfig</I> <SPAN STYLE="font-style: normal">is
child of </SPAN><I>SIPServiceConfig</I></P>
<P><I>getAllConfigTypes()</I> can return an array of all new child
types for <I>ConfigConfig </I><SPAN STYLE="font-style: normal">type.
</SPAN><I>getAllChildTypes()</I> <SPAN STYLE="font-style: normal">can
be used to define the new child types (i.e the containing objects)
for a specific container type. </SPAN><I>TypeInfos</I> <SPAN STYLE="font-style: normal">will
use the data provided from these two methods to define the
containment hierarchy for the new data types.</SPAN></P>
<H2 CLASS="western">getOldConfigTypes()</H2>
<P>Provide a mapping between the new J2EE types and the “old”
config types. For example, the new J2EE type X-SIPServiceConfig
should map to the 'sip-service' configuration.</P>
<H2 CLASS="western">getAllServerRootMonitorTypes(),
getAllMonitorChildTypes()</H2>
<P>These methods can be used to define the containment for the
monitoring Mbeans. For example, <I>SIPServiceMonitor</I> needs to be
within <I>ServerRootMonitorChild</I>.</P>
<P><I>getAllMonitorChildTypes()</I> can be used to define the new
monitor child types</P>
<H2 CLASS="western">getOldMonitorTypes()</H2>
<P>To provide a mapping between the new J2EE types and the “old”
monitor types. For example, the new J2EE type X-SIPServiceMonitor
should map to the monitoring service 'sip-service' configuration.</P>
<H2 CLASS="western">getInterfaceImpls()</H2>
<P>Currently the package info for the interface and implementation is
predefined. This method can be used to provide a mapping for the new
AMX interfaces and the actual implementation classes for
configuration and monitoring Mbeans.</P>
<H2 CLASS="western">How will ExtendedAMX be used?</H2>
<P><I>ExtendedAMX</I> will be used in following places to plug-in the
external (SailFin in this case) Mbean information.</P>
<OL>
<LI><P>We have a <I>TypesMapper</I> which maps the <I>XTypes</I>
with their Mbean interfaces. The <I>TypesMapper</I> can obtain the
list of new SailFin Mbean interfaces during the initialization using
<I>getExternalMbeanInterfaces().</I></P>
<LI><P>The <I>TypeInfo</I> class provides a mapping of the interface
and the actual implementation class. This information is passed
using <I>getInterfaceImpls()</I></P>
<LI><P><SPAN STYLE="font-style: normal">The </SPAN><I>TypeInfos
</I><SPAN STYLE="font-style: normal">class defines the containment
hierarchy for the configuration or monitoring types. Using
</SPAN><I>ExtendedAMX</I><SPAN STYLE="font-style: normal">, the
container/containee information can be passed to </SPAN><I>TypeInfos</I>
<SPAN STYLE="font-style: normal">for the SailFin configuration and
monitoring types.</SPAN></P>
<LI><P STYLE="font-style: normal">The OldConfigTypes and
OldMonitorTypes loads the external mapping i.e for the SailFin
Xtypes.</P>
</OL>
<H2 CLASS="western">Alternate AMX Extension</H2>
<P>Instead of using system property, the new interface can be exposed
by using Pluggable Feature Factory of GlassFish. This pluggable
feature interface will be similar to <I>ExtendedAMX</I> interface
except that the feature will be loaded automatically during runtime
without introducing yet another JVM option!</P>
<H2 CLASS="western">Packaging of SailFin AMX</H2>
<TABLE WIDTH=988 BORDER=1 BORDERCOLOR="#000000" CELLPADDING=4 CELLSPACING=0>
<COL WIDTH=446>
<COL WIDTH=212>
<COL WIDTH=305>
<TR VALIGN=TOP>
<TD WIDTH=446 BGCOLOR="#b3b3b3">
<P>Prefix</P>
</TD>
<TD WIDTH=212 BGCOLOR="#b3b3b3">
<P>SailFin module</P>
</TD>
<TD WIDTH=305 BGCOLOR="#b3b3b3">
<P>Comments</P>
</TD>
</TR>
<TR VALIGN=TOP>
<TD WIDTH=446>
<P>org.jvnet.glassfish.comms.management.config</P>
</TD>
<TD WIDTH=212>
<P>administration</P>
</TD>
<TD WIDTH=305>
<P>Config public interfaces</P>
</TD>
</TR>
<TR VALIGN=TOP>
<TD WIDTH=446>
<P>org.jvnet.glassfish.comms.management.monitor</P>
</TD>
<TD WIDTH=212>
<P>administration</P>
</TD>
<TD WIDTH=305>
<P>Monitor public interfaces</P>
</TD>
</TR>
<TR VALIGN=TOP>
<TD WIDTH=446>
<P>org.jvnet.glassfish.comms.admin.management.extensions.config</P>
</TD>
<TD WIDTH=212>
<P>administration</P>
</TD>
<TD WIDTH=305>
<P>Config implementation classes</P>
</TD>
</TR>
<TR VALIGN=TOP>
<TD WIDTH=446>
<P>org.jvnet.glassfish.comms.admin.management.extensions.monitor</P>
</TD>
<TD WIDTH=212>
<P>administration</P>
</TD>
<TD WIDTH=305>
<P>Monitor implementation classes</P>
</TD>
</TR>
</TABLE>
<P><BR><BR>
</P>
</BODY>
</HTML>



ExtendedAMX6.jpg (image/pjpeg)