Showsplash vs SplashPath
Tom (and others),
Ian--
R. Ian Bull, PhD
Software Developer, EclipseSource
http://www.ianbull.com
http://blog.ianbull.com
Tom (and others),
| Ian Bull <irbull-yiTCNibefIkYhU31cYVdIwC/G2K4zDHf@public.gmane.org>
Sent by: equinox-dev-bounces-j9T/66MeVpFAfugRpC6u6w@public.gmane.org 02/02/2009 12:30 PM
|
|
Hello, We implemented a rcp application which can be started either by clicking the application file (.exe) or by doubleclicking a file (with a certain fileextension) on the filesystem. The problem is that we want to handle a doubleclick on this file by extracting its information and show a dialog in our application. There are two possibilites: There is already an running instance or we have to start a new one. It seems to me that the Equinox Hook can be a friend in this case. Read the proposed solution under http://www.ibm.com/developerworks/library/os-eclipse-rcpurl/index.html, I have the idea to put the uri client into an Equinox hook. Either I can call the other instance via TCP (and close the new one) or run the current instance if there is no other instance open. The problem is now that I have to parse the commandline to get out the filepath of the file which was used to start our application. Is there a way to do that in the hook frameworkstart method? How can I close the osgi platform if there is another instance which can handle the file? Thanks, Jens -- -- View this message in context: http://www.nabble.com/Using-Equinox-Hooks-for-handling-application-starting--tp21808278p21808278.html Sent from the Equinox - Dev mailing list archive at Nabble.com.
Sorry for cross posting to the equinox newsgroup:
Hi folks,
we're using Eclipse JAAS to add security to our RAP application.
[--------]
String configName = "myJAAS";
URL configUrl = Activator.getDefault().getBundle().getEntry(
"data/jaas_config.txt");
System.setProperty("login.config.url.1", configUrl.toExternalForm());
ILoginContext secureContext = LoginContextFactory.createContext(
configName, configUrl);
...
Subject s = secureContext.getSubject();
...
[--------]
The login works properly so far but now I want to register an event
listener to give the user feedback if the login failed for some reason.
The Eclipse JAAS API provides the method registerListener() to add an
event listener.
[--------]
secureContext.registerListener(listener)
[--------]
But how do I register my login dialog that implements CallbackHandler
and ILoginContextListener if the callbackhandler is defined in
plugin.xml as an extension? So my application doesn't know the used
LoginModule, CallbackHandler and actually used CallbackHandlerMapping.
Any help is appreciated.
Kindest regards, Lars
See https://bugs.eclipse.org/bugs/show_bug.cgi?id=178927 for an enhancement request that is similar to what you require.
The Equinox Hook (AdaptorHook.startFramework method) will not be sufficient for implementing this. You can get the command line by using the EnvironmentInfo service in you hook. You are passed a BundleContext which you could use to get the EnvironmentInfo service. This service has the methods you need to get the command line arguments. But there is no way from the startFramework method to tell the platform not to start the application. When Eclipse RCP is launched it is configured with an application to launch. You still want this application to be configured to launch in case there is no running instance of your application yet. So even though you processed the command line in your adaptor hook and communicated with another running instance the platform will continue to boot and attempt to start your application. At that point your application could determine that a command line was used to communicate with another instance and return immediately. If you already have to enter your application each time then you might as well just put all the TCP client/server logic directly in your application and have it determine whether it should pass the information off to another running instance of your application and return immediately or process the request directly because it is the first running instance of the application.
Tom
Jens Goldhammer ---02/03/2009 05:46:40 AM---Hello,
|
From: |
Jens Goldhammer <goldhammerdev-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> |
|
To: |
equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org |
|
Date: |
02/03/2009 05:46 AM |
|
Subject: |
[equinox-dev] Using Equinox Hooks for handling application starting? |
The map file has been updated for the following Bug changes:
+ Bug 91463. [launcher] Main#resolve should not set the osgi.framework property (FIXED)
+ Bug 241663. [user admin] Incorrect Password Save/Load (FIXED)
+ Bug 251152. Cannot run two different Eclipse applications back to back in the same JVM using EclipseStarter (FIXED)
+ Bug 252303. Uniqueness of bundleentry URLs with multiple frameworks in the same VM (NEW)
+ Bug 258209. When using new RFC-132 launch mechanism, CCL not being set correctly on Equinox threads (FIXED)
+ Bug 262249. NPE could append when class loading (FIXED)
+ Bug 262941. console chokes and dies with unclosed quotes (FIXED)
+ Bug 263063. Missing <at> since tag on EventHook (FIXED)
+ Bug 263125. FilterImpl class can remove unneeded field (FIXED)
The following projects have changed:
org.eclipse.equinox.launcher
org.eclipse.equinox.useradmin
org.eclipse.equinox.supplement
org.eclipse.osgi.tests
org.eclipse.osgi
Tom
For the Galileo M6 build we have to change the external format of the bundle entry/resource URLs again. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=252303
Our original fix violated the URI syntax for server-based naming authority. This prevented the following code pattern from working:
java.net.URL url = bundle.getEntry("resource.txt");
java.net.URI uri = new java.net.URI(url.getProtocol(), url.getHost(),url.getPath(), url.getQuery());
The original fix returned host Strings (from url.getHost()) which would cause a URISyntaxException to occur when used to construct a URI. We had to change the external format again to comply with the URI syntax. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=252303#c27 for more information on the external format, but please keep in mind that the external format is not API and should not be relied upon. If you encounter any issues with the change please let us know in bug 252303.
Thanks to Angel Vera for bringing this to our attention. It is good we caught this before the 3.5 release.
Tom
Thanks for answering, Thomas! Yes, my idea was to put the client and server into the application. The server starts as a separate thread in the background and the hook contains the client which tries to connect to the server. If no server is found, I want to leave the current running instance starting, so in my case I have nothing to do in the hook. In the other case, to connect to another instance, I want to stop the current instance. You say that it I cannot stop the osgi platform in my hook? Is there really no oppurtunity for doing that? What about system.exit()??I think, that should be the last solution... I have seen the class OSGi and the method close(). Can I reference it somehow? Maybe I can use AspectJ for get an reference to an instance of OSGi? Thanks, Jens Thomas Watson wrote: > > > See https://bugs.eclipse.org/bugs/show_bug.cgi?id=178927 for an > enhancement > request that is similar to what you require. > > The Equinox Hook (AdaptorHook.startFramework method) will not be > sufficient > for implementing this. You can get the command line by using the > EnvironmentInfo service in you hook. You are passed a BundleContext which > you could use to get the EnvironmentInfo service. This service has the > methods you need to get the command line arguments. But there is no way > from the startFramework method to tell the platform not to start the > application. When Eclipse RCP is launched it is configured with an > application to launch. You still want this application to be configured > to > launch in case there is no running instance of your application yet. So > even though you processed the command line in your adaptor hook and > communicated with another running instance the platform will continue to > boot and attempt to start your application. At that point your > application > could determine that a command line was used to communicate with another > instance and return immediately. If you already have to enter your > application each time then you might as well just put all the TCP > client/server logic directly in your application and have it determine > whether it should pass the information off to another running instance of > your application and return immediately or process the request directly > because it is the first running instance of the application. > > Tom > > > > > > From: Jens Goldhammer <goldhammerdev@...> > > To: equinox-dev@... > > Date: 02/03/2009 05:46 AM > > Subject: [equinox-dev] Using Equinox Hooks for handling application > starting? > > > > > > > > Hello, > > We implemented a rcp application which can be started either by clicking > the > application file (.exe) or by doubleclicking a file (with a certain > fileextension) on the filesystem. The problem is that we want to handle a > doubleclick on this file by extracting its information and show a dialog > in > our application. There are two possibilites: There is already an running > instance or we have to start a new one. > > It seems to me that the Equinox Hook can be a friend in this case. Read > the > proposed solution under > http://www.ibm.com/developerworks/library/os-eclipse-rcpurl/index.html, I > have the idea to put the uri client into an Equinox hook. Either I can > call > the other instance via TCP (and close the new one) or run the current > instance if there is no other instance open. > > The problem is now that I have to parse the commandline to get out the > filepath of the file which was used to start our application. Is there a > way > to do that in the hook frameworkstart method? How can I close the osgi > platform if there is another instance which can handle the file? > > Thanks, > Jens > -- > View this message in context: > http://www.nabble.com/Using-Equinox-Hooks-for-handling-application-starting--tp21808278p21808278.html > > Sent from the Equinox - Dev mailing list archive at Nabble.com. > > _______________________________________________ > equinox-dev mailing list > equinox-dev@... > https://dev.eclipse.org/mailman/listinfo/equinox-dev > > > > > _______________________________________________ > equinox-dev mailing list > equinox-dev@... > https://dev.eclipse.org/mailman/listinfo/equinox-dev > > -- -- View this message in context: http://www.nabble.com/Using-Equinox-Hooks-for-handling-application-starting--tp21808278p21814525.html Sent from the Equinox - Dev mailing list archive at Nabble.com.
_______________________________________________ platform-releng-dev mailing list platform-releng-dev@... https://dev.eclipse.org/mailman/listinfo/platform-releng-dev
Currently the system is not designed to allow you to shutdown the framework from an adaptor hook as the framework is being launched. Anything you do will likely be a hack and likely will not do exactly what you want. With the current Eclipse Platform, I think the simplest approach is to put both the client and server directly in your application (implementation of IApplication).
- The default application that is launched has complete control over when the running instance shuts down. This happens when you exit the IApplication.start method.
- Your IApplication.start method can check for a server and communicate with it to process the request and then exit the start method to shutdown the instance of Eclipse.
- If no server is found you can start your server and process the request directly in the current instance.
The disadvantage of this approach is the overhead of getting to your IApplication.start(), but that should be quite low since you should do it very early in your application before any extensions have been loaded and any UI has been displayed.
Tom
Jens Goldhammer ---02/03/2009 11:21:42 AM---Thanks for answering, Thomas!
|
From: |
Jens Goldhammer <goldhammerdev-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> |
|
To: |
equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org |
|
Date: |
02/03/2009 11:21 AM |
|
Subject: |
Re: [equinox-dev] Using Equinox Hooks for handling application starting? |
I think, that should be the last solution...
RSS Feed9 | |
|---|---|
14 | |
19 | |
3 | |
27 | |
24 | |
49 | |
24 | |
49 | |
49 | |
59 | |
57 | |
46 | |
28 | |
47 | |
50 | |
30 | |
51 | |
21 | |
16 | |
70 | |
20 | |
80 | |
57 | |
37 | |
54 | |
62 | |
34 | |
50 | |
76 | |
71 | |
52 | |
107 | |
94 | |
121 | |
71 | |
77 | |
97 | |
35 | |
58 | |
116 | |
126 | |
57 | |
134 | |
193 | |
190 | |
207 | |
201 | |
215 | |
151 | |
96 | |
118 | |
203 | |
164 | |
173 | |
128 | |
156 | |
152 | |
93 | |
121 | |
180 | |
74 | |
48 | |
139 | |
110 | |
63 | |
37 | |
89 | |
143 | |
71 | |
51 | |
103 | |
114 | |
64 | |
42 | |
82 |