Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Startup code
Startup code [message #26554] Mon, 21 May 2007 17:17 Go to next message
Eclipse UserFriend
Originally posted by: kendotlarson.mindspring.com

I'm looking to run some code right away when my RAP application is
loaded, before the IEntryPoint even gets called. Any pointers on how to
do this?

Thanks,

Ken Larson
Re: Startup code [message #26613 is a reply to message #26554] Mon, 21 May 2007 18:52 Go to previous messageGo to next message
Roberto Sanchez is currently offline Roberto SanchezFriend
Messages: 82
Registered: July 2009
Member
Hi Ken, I'm not an expert in Life-cycle of RAP applications, and It's
possible that this idea was a madness for RAP based apps ;-) but, in any
case: A static section in your Entrypoint class will be executed before
IEntryPoint.createUI() method:



public class EntryPoint implements IEntryPoint {

static {
System.out.println("Helooooo !!");
/*
... YOUR CODE ...
*/
}

public Display createUI() {
final Display display = PlatformUI.createDisplay();
PlatformUI.createAndRunWorkbench(display, new MyAppAdvisor());
return display;
}

}

Regards.
Roberto.

Ken Larson escribió:
> I'm looking to run some code right away when my RAP application is
> loaded, before the IEntryPoint even gets called. Any pointers on how to
> do this?
>
> Thanks,
>
> Ken Larson
Re: Startup code [message #26646 is a reply to message #26613] Tue, 22 May 2007 06:37 Go to previous message
Eclipse UserFriend
Originally posted by: fappel.innoopract.com

Hi,

the static initializer code of Roberto will work if you need an let me call
it 'application scope one time setup mechanism'. Nevertheless I think that
static initializers are a little bit unpractically and inflexible in case
that larger initialization steps are needed. But that may only be a question
of taste.

The standard java web-app approach would be to use an ServletContextListener
implementation that will be executed at application startup. Unfortunately
and as far as I know there is no such mechanism provided by the
OSGi-http-service yet. It should not be that difficult to map the context
listener calls into the OSGi instance, but that's something you'd better ask
the equinox-folks.

Ciao
Frank

"Roberto S
Previous Topic:Tomcat encoding Issue
Next Topic:Will ActionSet ext. point be available in RAP ?
Goto Forum:
  


Current Time: Fri Apr 26 20:38:59 GMT 2024

Powered by FUDForum. Page generated in 0.03484 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top