Methods Summary |
---|
private com.sun.appserv.management.deploy.DeploymentStatusImpl | deploy(DeployThreadParams params, DeploymentCallback callback)
int percent = 0;
while ( percent < 100 )
{
percent += 10;
final DeploymentProgress progress =
new DeploymentProgressImpl(
(byte)percent, "percent done", null);
callback.deploymentProgress( progress );
Thread.sleep( 1 );
}
final DeploymentStatusImpl deploymentStatus =
new DeploymentStatusImpl(
0,
"completed",
"description",
null );
return( deploymentStatus );
|
public com.sun.appserv.management.deploy.DeploymentProgress | getDeploymentProgress()
final byte progressPercent = 0;
final String description = "<no description>";
final DeploymentProgressImpl progress =
new DeploymentProgressImpl( progressPercent, description, null);
return( progress );
|
public com.sun.appserv.management.deploy.DeploymentStatus | getDeploymentStatus()
return( mDeploymentStatus );
|
public java.lang.Object | getID()
return( mDeployID );
|
public long | getMillisSinceDone()
return( isDone() ? (System.currentTimeMillis() - mDoneMillis) : 0 );
|
public boolean | getSuccess()
return( isDone() && mDeploymentStatus != null );
|
public java.lang.Throwable | getThrowable()Return any Throwabe that caused a failure
return( mThrowable );
|
public boolean | isDone()
return( mDone );
|
public void | queueNotification(javax.management.Notification notif)
if ( isDone() )
{
throw new IllegalArgumentException(
"Notification cannot be queued after being done for: " + mDeployID);
}
synchronized( mQueuedNotifications )
{
mQueuedNotifications.add( notif );
}
|
public boolean | quit()
mQuit = true;
this.interrupt();
while ( ! isDone() )
{
try
{
Thread.sleep( 200 );
}
catch( InterruptedException e )
{
}
}
return( true );
|
public void | run()
mThrowable = null;
mDone = false;
//trace( "DeployThread.run: starting: " + getID() );
try
{
if ( mParams == null )
{
throw new IllegalArgumentException( "no params specified" );
}
//trace( "DeployThread.run: calling deploy() for: " + getID() );
mDeploymentStatus = deploy( mParams, mDeploymentCallback );
//trace( "DeployThread.run: deploy() successful for: " + getID() );
}
catch( Throwable t )
{
mDeploymentStatus =
new DeploymentStatusImpl(
-1,
"failure",
"description",
null );
mThrowable = t;
mDeploymentStatus.setStageThrowable( t );
}
try
{
mDeploymentCallback.deploymentDone( mDeploymentStatus );
// success or failure, always kill the file
if ( mParams.getDeployFile() != null )
{
//trace( "DeployThread.run: deleting deploy file: " + mParams.getDeployFile() );
mParams.getDeployFile().delete();
}
// success or failure, always kill the file
if ( mParams.getPlanFile() != null )
{
//trace( "DeployThread.run: deleting plan file: " + mParams.getPlanFile() );
mParams.getPlanFile().delete();
}
}
finally
{
mDoneMillis = System.currentTimeMillis();
mDone = true;
}
//trace( "DeployThread.run: done with: " + getID() );
|
public void | setParams(DeployThreadParams params)
if ( mParams != null )
{
throw new IllegalArgumentException();
}
mParams = params;
|
public javax.management.Notification[] | takeNotifications()
Notification[] notifs = null;
synchronized( mQueuedNotifications )
{
notifs = new Notification[ mQueuedNotifications.size() ];
mQueuedNotifications.toArray( notifs );
mQueuedNotifications.clear();
}
return( notifs );
|
private static void | trace(java.lang.Object o)
System.out.println( o.toString() );
|