[appengine-java] Re: Creating/Compiling new Java class at run time

2011-03-07 Thread Rick Smith
Any update guys?

On Mar 7, 1:13 pm, Rick Smith  wrote:
> Hi all
>
> Can I create and compile a java class at run time on goolge
> appengine.
> Use case: I have given a UI to my application user that they can
> define their own business logic.Now what is going to be main challenge
> is that I need to make new deployment each time when some one need to
> modify its business logic. As an alternate I want to store source code
> in data base and compile it when required.
>
> Regards
>
> Rick

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: Creating/Compiling new Java class at run time

2011-03-08 Thread Larry Cable


On Mar 7, 12:13 am, Rick Smith  wrote:
> Hi all
>
> Can I create and compile a java class at run time on goolge
> appengine.
> Use case: I have given a UI to my application user that they can
> define their own business logic.Now what is going to be main challenge
> is that I need to make new deployment each time when some one need to
> modify its business logic. As an alternate I want to store source code
> in data base and compile it when required.
>
> Regards
>
> Rick

As others have pointed out the file I/O issue precludes using a
compiler 

The best I can suggest is using BCEL to construct classes at
runtime... But I have never tried this with GAE so I do not know if
BCEL is whitelist safe.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: Creating/Compiling new Java class at run time

2011-03-08 Thread Larry Cable


On Mar 8, 8:35 pm, Larry Cable  wrote:
> On Mar 7, 12:13 am, Rick Smith  wrote:
>
> > Hi all
>
> > Can I create and compile a java class at run time on goolge
> > appengine.
> > Use case: I have given a UI to my application user that they can
> > define their own business logic.Now what is going to be main challenge
> > is that I need to make new deployment each time when some one need to
> > modify its business logic. As an alternate I want to store source code
> > in data base and compile it when required.
>
> > Regards
>
> > Rick
>
> As others have pointed out the file I/O issue precludes using a
> compiler 
>
> The best I can suggest is using BCEL to construct classes at
> runtime... But I have never tried this with GAE so I do not know if
> BCEL is whitelist safe.

Just as a followup you need to take a look at the BCEL API to see if
you can create in-memory class files ... Otherwise you will trip up
over the File I/O issue again.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: Creating/Compiling new Java class at run time

2011-03-08 Thread Didier Durand
Hi,

Even if you solve the File I/O issue, I would guess that you may then
face security issue: Google has probably protected its instances
against execution of code not coming direcly from the war file...

Anyway, very interesting question: pls, let us konw how you progress.

regards

didier

On Mar 9, 5:43 am, Larry Cable  wrote:
> On Mar 8, 8:35 pm, Larry Cable  wrote:
>
>
>
> > On Mar 7, 12:13 am, Rick Smith  wrote:
>
> > > Hi all
>
> > > Can I create and compile a java class at run time on goolge
> > > appengine.
> > > Use case: I have given a UI to my application user that they can
> > > define their own business logic.Now what is going to be main challenge
> > > is that I need to make new deployment each time when some one need to
> > > modify its business logic. As an alternate I want to store source code
> > > in data base and compile it when required.
>
> > > Regards
>
> > > Rick
>
> > As others have pointed out the file I/O issue precludes using a
> > compiler 
>
> > The best I can suggest is using BCEL to construct classes at
> > runtime... But I have never tried this with GAE so I do not know if
> > BCEL is whitelist safe.
>
> Just as a followup you need to take a look at the BCEL API to see if
> you can create in-memory class files ... Otherwise you will trip up
> over the File I/O issue again.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: Creating/Compiling new Java class at run time

2011-03-08 Thread Jay Young
I dunno about this.  The different JVM language runtimes (JRuby, Rhino, 
Groovy, etc) all generate and run bytecode on the fly.  I don't know if you 
can cache that generated byte code and re-execute it later, though that 
seems like it'd be a shortcoming of the interpreter, not the App Engine 
environment.


On Wednesday, March 9, 2011 12:17:57 AM UTC-5, Didier Durand wrote:
>
> Hi, 
>
> Even if you solve the File I/O issue, I would guess that you may then 
> face security issue: Google has probably protected its instances 
> against execution of code not coming direcly from the war file... 
>
> Anyway, very interesting question: pls, let us konw how you progress. 
>
> regards 
>
> didier 
>
> On Mar 9, 5:43 am, Larry Cable  wrote: 
> > On Mar 8, 8:35 pm, Larry Cable  wrote: 
> > 
> > 
> > 
> > > On Mar 7, 12:13 am, Rick Smith  wrote: 
> > 
> > > > Hi all 
> > 
> > > > Can I create and compile a java class at run time on goolge 
> > > > appengine. 
> > > > Use case: I have given a UI to my application user that they can 
> > > > define their own business logic.Now what is going to be main 
> challenge 
> > > > is that I need to make new deployment each time when some one need to 
>
> > > > modify its business logic. As an alternate I want to store source 
> code 
> > > > in data base and compile it when required. 
> > 
> > > > Regards 
> > 
> > > > Rick 
> > 
> > > As others have pointed out the file I/O issue precludes using a 
> > > compiler  
> > 
> > > The best I can suggest is using BCEL to construct classes at 
> > > runtime... But I have never tried this with GAE so I do not know if 
> > > BCEL is whitelist safe. 
> > 
> > Just as a followup you need to take a look at the BCEL API to see if 
> > you can create in-memory class files ... Otherwise you will trip up 
> > over the File I/O issue again.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: Creating/Compiling new Java class at run time

2011-03-11 Thread jesbox
I'm not sure about the idea. Sounds like giving a rocket launcher to a
kid.

You let the adaptation happen in the full development environment made
for professional programmers. If the re-deployment does not work out,
will your framework reset the GAE invisibly to the user? And so on.

Then there is this UI you made that I presume limits what the user can
specify quite a lot. So you could instead make a GAE application that
receives the settings from the UI and makes the appropriate brancings
accordingly. Like you write a program that adapts it behavior
depending on some parameter file, just that the parameters comes from
the UI.

Besides, I think that dynamic classloading is not possible in GAE.

/J

On Mar 7, 9:13 am, Rick Smith  wrote:
> Hi all
>
> Can I create and compile a java class at run time on goolge
> appengine.
> Use case: I have given a UI to my application user that they can
> define their own business logic.Now what is going to be main challenge
> is that I need to make new deployment each time when some one need to
> modify its business logic. As an alternate I want to store source code
> in data base and compile it when required.
>
> Regards
>
> Rick

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: Creating/Compiling new Java class at run time

2011-03-11 Thread Rick Smith
Hi Toby
I know that I can dynamically load class using Class.forName But What
if I want to crate a new Java class at run time. What I said that I
want my developers(that is my clients too) to create Busienss Logic at
run time. and I do not want to re deployment of my application. For my
application user, they are not required to know abt google app engine.
Its completely invisible to them.
@Toby--->The real question is what compiler/runtime do you need to try
to get running in App Engine
We are writing Business Logic in Java. So we may need javac command to
compile .




On Mar 12, 12:21 am, Toby Reyelts  wrote:
> jesbox,
>
> You can dynamically load classes using Class.forName or even your own custom
> ClassLoader. As Jay noted, this is how dynamic languages like Groovy, JRuby,
> and Rhino work, and they run perfectly well on App Engine.
>
> Rick,
>
> The real question is what compiler/runtime do you need to try to get running
> in App Engine? You'll want one that is "embeddable" - i.e. designed to be
> run as a library as opposed to just standalone. What language are your
> custom business rules written in? You may have better luck finding an
> embeddable compiler/runtime for scripting-based languages.
>
>
>
>
>
>
>
> On Fri, Mar 11, 2011 at 3:25 AM, jesbox  wrote:
> > I'm not sure about the idea. Sounds like giving a rocket launcher to a
> > kid.
>
> > You let the adaptation happen in the full development environment made
> > for professional programmers. If the re-deployment does not work out,
> > will your framework reset the GAE invisibly to the user? And so on.
>
> > Then there is this UI you made that I presume limits what the user can
> > specify quite a lot. So you could instead make a GAE application that
> > receives the settings from the UI and makes the appropriate brancings
> > accordingly. Like you write a program that adapts it behavior
> > depending on some parameter file, just that the parameters comes from
> > the UI.
>
> > Besides, I think that dynamic classloading is not possible in GAE.
>
> > /J
>
> > On Mar 7, 9:13 am, Rick Smith  wrote:
> > > Hi all
>
> > > Can I create and compile a java class at run time on goolge
> > > appengine.
> > > Use case: I have given a UI to my application user that they can
> > > define their own business logic.Now what is going to be main challenge
> > > is that I need to make new deployment each time when some one need to
> > > modify its business logic. As an alternate I want to store source code
> > > in data base and compile it when required.
>
> > > Regards
>
> > > Rick
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google App Engine for Java" group.
> > To post to this group, send email to
> > google-appengine-java@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-appengine-java+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/google-appengine-java?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



Re: [appengine-java] Re: Creating/Compiling new Java class at run time

2011-03-08 Thread Vinny
Offhand, I don't think this would be possible as you would be at least
creating a new .class file.
GAE allows no File I/O.

--
biz: http://www.linkedin.com/in/vincentstoessel/
personal: http://xaymaca.tumblr.com/



On Mon, Mar 7, 2011 at 10:55 PM, Rick Smith  wrote:
> Any update guys?
>
> On Mar 7, 1:13 pm, Rick Smith  wrote:
>> Hi all
>>
>> Can I create and compile a java class at run time on goolge
>> appengine.
>> Use case: I have given a UI to my application user that they can
>> define their own business logic.Now what is going to be main challenge
>> is that I need to make new deployment each time when some one need to
>> modify its business logic. As an alternate I want to store source code
>> in data base and compile it when required.
>>
>> Regards
>>
>> Rick
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Google App Engine for Java" group.
> To post to this group, send email to google-appengine-java@googlegroups.com.
> To unsubscribe from this group, send email to 
> google-appengine-java+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



Re: [appengine-java] Re: Creating/Compiling new Java class at run time

2011-03-11 Thread Toby Reyelts
jesbox,

You can dynamically load classes using Class.forName or even your own custom
ClassLoader. As Jay noted, this is how dynamic languages like Groovy, JRuby,
and Rhino work, and they run perfectly well on App Engine.

Rick,

The real question is what compiler/runtime do you need to try to get running
in App Engine? You'll want one that is "embeddable" - i.e. designed to be
run as a library as opposed to just standalone. What language are your
custom business rules written in? You may have better luck finding an
embeddable compiler/runtime for scripting-based languages.

On Fri, Mar 11, 2011 at 3:25 AM, jesbox  wrote:

> I'm not sure about the idea. Sounds like giving a rocket launcher to a
> kid.
>
> You let the adaptation happen in the full development environment made
> for professional programmers. If the re-deployment does not work out,
> will your framework reset the GAE invisibly to the user? And so on.
>
> Then there is this UI you made that I presume limits what the user can
> specify quite a lot. So you could instead make a GAE application that
> receives the settings from the UI and makes the appropriate brancings
> accordingly. Like you write a program that adapts it behavior
> depending on some parameter file, just that the parameters comes from
> the UI.
>
> Besides, I think that dynamic classloading is not possible in GAE.
>
> /J
>
> On Mar 7, 9:13 am, Rick Smith  wrote:
> > Hi all
> >
> > Can I create and compile a java class at run time on goolge
> > appengine.
> > Use case: I have given a UI to my application user that they can
> > define their own business logic.Now what is going to be main challenge
> > is that I need to make new deployment each time when some one need to
> > modify its business logic. As an alternate I want to store source code
> > in data base and compile it when required.
> >
> > Regards
> >
> > Rick
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-java@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



Re: [appengine-java] Re: Creating/Compiling new Java class at run time

2011-03-11 Thread Toby Reyelts
If you want users to type Java code directly into your webapp and then
compile it, you'll need an embeddable Java compiler, like
Janino.
Another possible alternative might be JDT
. One
other alternative you might consider is using
Beanshell,
which is a scripting runtime for Java.

On Fri, Mar 11, 2011 at 10:55 PM, Rick Smith  wrote:

> Hi Toby
> I know that I can dynamically load class using Class.forName But What
> if I want to crate a new Java class at run time. What I said that I
> want my developers(that is my clients too) to create Busienss Logic at
> run time. and I do not want to re deployment of my application. For my
> application user, they are not required to know abt google app engine.
> Its completely invisible to them.
> @Toby--->The real question is what compiler/runtime do you need to try
> to get running in App Engine
> We are writing Business Logic in Java. So we may need javac command to
> compile .
>
>
>
>
> On Mar 12, 12:21 am, Toby Reyelts  wrote:
> > jesbox,
> >
> > You can dynamically load classes using Class.forName or even your own
> custom
> > ClassLoader. As Jay noted, this is how dynamic languages like Groovy,
> JRuby,
> > and Rhino work, and they run perfectly well on App Engine.
> >
> > Rick,
> >
> > The real question is what compiler/runtime do you need to try to get
> running
> > in App Engine? You'll want one that is "embeddable" - i.e. designed to be
> > run as a library as opposed to just standalone. What language are your
> > custom business rules written in? You may have better luck finding an
> > embeddable compiler/runtime for scripting-based languages.
> >
> >
> >
> >
> >
> >
> >
> > On Fri, Mar 11, 2011 at 3:25 AM, jesbox  wrote:
> > > I'm not sure about the idea. Sounds like giving a rocket launcher to a
> > > kid.
> >
> > > You let the adaptation happen in the full development environment made
> > > for professional programmers. If the re-deployment does not work out,
> > > will your framework reset the GAE invisibly to the user? And so on.
> >
> > > Then there is this UI you made that I presume limits what the user can
> > > specify quite a lot. So you could instead make a GAE application that
> > > receives the settings from the UI and makes the appropriate brancings
> > > accordingly. Like you write a program that adapts it behavior
> > > depending on some parameter file, just that the parameters comes from
> > > the UI.
> >
> > > Besides, I think that dynamic classloading is not possible in GAE.
> >
> > > /J
> >
> > > On Mar 7, 9:13 am, Rick Smith  wrote:
> > > > Hi all
> >
> > > > Can I create and compile a java class at run time on goolge
> > > > appengine.
> > > > Use case: I have given a UI to my application user that they can
> > > > define their own business logic.Now what is going to be main
> challenge
> > > > is that I need to make new deployment each time when some one need to
> > > > modify its business logic. As an alternate I want to store source
> code
> > > > in data base and compile it when required.
> >
> > > > Regards
> >
> > > > Rick
> >
> > > --
> > > You received this message because you are subscribed to the Google
> Groups
> > > "Google App Engine for Java" group.
> > > To post to this group, send email to
> > > google-appengine-java@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > google-appengine-java+unsubscr...@googlegroups.com.
> > > For more options, visit this group at
> > >http://groups.google.com/group/google-appengine-java?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-java@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.