Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Integrating plugin bundles in normal Java
Integrating plugin bundles in normal Java [message #124324] Mon, 12 January 2009 23:03 Go to next message
Tom H is currently offline Tom HFriend
Messages: 18
Registered: July 2009
Junior Member
Hi experts,

I have been trying to start an osgi application with another POJO main
method for integration.

I used the following in the main method of a public static main method:
public static void main(String[] args) {
String[] launcherArgs = {
"-configuration",
"C:\\pathTto\\configuration",
"-install",
"C:\\pathToIntall",

" -DJavaAgentLogConfigFile=C:\\pathToLogConfig\\log4j-commandl ine.xml ",
"-application",
"org.my.Application",
};
org.eclipse.core.launcher.Main.main(launcherArgs);
}
The above class can be found in startup.jar.

However, now my problem is how to return an result object from my App A.
org.eclipse.core.launcher.Main.main(launcherArgs) and
org.eclipse.equinox.launcher.Main.main(launcherArgs) does not have return
type. If my app A which implements
org.eclipse.core.runtime.IPlatformRunnable does return an result object in
its public Object run(args) method, how do I retrieve it?

I tried cutting over to use EclipseStarter:
BundleContext context = EclipseStarter.startup(launcherArgs, null);
Object appResult = EclipseStarter.run(null);

However, I think I am not able to use the same configuration parameters as
before:
!ENTRY org.eclipse.osgi 4 0 2009-01-09 16:02:58.719
!MESSAGE Bundle org.eclipse.core.runtime@start not found.

!ENTRY org.eclipse.update.configurator 2009-01-09 16:02:58.859
!MESSAGE C:\pathTo\plugins is not a valid plugins directory.

Any idea?

Regards,
Tom
Re: Integrating plugin bundles in normal Java [message #124362 is a reply to message #124324] Tue, 13 January 2009 14:45 Go to previous message
Simon Kaegi is currently offline Simon KaegiFriend
Messages: 381
Registered: July 2009
Senior Member
Tom,

I'd go the EclipseStarter way personally. You might take a look at the
FrameworkLauncher in org.eclipse.equinox.servletbridge for inspiration.


"Tom Hsu" <tomhsu@gmail.com> wrote in message
news:fc51bc65570f23077826b0ec425b2242$1@www.eclipse.org...
> Hi experts,
>
> I have been trying to start an osgi application with another POJO main
> method for integration.
>
> I used the following in the main method of a public static main method:
> public static void main(String[] args) {
> String[] launcherArgs = {
> "-configuration",
> "C:\\pathTto\\configuration",
> "-install",
> "C:\\pathToIntall",
>
> " -DJavaAgentLogConfigFile=C:\\pathToLogConfig\\log4j-commandl ine.xml ",
> "-application",
> "org.my.Application",
> };
> org.eclipse.core.launcher.Main.main(launcherArgs);
> }
> The above class can be found in startup.jar.
>
> However, now my problem is how to return an result object from my App A.
> org.eclipse.core.launcher.Main.main(launcherArgs) and
> org.eclipse.equinox.launcher.Main.main(launcherArgs) does not have return
> type. If my app A which implements
> org.eclipse.core.runtime.IPlatformRunnable does return an result object in
> its public Object run(args) method, how do I retrieve it?
>
> I tried cutting over to use EclipseStarter:
> BundleContext context = EclipseStarter.startup(launcherArgs, null);
> Object appResult = EclipseStarter.run(null);
>
> However, I think I am not able to use the same configuration parameters as
> before:
> !ENTRY org.eclipse.osgi 4 0 2009-01-09 16:02:58.719
> !MESSAGE Bundle org.eclipse.core.runtime@start not found.
>
> !ENTRY org.eclipse.update.configurator 2009-01-09 16:02:58.859
> !MESSAGE C:\pathTo\plugins is not a valid plugins directory.
>
> Any idea?
>
> Regards,
> Tom
>
Previous Topic:Equinox Transforms Example
Next Topic:Use of Service Binder with Equinox
Goto Forum:
  


Current Time: Tue Mar 19 11:02:59 GMT 2024

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

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

Back to the top