Convention |
Discussion |
Suffixes Config, Monitor, Mgr |
|
getAbcMap getAbcObjectNameMap |
This is a special idiom.
MBean implementations can only return ObjectName; they cannot return
dynamic proxies that will work correctly. So the client side
dynamic proxy code looks for the special suffix "ObjectNameMap".
When found, it assumes that the Map values (not keys) are all
ObjectName and instantiates dynamic proxies for each of them. The
actual Map the client receives is a new map keyed by the same keys, but
with values that are dynamic proxy implementations of the appropriate
AMX interface for the particular ObjectName. |
acronyms |
All acronyms must be upper-case. This
includes class names and method names. |
utility routines |
Do not add utility routines to
MBeans. In almost all cases they are more suitably implemented in a
class within the
com.sun.appserv.management.helper package. If in doubt, ask first. |
data types |
No proprietary data
types are to
be used in any AMX interface. When a complex object is needed, the AMX convention is to use java.util.Map in most cases, or javax.management.openmbeans.CompositeData in certain cases. The only legal data types that may be used are those found in:
|
method names |
Do not use method names that are
so obtuse they require javadoc to explain. Choose them very
carefully; they are semi-permanent. |
incompatible changes |
By default, no incompatible
changes are allowed. Such changes may only occur at a major
release, and require approval by the AMX team and notification to
customers. |
javadoc |
All methods and constants must
be javadoc'd. |
values
of constants |
Values of constants in AMX are
always camel case eg: public static final String WEIGHTED_ROUND_ROBIN = "WeightedRoundRobin". |
Convention |
Discussion |
method signatures and primitive types | Primitive types must always be
used eg char, int, long, not Character, Integer, Long.
The only time the Object form is acceptable is to indicate that the
parameter is optional and
therefore may be null. |
return types |
Return types should be
restricted to java.lang types whenever possible. When more
complex data is to be returned, a strongly-typed java.util.Map may be used eg Map<String,Integer>.
In certain cases the JMX javax.management.openmbeans.CompositeData
may be used. |
no proprietary types |
No
proprietary types should be used for method signatures or return
types. A client lacking the AMX client interfaces should
be able to fully access all operations and Attributes with no fear of
getting ClassNotFoundException,
or worrying about serialization versions. |