Methods Summary |
---|
public void | enqueue(boolean register, java.util.List candidates)
for( final ObjectName objectName : candidates )
{
enqueue( register, objectName );
}
|
public void | enqueue(boolean register, javax.management.ObjectName theObject)
//debug( "ENQUEUE: " + (register? "register" : "unregister") + " : " + JMXUtil.toString(theObject) );
try
{
mQueue.put( new QueueItem( theObject, register ) );
}
catch( InterruptedException e )
{
mQuit = true;
}
|
private final java.util.logging.Logger | getLogger()
return( mLogger );
|
public boolean | isQueueEmpty()
return mQueue.size() == 0;
|
protected boolean | mySleep(long millis)
boolean interrupted = false;
try
{
Thread.sleep( millis );
}
catch( InterruptedException e )
{
Thread.interrupted();
interrupted = true;
}
return interrupted;
|
private void | process()
while ( ! mQuit )
{
mInProgress = mQueue.take();
if ( mInProgress == null )
{
mQuit = true; // a null item signals that we should quit
}
//debug( "PROCESS: " + (item.mRegister? "register" : "unregister") + " : " + JMXUtil.toString(item.mObjectName) );
if ( mInProgress.mRegister )
{
processRegistration( mInProgress.mObjectName );
}
else
{
processUnregistration( mInProgress.mObjectName );
}
mInProgress = null;
}
|
private void | processRegistration(javax.management.ObjectName objectName)
try
{
mRegHandler.handleMBeanRegistered( objectName );
getLogger().finer( "LoaderRegThread.processRegistration: processed mbean: " + objectName );
}
catch( Throwable t )
{
getLogger().warning( "LoaderRegThread.processRegistration: " +
"registration of MBean failed for: " +
objectName + " = " + t.toString() + ", " + t.getMessage() + "\n" +
ExceptionUtil.getStackTrace( t ) );
}
|
private void | processUnregistration(javax.management.ObjectName objectName)
try
{
mRegHandler.handleMBeanUnregistered( objectName );
}
catch( Throwable t )
{
getLogger().warning( "LoaderRegThread.processUnregistration: " +
"unregistration of MBean failed for: " +
objectName + " = " + t.toString() );
}
|
public void | quit()
mQuit = true;
synchronized( this )
{
this.notify();
}
|
public void | run()
mQuit = false;
while ( ! mQuit )
{
try
{
process();
}
catch( InterruptedException e )
{
mQuit = true;
}
}
|
private final void | trace(java.lang.Object o)
if ( mLogger != null )
{
mLogger.finer( o.toString() );
}
|
public void | waitAll()Wait for all outstanding requests to be finished.
A best-effort method; not a 100% guarantee, but that's also
true if something is queued right after the call!
while ( mQueue.size() != 0 || mInProgress != null )
{
mySleep( 100 );
}
|