4442 Answer true, if new classes have been installed for this package, |
4442 Answer true, if new classes have been installed for this package, |
4443 false if the package's classes have been already present." |
4443 false if the package's classes have been already present." |
4444 |
4444 |
4445 |newStuffHasBeenLoaded meOrMySecondIncarnation| |
4445 |newStuffHasBeenLoaded meOrMySecondIncarnation| |
4446 |
4446 |
4447 self projectIsLoaded ifTrue:[^ false]. |
4447 self projectIsLoaded ifTrue:[ |
|
4448 asAutoloaded ifFalse:[ |
|
4449 "/ to be considered !! |
|
4450 "/ self isFullyLoaded ifFalse:[ |
|
4451 "/ self hasAllExtensionsLoaded ifFalse:[ |
|
4452 "/ self loadExtensions. |
|
4453 "/ ]. |
|
4454 "/ self loadAllAutoloadedClasses |
|
4455 "/ ]. |
|
4456 ]. |
|
4457 ^ false |
|
4458 ]. |
4448 thisContext isRecursive ifTrue:[self breakPoint:#cg. ^ false]. "/ avoid endless loops |
4459 thisContext isRecursive ifTrue:[self breakPoint:#cg. ^ false]. "/ avoid endless loops |
4449 |
4460 |
4450 newStuffHasBeenLoaded := false. |
4461 newStuffHasBeenLoaded := false. |
4451 |
4462 |
4452 (self infoPrinting and:[Smalltalk silentLoading not]) ifTrue:[ |
4463 (self infoPrinting and:[Smalltalk silentLoading not]) ifTrue:[ |
4453 "/ thisContext fullPrintAll. |
4464 "/ thisContext fullPrintAll. |
4454 Transcript showCR:('loading %1%2...' |
4465 Transcript showCR:('loading %1%2...' |
4455 bindWith:(asAutoloaded ifTrue:['as autoloaded '] ifFalse:['']) |
4466 bindWith:(asAutoloaded ifTrue:['as autoloaded '] ifFalse:['']) |
4456 with:self name). |
4467 with:self name). |
4457 ]. |
4468 ]. |
4458 |
4469 |
4459 self rememberOverwrittenExtensionMethods. |
4470 self rememberOverwrittenExtensionMethods. |
4460 |
4471 |
4461 self activityNotification:'Executing pre-load action'. |
4472 self activityNotification:'Executing pre-load action'. |
4462 self preLoadAction. |
4473 self preLoadAction. |
4463 |
4474 |
4464 meOrMySecondIncarnation := self. |
4475 meOrMySecondIncarnation := self. |
4465 |
4476 |
4466 Class withoutUpdatingChangesDo:[ |
4477 Class withoutUpdatingChangesDo:[ |
4467 self activityNotification:'Loading prerequisities'. |
4478 self activityNotification:'Loading prerequisities'. |
4468 self loadPreRequisitesAsAutoloaded:asAutoloaded. |
4479 self loadPreRequisitesAsAutoloaded:asAutoloaded. |
4469 |
4480 |
4470 self checkPrerequisitesForLoading. |
4481 self checkPrerequisitesForLoading. |
4471 |
4482 |
4472 asAutoloaded ifFalse:[ |
4483 asAutoloaded ifFalse:[ |
4473 self loadClassLibrary. |
4484 self loadClassLibrary. |
4474 "/ could have overloaded my first incarnation |
4485 "/ could have overloaded my first incarnation |
4475 meOrMySecondIncarnation := (Smalltalk at:(self name)) ? self. |
4486 meOrMySecondIncarnation := (Smalltalk at:(self name)) ? self. |
4476 meOrMySecondIncarnation ~~ self ifTrue:[ |
4487 meOrMySecondIncarnation ~~ self ifTrue:[ |
4477 meOrMySecondIncarnation fetchSlotsFrom:self. |
4488 meOrMySecondIncarnation fetchSlotsFrom:self. |
4478 ]. |
4489 ]. |
4479 ]. |
4490 ]. |
4480 |
4491 |
4481 self activityNotification:'Loading extensions'. |
4492 self activityNotification:'Loading extensions'. |
4482 newStuffHasBeenLoaded := newStuffHasBeenLoaded | meOrMySecondIncarnation loadExtensions. |
4493 newStuffHasBeenLoaded := newStuffHasBeenLoaded | meOrMySecondIncarnation loadExtensions. |
4483 self activityNotification:'Loading classes'. |
4494 self activityNotification:'Loading classes'. |
4484 newStuffHasBeenLoaded := newStuffHasBeenLoaded | (meOrMySecondIncarnation loadAllClassesAsAutoloaded:asAutoloaded). |
4495 newStuffHasBeenLoaded := newStuffHasBeenLoaded | (meOrMySecondIncarnation loadAllClassesAsAutoloaded:asAutoloaded). |
4485 "/ no, don't load subProjects here - will lead to a recursion, which leads |
4496 "/ no, don't load subProjects here - will lead to a recursion, which leads |
4486 "/ to some classes being loaded from source (soap) |
4497 "/ to some classes being loaded from source (soap) |
4487 self activityNotification:'Loading sub projects'. |
4498 self activityNotification:'Loading sub projects'. |
4488 meOrMySecondIncarnation loadSubProjectsAsAutoloaded:asAutoloaded. |
4499 meOrMySecondIncarnation loadSubProjectsAsAutoloaded:asAutoloaded. |
4489 ]. |
4500 ]. |
4490 self activityNotification:('Executing post-load action for %1' bindWith:self package). |
4501 self activityNotification:('Executing post-load action for %1' bindWith:self package). |
4491 |
4502 |
4492 "/ mhmh - already done for dll-loaded packages |
4503 "/ mhmh - already done for dll-loaded packages |
4493 "/ meOrMySecondIncarnation initializeAllClasses. |
4504 "/ meOrMySecondIncarnation initializeAllClasses. |
4494 meOrMySecondIncarnation postLoadAction. |
4505 meOrMySecondIncarnation postLoadAction. |
4495 |
4506 |
4496 meOrMySecondIncarnation projectIsLoaded:true. |
4507 meOrMySecondIncarnation projectIsLoaded:true. |
4497 meOrMySecondIncarnation ~~ self ifTrue:[ |
4508 meOrMySecondIncarnation ~~ self ifTrue:[ |
4498 self projectIsLoaded:true. |
4509 self projectIsLoaded:true. |
4499 ]. |
4510 ]. |
4500 |
4511 |
4501 self activityNotification:('Done (%1).' bindWith:self package). |
4512 self activityNotification:('Done (%1).' bindWith:self package). |
4502 ^ newStuffHasBeenLoaded |
4513 ^ newStuffHasBeenLoaded |
4503 |
4514 |
4504 "Created: / 17-08-2006 / 01:01:41 / cg" |
4515 "Created: / 17-08-2006 / 01:01:41 / cg" |
4505 "Modified: / 30-10-2008 / 08:16:21 / Jan Vrany <vranyj1@fel.cvut.cz>" |
4516 "Modified: / 30-10-2008 / 08:16:21 / Jan Vrany <vranyj1@fel.cvut.cz>" |
4506 "Modified: / 22-08-2009 / 12:02:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
4517 "Modified: / 22-08-2009 / 12:02:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
4507 "Modified: / 29-12-2010 / 10:09:34 / cg" |
4518 "Modified: / 21-08-2011 / 17:28:49 / cg" |
4508 ! |
4519 ! |
4509 |
4520 |
4510 unloadPackage |
4521 unloadPackage |
4511 "unload the project. |
4522 "unload the project. |
4512 Fails if there are still instances of any of my classes in the system" |
4523 Fails if there are still instances of any of my classes in the system" |