package com.onaro.sanscreen.client; /** * Main applicaiton to run to start the client. * Needed to allow arguments to be passed in * and processed in signed JNLP. This allows * dynamic system properties to be set (would not * be possible if properties are set as properties -- not * arguments -- in the JNLP file) * * @author Francisco Assis Rosa (frosa@netapp.com) * @since October 28th, 2013 */ public class WebStartMain { /** * Main method to capture information, set system properties * from arguments, call up Eclipse. * * @param args the command line arguments passed in to application */ public static void main(java.lang.String[] args) { try { // process '-Dname=value' command line arguments (customization of client params) for ( String oneArg : args ) { if ( oneArg.startsWith("-D") ) { //$NON-NLS-1$ oneArg = oneArg.substring(2); int equalIdx = oneArg.indexOf("="); //$NON-NLS-1$ if ( equalIdx > 0 ) { String varName = oneArg.substring(0,equalIdx); String varValue = oneArg.substring(equalIdx+1); System.setProperty(varName, varValue); } } } // override security manager to be org.eclipse.osgi.framework.internal.core.FrameworkSecurityManager (default allow all OSGI security manager) // see: http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fruntime-options.html // this addresses issue where java update broke client since java uses restrictive security manager (IBG-5218) System.setProperty("eclipse.security", "osgi"); // now that all system properties are set, call the real thing (Eclipse) org.eclipse.equinox.launcher.WebStartMain.main(args); } catch (Throwable e) { System.err.println (e.getMessage()); e.printStackTrace(); } } }