Lagoon: Possible to mark class or package as must-not-strip?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Lagoon: Possible to mark class or package as must-not-strip?

Chris Hayes-3
Is there any way to a mark a class or all of the classes contained in a
package as must-not-strip?  I have a scenario where classes get stripped by
Lagoon but are needed at runtime due to instances of those classes being
loaded via STBInFiler.

Thanks.


Reply | Threaded
Open this post in threaded view
|

Re: Lagoon: Possible to mark class or package as must-not-strip?

Christopher J. Demers
Chris Hayes <hayes@*zapthis*.creative-computing-inc.com> wrote in message
news:Q5AN7.967$[hidden email]...
> Is there any way to a mark a class or all of the classes contained in a
> package as must-not-strip?  I have a scenario where classes get stripped
by
> Lagoon but are needed at runtime due to instances of those classes being
> loaded via STBInFiler.

I don't think you can currently tell Dolphin not to strip any classes in a
particular package.  However I suppose one could subclass the ImageStripper
to work some magic.

I think the easiest way to do this would be the add a method to a class in
the package you are deploying, perhaps your session manger class, and
include it in the "must not strip" category, and then just include the class
names you do not want stripped separated by periods.  There is no need to
call this method but it should prevent the striper from removing the
classes.

You can also manually add package prerequisites to a package (look at the
package properties context menu, this is handy for packages that only
contain lose methods).  If you do the above I don't think you will need to
do this as well as the stripper should now consider your package a
prerequisite due to the references.  This is probably only needed for
packages with only loose methods.

Chris


Reply | Threaded
Open this post in threaded view
|

Re: Lagoon: Possible to mark class or package as must-not-strip?

Bill Schwab-2
In reply to this post by Chris Hayes-3
Chris,

Not necessarily the only and/or best way, but, I've dealt with similar
problems by having one method that is marked as must not strip and simply
references the classes.  Something like

doNotStripTheseClasses
   "Hold references on required classes"

   FirstClass.
   SecondClass.
   ...

If there's a better way, I'm very interested in knowing about it.

Have a good one,

Bill

--
Wilhelm K. Schwab, Ph.D.
[hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: Lagoon: Possible to mark class or package as must-not-strip?

Andy Bower
In reply to this post by Chris Hayes-3
Chris,

> Is there any way to a mark a class or all of the classes contained in a
> package as must-not-strip?  I have a scenario where classes get stripped
by
> Lagoon but are needed at runtime due to instances of those classes being
> loaded via STBInFiler.

The easiest way to do this is to subclass ImageStripper and override the
#requiredClasses method to add the classes you want to preserve to the
IdentitySet that it returns. You can then specify that you want to use the
new image stripper in the Lagoon wizard.

Best Regards,

Andy Bower
Dolphin Support
http://www.object-arts.com
---
Are you trying too hard?
http://www.object-arts.com/Relax.htm
---


Reply | Threaded
Open this post in threaded view
|

Re: Lagoon: Possible to mark class or package as must-not-strip?

Chris Hayes-3
In reply to this post by Chris Hayes-3
Thanks for all of the responses.
I went with the ImageStripper subclass approach suggested by Andy.   The
only "gotcha" I ran into was the need to include my ImageStripper subclass
as part of the package being deployed.   Otherwise, some sort of error
occured and the Lagoon Wizard would revert back to using the ImageStripper
class.  Other than that, everthing worked perfectly.

Thanks.

Chris Hayes

"Chris Hayes" <hayes@*zapthis*.creative-computing-inc.com> wrote in message
news:Q5AN7.967$[hidden email]...
> Is there any way to a mark a class or all of the classes contained in a
> package as must-not-strip?  I have a scenario where classes get stripped
by
> Lagoon but are needed at runtime due to instances of those classes being
> loaded via STBInFiler.
>
> Thanks.
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Lagoon: Possible to mark class or package as must-not-strip?

Joseph Pelrine-2
In reply to this post by Bill Schwab-2
I haven't done much stipping/packaging work in Dolphin, but I've used this
technique quite often with the ENVY packager. Since I'm hesitant about using
packaging instructions (for reasons I won't go into unless someone's really
interested), I tend to have a message send somewhere in the startup code,
which I'm absolutely sure will be called by the VM, which calls
#doNotStripTheseClasses.

Cheers
Joseph

Bill Schwab wrote:

> Chris,
>
> Not necessarily the only and/or best way, but, I've dealt with similar
> problems by having one method that is marked as must not strip and simply
> references the classes.  Something like
>
> doNotStripTheseClasses
>    "Hold references on required classes"
>
>    FirstClass.
>    SecondClass.
>    ...
>
> If there's a better way, I'm very interested in knowing about it.
>
> Have a good one,
>
> Bill
>
> --
> Wilhelm K. Schwab, Ph.D.
> [hidden email]

--
Joseph Pelrine [ | ]
MetaProg GmbH
Email: [hidden email]
Web:   http://www.metaprog.com

"Inheritance was invented at 2 AM between January 5th and 6th, 1967" -
Krysten Nygaard