Re: Compile java sources inside J2EE component

From: Stefan Siegl (Stefan.Siegl_at_gmx.de)
Date: 09/07/04


Date: Tue, 07 Sep 2004 12:01:39 +0200

Andrew Thompson wrote:

> On Tue, 07 Sep 2004 09:39:13 +0200, Stefan Siegl wrote:
>
>
>>After creating the source files I need
>>to compile them at runtime, is there a possibility to do so?
>
>
> Yes, but only by invoking classes for which
> Sun issues no public documentation, and
> reserves the right to change at any time.
>
>
>>As I said before if the model changes, the new source code files need to
>>be compiled again. Is there a way to "unload" possible classes that were
>>created for the last model, so that there won't be a clash with the
>>newly created classes?
>
>
> I am on unfamiliar ground here, but you
> might try using a custom class loader,
> and refreshing it.

I hope this is possible, I will give it a try, but I suspect that it
will not be that easy. I just thought that it must be possible to unload
the classes, because other Java application can do it too, i.e. the
JBoss app server with its hotdeploy feature.

> Better suggestions are probably forthcoming.
>
> But.. why does a CRM need to compile source
> 'on the fly', it seems like you might be
> approaching the problem wrong. (And again,
> I am not that experienced with the area,
> but it has a strong whiff of 'overkill'.)

The central requirement of the system is that the user should be allowed
to define his specific CRM model at runtime. Therefore a metamodel is
provided by me to define the general constructs a model can have (like a
class, associations, and so on). The model will then be represented by
instances of these metaclasses. based on this model the user is allowed
to insert/query/delete data.

The problem is that the handling of model is not easy if the model is
stored as meta instances, because then i do not have a nice connection
between the entered data and the model. That is why I wanted to have
java classes that represent this model and instances of this model to
represent the data. Using this approach I can directly check if the
rules of the models are kept within the offered data.



Relevant Pages

  • Re: Multilangual : how to?
    ... texts into separate *.rc source files John. ... maintenance point of view to keep them in the same source file, but compile ... Also, error-message texts really belong in a separate, more specialised *.mc ... source files get compiled by the mc message compiler. ...
    (microsoft.public.vb.general.discussion)
  • Re: Linking options
    ... Link all source files to one VS.NET project (literally add them into ... VS.NET) then compile those modules into your final assembly. ... > Is it possible to do a static link when building an executable? ... > little application that uses 3 or 4 of my custom DLLs. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Multilangual : how to?
    ... > texts into separate *.rc source files John. ... > source files get compiled by the mc message compiler. ... >> Outgoing mail is certified Virus Free. ...
    (microsoft.public.vb.general.discussion)
  • Re: How do header files work?
    ... The compiler has to know which source files it's going to compile in the ... You don't compile the headers, you compile the source files, and those ... your project has to specify the library ...
    (comp.lang.cpp)
  • Re: native machine code
    ... that make exe file that run my java classes but it dont compile it to ... and while searching for native code compiler i got names of some ...
    (comp.lang.java.programmer)