The Artima Developer Community
Sponsored Link

Agile Buzz Forum
Smalltalk Daily 06/23/10: Installing Custom Error Handling into a Runtime

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
Smalltalk Daily 06/23/10: Installing Custom Error Handling into a Runtime Posted: Jun 23, 2010 5:55 AM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: Smalltalk Daily 06/23/10: Installing Custom Error Handling into a Runtime
Feed Title: Cincom Smalltalk Blog - Smalltalk with Rants
Feed URL: http://www.cincomsmalltalk.com/rssBlog/rssBlogView.xml
Feed Description: James Robertson comments on Cincom Smalltalk, the Smalltalk development community, and IT trends and issues in general.
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Cincom Smalltalk Blog - Smalltalk with Rants

Advertisement

Today's Smalltalk Daily looks at adding error handling (for the runtime) via the build script. We're adding the basic stuff from RuntimePackager, but you can customize from there. The build script is just below; You can also just skip to the video


"build a simple app"

"load all my needed parcels - including RTP"
[#(   '$(VISUALWORKS)/packaging/RuntimePackager.pcl'
	'SampleApp.pcl') do: [:each |
        Parcel loadParcelFrom: each]]
	on: MissingParcelSource
	do: [:ex | ex resume: true].

"turn change log off, so that we can ship patches reasonably"
'ChangeSet.BroadcastChanges' asQualifiedReference 
	ifDefinedDo: [:flag | 
		'ChangeSet.BroadcastChanges' asQualifiedReference value: false].

"Set herald string"
ObjectMemory setHeraldString: 'This is an Example Application in VisualWorks'.

"reset parcel path"
Parcel searchPathModel value removeAll.

"set up runtime state"
DeploymentOptionsSystem current startInRuntime: true.

"set up runtime state  (NOTE: This block is commented out
so that we can see the results in the example.

UI.WindowManager noWindowBlock: [:windowManager | ].
stream := WriteStream on: String new.
stream nextPutAll: 'changeRequest'; cr; cr; tab.
stream nextPutAll: '^true'.
VisualLauncher compile: stream contents.
VisualLauncher allInstances do: 
	[:each | each closeAndUnschedule.  each release]."

"Install Error Handling - This is the new segment"
Notifier current: RuntimePackager.RuntimeEmergencyNotifier.
RuntimePackager.RuntimeEmergencyNotifier 
	imageDumperClass: RuntimePackager.RuntimeFullDumper.
RuntimePackager.RuntimeManager errorLogPath: 'error.log'.
Notifier logToFile: true.

ObjectMemory garbageCollect.
Workbook allInstances do: [:each | each closeRequest].
(Delay forSeconds: 20) wait.
Parcel searchPathModel value: (List with: (PortableFilename named: '.')).
SourceFileManager default discardSources.

"Now save the image such that this file does not get looked for at startup"
[ObjectMemory permSaveAs: 'sample' thenQuit: false] fork.
[(Delay forSeconds: 45) wait.
RuntimeSystem isRuntime ifFalse: [ObjectMemory quit]] fork


Click on the viewer below to watch it now:

If you have trouble viewing that directly, you can click here to download the video directly

You can also watch it on YouTube:

Technorati Tags: , , ,

Read: Smalltalk Daily 06/23/10: Installing Custom Error Handling into a Runtime

Topic: Industry Misinterpretations 193: Squeak Oversight Board, June 2010, part 2 (AAC) Previous Topic   Next Topic Topic: Don't Be Invisible!

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use