Methods Summary |
---|
public synchronized void | addNotificationListener(javax.management.NotificationListener listener)
getNotificationEmitter().addNotificationListener( listener, null, null );
|
public synchronized void | addNotificationListener(javax.management.NotificationListener listener, javax.management.NotificationFilter filter, java.lang.Object handback)
getNotificationEmitter().addNotificationListener( listener, filter, handback );
|
protected com.sun.appserv.management.util.jmx.NotificationBuilder | createNotificationBuilder(java.lang.String notificationType)
NotificationBuilder builder = null;
if ( notificationType.equals( AttributeChangeNotification.ATTRIBUTE_CHANGE ) )
{
builder = new AttributeChangeNotificationBuilder( getObjectName() );
}
else
{
builder = new NotificationBuilder( notificationType, getObjectName() );
}
return( builder );
|
protected final void | debug(java.lang.Object o)
if ( getAMXDebug() && mDebug != null)
{
final String newline = System.getProperty( "line.separator" );
if ( shouldOmitObjectNameForDebug() )
{
mDebug.println( o );
}
else
{
mDebug.println( mSelfObjectName.toString() );
mDebug.println( "===> " + o );
}
mDebug.println( newline );
}
|
protected void | debug(java.lang.Object args)
if ( getAMXDebug() )
{
debug( StringUtil.toString( "", args) );
}
|
protected void | debugMethod(java.lang.String methodName, java.lang.Object args)
if ( getAMXDebug() )
{
debug( AMXDebug.methodString( methodName, args ) );
}
|
protected void | debugMethod(java.lang.String msg, java.lang.String methodName, java.lang.Object args)
if ( getAMXDebug() )
{
debug( AMXDebug.methodString( methodName, args ) + ": " + msg );
}
|
public boolean | enableAMXDebug(boolean enabled)
final boolean formerValue = getAMXDebug();
if ( formerValue != enabled )
{
setAMXDebug( enabled );
}
return formerValue;
|
public final boolean | getAMXDebug()Although unusual, a subclass may override the debug state.
Generally it is faster to NOT call getAMXDebug() before calling
debug( x ) if 'x' is just a string. If it is expensive to
construct 'x', then preflighting with getAMXDebug() may
be worthwhile.
return AMXDebug.getInstance().getDebug( getDebugID() );
|
protected java.lang.String | getDebugID()
return this.getClass().getName();
|
protected com.sun.appserv.management.util.misc.Output | getDebugOutput()
return AMXDebug.getInstance().getOutput( getDebugID() );
|
public java.lang.String | getJMXDomain()
return( getObjectName().getDomain() );
|
public final int | getListenerCount()
return( getNotificationEmitter().getListenerCount() );
|
public final java.util.logging.Level | getMBeanLogLevel()
Logger logger = getMBeanLogger();
assert( logger != null );
Level level = logger.getLevel();
while ( level == null )
{
logger = logger.getParent();
level = logger.getLevel();
}
return( level );
|
protected final int | getMBeanLogLevelInt()
return( getMBeanLogLevel().intValue() );
|
protected final java.util.logging.Logger | getMBeanLogger()
return mLogger;
|
public final java.lang.String | getMBeanLoggerName()
return( getMBeanLogger().getName() );
|
public final javax.management.MBeanServer | getMBeanServer()
return( mServer );
|
protected synchronized com.sun.appserv.management.util.jmx.NotificationBuilder | getNotificationBuilder(java.lang.String notificationType)Get a NotificationBuilder for the specified type of Notification
whose source is this object.
if ( mNotificationBuilders == null )
{
mNotificationBuilders = new HashMap<String,NotificationBuilder>();
}
NotificationBuilder builder =
(NotificationBuilder)mNotificationBuilders.get( notificationType );
if ( builder == null )
{
builder = createNotificationBuilder( notificationType );
mNotificationBuilders.put( notificationType, builder );
}
return( builder );
|
protected final synchronized com.sun.appserv.management.util.jmx.NotificationEmitterSupport | getNotificationEmitter()
if ( mNotificationEmitter == null )
{
mNotificationEmitter = new NotificationEmitterSupport( true );
}
return( mNotificationEmitter );
|
public final int | getNotificationTypeListenerCount(java.lang.String type)
return( getNotificationEmitter().getNotificationTypeListenerCount( type ) );
|
public final javax.management.ObjectName | getObjectName()
return( mSelfObjectName );
|
protected final void | logFine(java.lang.Object o)
final String msg = toString( o );
debug( msg );
if ( getMBeanLogLevelInt() <= Level.FINE.intValue() )
{
getMBeanLogger().fine( msg );
}
|
protected final void | logFiner(java.lang.Object o)
final String msg = toString( o );
debug( msg );
if ( getMBeanLogLevelInt() <= Level.FINER.intValue() )
{
getMBeanLogger().finer( msg );
}
|
protected final void | logFinest(java.lang.Object o)
final String msg = toString( o );
debug( msg );
if ( getMBeanLogLevelInt() <= Level.FINEST.intValue() )
{
getMBeanLogger().finest( msg );
}
|
protected final void | logInfo(java.lang.Object o)
final String msg = toString( o );
debug( msg );
if ( getMBeanLogLevelInt() <= Level.INFO.intValue() )
{
getMBeanLogger().info( msg );
}
|
protected final void | logSevere(java.lang.Object o)
final String msg = toString( o );
debug( msg );
if ( getMBeanLogLevelInt() <= Level.SEVERE.intValue() )
{
getMBeanLogger().severe( msg );
}
|
protected final void | logWarning(java.lang.Object o)
final String msg = toString( o );
debug( msg );
if ( getMBeanLogLevelInt() <= Level.WARNING.intValue() )
{
getMBeanLogger().warning( msg );
}
|
public void | postDeregister()
getMBeanLogger().finest( "postDeregister: " + getObjectName() );
if ( mNotificationEmitter != null )
{
mNotificationEmitter.cleanup();
mNotificationEmitter = null;
}
if ( mNotificationBuilders != null )
{
mNotificationBuilders.clear();
mNotificationBuilders = null;
}
mServer = null;
mSelfObjectName = null;
|
public void | postRegister(java.lang.Boolean registrationDone)
if ( registrationDone.booleanValue() )
{
getMBeanLogger().finest( "postRegister: " + getObjectName());
}
else
{
getMBeanLogger().finest( "postRegister: FAILURE: " + getObjectName());
}
|
public void | preDeregister()
getMBeanLogger().finest( "preDeregister: " + getObjectName() );
|
public javax.management.ObjectName | preRegister(javax.management.MBeanServer server, javax.management.ObjectName nameIn)
assert( nameIn != null );
mServer = server;
mSelfObjectName = nameIn;
// ObjectName could still be modified by subclass
return( mSelfObjectName );
|
protected static java.lang.String | quote(java.lang.Object o)
return( StringUtil.quote( "" + o ) );
|
public synchronized void | removeNotificationListener(javax.management.NotificationListener listener)
getNotificationEmitter().removeNotificationListener( listener );
|
public synchronized void | removeNotificationListener(javax.management.NotificationListener listener, javax.management.NotificationFilter filter, java.lang.Object handback)
getNotificationEmitter().removeNotificationListener( listener, filter, handback );
|
protected void | sendNotification(java.lang.String notificationType)Send a Notification of the specified type containing no data.
sendNotification( notificationType, notificationType, null, null );
|
protected void | sendNotification(java.lang.String notificationType, java.lang.String key, java.io.Serializable value)Send a Notification of the specified type containing a single
key/value pair for data.
final String message = "no message specified";
sendNotification( notificationType, message, key, value );
|
protected void | sendNotification(java.lang.String notificationType, java.lang.String message, java.lang.String key, java.io.Serializable value)Send a Notification of the specified type containing a single
key/value pair for data.
final NotificationBuilder builder =
getNotificationBuilder( notificationType );
final Notification notif = builder.buildNew( message );
NotificationBuilder.putMapData( notif, key, value );
sendNotification( notif );
|
public void | sendNotification(javax.management.Notification notification)
getNotificationEmitter().sendNotification( notification );
|
public final void | setAMXDebug(boolean debug)
AMXDebug.getInstance().setDebug( getDebugID(), debug);
|
public final void | setMBeanLogLevel(java.util.logging.Level level)
getMBeanLogger().setLevel( level );
|
public final void | setMBeanLogLevelString(java.lang.String levelString)
Level level = null;
for( int i = 0; i < LOG_LEVELS.length; ++i )
{
if ( levelString.equals( LOG_LEVELS[ i ].getName() ) )
{
level = LOG_LEVELS[ i ];
break;
}
}
if ( level == null )
{
throw new IllegalArgumentException( levelString );
}
setMBeanLogLevel( level );
|
protected boolean | shouldOmitObjectNameForDebug()
return mSelfObjectName == null;
|
protected boolean | sleepMillis(long millis)
boolean interrupted = false;
try
{
Thread.sleep( millis );
}
catch( InterruptedException e )
{
Thread.interrupted();
interrupted = true;
}
return interrupted;
|
protected static java.lang.String | toString(java.lang.Object o)
if ( o == null )
{
return( "" + o );
}
return( SmartStringifier.toString( o ) );
|
protected final void | trace(java.lang.Object o)
debug( o );
|