 |
Author |
Topic: Processing "headless" mode? (Read 2179 times) |
|
amoeba
|
Processing "headless" mode?
« on: May 26th, 2004, 9:44pm » |
|
Is there a way to run Processing "headless", so that it can be used to generate images on a server etc? I realise this must be done using Processing as a Java library, but since BApplet extends java.awt.Applet I can't think of any way to run it without the AWT popping up a window. Basically, I'm thinking of using Processing as a rendering engine for server-based projects. I seem to remember that Martin Gomez used it that way for one project, but can't find the link now.
|
marius watz // amoeba http://processing.unlekker.net/
|
|
|
flight404

|
Re: Processing "headless" mode?
« Reply #1 on: Jun 3rd, 2004, 8:48am » |
|
I was just having this discussion with my peeps earlier today (its late... i can say peeps if i want to). I would be interested in hearing more about this. I want to be able to use processing/sonia to analyze sound bites on the fly and spit out the data in a way that flash can access it. r
|
|
|
|
Bijeoma
|
Re: Processing "headless" mode?
« Reply #2 on: Jun 3rd, 2004, 9:37am » |
|
well i believe each awt window object inherits the hide() method right? i didnt double check but if so you could hide the window and it wouldnt pop up. theres probably something im missing though...
|
|
|
|
amoeba
|
Re: Processing "headless" mode?
« Reply #3 on: Jun 3rd, 2004, 12:44pm » |
|
The problem is that if you want to run a Java server app it might be running without access to the display, and hence fail with an exception when the app tries to create a window. Java apps can invoke a headless mode in which the AWT functions are called without windows. See more information here. That documents seems to indicate that java.awt.Applet (which BApplet extends) will throw a HeadlessException. I guess the best way to find out definitively is to try it.
|
marius watz // amoeba http://processing.unlekker.net/
|
|
|
c1sc0
|
Re: Processing "headless" mode?
« Reply #4 on: Aug 20th, 2004, 11:28am » |
|
Hi, I'm wondering what the compilation command chain is. I'd like to be able to generate a processing source file on-the-fly (With e.g. Perl parsing Blast output), compile this and display the resulting applet on our web server. Kinda 'headless', I hope rephrasing this and bumping the thread will give me some clues for starting my search. What commands get invoked when one pushes 'run' in the processing environment? Any hints on automating this with a shell script? (Current environment is Linux). Francis Dierick
|
|
|
|
fjen
|
Re: Processing "headless" mode?
« Reply #5 on: Aug 21st, 2004, 1:52am » |
|
the sketch itself is just a text-file (.java) that shouldn't be a problem to generate it. compile errors might be though. why don't you check out ant ( http://ant.apache.org/ ) you can call it from the commandline somewhat like "/usr/bin/ant buildfile.xml". buildfile is xml so you could even edit that "on the fly" ... do a search here on the board for eclipe & ant or xcode & ant, to get started.
|
|
|
|
fry
|
Re: Processing "headless" mode?
« Reply #6 on: Sep 4th, 2004, 7:14pm » |
|
one option for headless might be using just BGraphics and not BApplet. this would mean you'd get the graphics stuff but lose a little of the math (sin/cos/etc) and things like time and input events (no big deal, these are all wrappers on java functions. re: what happens when 'run' is hit.. the code for your .pde file (what's showing in the p5 window) gets run through a preprocessor that converts the code to straight java. the code is then compiled using jikes, and then loaded in one of two ways. if you're not using a code folder, Class.forName() is used to create an instance of your class (the class files that were built by jikes are in lib/build), which will have a fake name on it (Temporary_NNNN_NNNN). for things with a code folder, a new java vm is started that runs your code via "java BApplet <yoursketchname>" using the compiled classes from jikes.
|
|
|
|
amoeba
|
Re: Processing "headless" mode?
« Reply #7 on: Sep 6th, 2004, 11:32am » |
|
on Sep 4th, 2004, 7:14pm, fry wrote:one option for headless might be using just BGraphics and not BApplet. |
| That's exactly the kind of thing I was looking for. It will be very useful for server-based work etc. Thanks, Ben.
|
marius watz // amoeba http://processing.unlekker.net/
|
|
|
Martin
   

|
Re: Processing "headless" mode?
« Reply #8 on: Sep 12th, 2004, 8:11am » |
|
hi marius, yeap. i had to take it off from the web since i was hosting it in a server that was not supposed to be seen by anyone for security reasons. i basically used the p5 api's in a servlet to generate the stuff on the server and push the output to the client. if i could find (the time when and) a server where i could install j2ee, i'll put it up again. best, martin
|
|
|
|
|