Permalink
Browse files

Merge branch 'shell-osgi' of github.com:etesla/tesla into shell-osgi

  • Loading branch information...
Jason van Zyl
Jason van Zyl committed Dec 19, 2011
2 parents 486fae1 + 09733be commit e36d16b6bf069e7cb6630ec6a1ea59b90e58eb1f
@@ -104,9 +104,9 @@ public Object addingService( final ServiceReference serviceReference )
}
catch ( Exception e )
{
- System.out.println( "Problem found during provisioning. See log for details." );
if ( Boolean.valueOf( (String) serviceReference.getProperty( "exit-on-error" ) ) )
{
+ System.setProperty( "provision-error", e.getMessage() );
try
{
bundleContext.getBundle( 0 ).stop();
@@ -91,7 +91,7 @@ public String create( final String coordinates )
}
catch ( Exception e )
{
- throw new RuntimeException( e );
+ throw new RuntimeException( e.getMessage(), e );
}
}
@@ -114,6 +114,13 @@ private void boot()
final FrameworkEvent event = framework.waitForStop( 0 );
if ( event.getType() != FrameworkEvent.STOPPED_UPDATE )
{
+ final String provisionError = System.getProperty( "provision-error" );
+ if ( provisionError != null )
+ {
+ System.out.println( "Problem found during provisioning. See log for details." );
+ System.out.println( provisionError );
+ removeChecksum( shellProperties );
+ }
break;
}
}
@@ -131,6 +138,13 @@ private void saveChecksum( final Properties shellProperties, final Properties bu
fileWrite( checksumFile, SHA1( properties ) );
}
+ private void removeChecksum( final Properties shellProperties )
+ throws Exception
+ {
+ final File checksumFile = new File( new File( shellProperties.getProperty( PROFILE ) ), "checksum" );
+ checksumFile.delete();
+ }
+
private boolean shouldForceReset( final Properties shellProperties, final Properties bundleProperties )
{
final File checksumFile = new File( new File( shellProperties.getProperty( PROFILE ) ), "checksum" );

0 comments on commit e36d16b

Please sign in to comment.