startup.jar의 소스는 org.eclipse.platform에 들어있음. 유로파는 startup.jar가 없어지고 equinox 안으로 들어갔음.
버전은 20070111버전이 3.2에 맞는 소스이다.
WebStartMain을 다음과 같이 수정한다.
public class WebStartMain extends Main implements SingleInstanceListener{
싱글인스탄스리스너를 구현한뒤 main 메소드를 수정하고 newActivation을 축가한다.
public static void main(String[] args) {
System.setSecurityManager(null); //TODO Hack so that when the classloader loading the fwk is created we don't have funny permissions. This should be revisited.
SingleInstanceService sis;
try {
sis = (SingleInstanceService)ServiceManager.lookup("javax.jnlp.SingleInstanceService");
} catch (UnavailableServiceException e) {
sis=null;
}
WebStartMain sisL = new WebStartMain();
sis.addSingleInstanceListener(sisL);
int result = sisL.run(args);
sis.removeSingleInstanceListener(sisL);
System.exit(result);
}
public void newActivation(String[] arg0) {
String newDiid = "";
if (arg0 != null){
for( int i = arg0.length -1 ; i >=0; i--){
System.out.println( arg0[i] +"\n");
int po = arg0[i].indexOf("-diid");
if( po>-1){
newDiid = arg0[i].substring(po+5);
}
}
}
String oo = System.getProperty("clipd.diagramId", "knkal");
System.out.println("khs newActivation" + oo);
System.out.println("khs newDiid" + newDiid);
// Session.getInstance().anotherDiagram(newDiid);
// JOptionPane.showConfirmDialog((Component)null, "기존에 열린 모델러를 이용하세요.", "alert", JOptionPane.DEFAULT_OPTION);
Frame f = new Frame();
f.setSize(0,0);
f.setAlwaysOnTop(true);
f.setUndecorated(true);
f.setSize(0, 0);
f.setVisible(true);
MsgBox message = new MsgBox
(f , "모델러가 열러 있습니다.", true);
if (message.isOk)
System.out.println("Ok pressed");
if (!message.isOk)
System.out.println("Cancel pressed");
message.dispose();
f.dispose();
System.out.println("khs newActivation2");
//Session.getInstance().anotherDiagram("382");
}
MsgBox는 필요에 따라 추가하면 된다.
컴파일이 되면 eclipse 아래의 startup.jar를
복사한 후 커맨드에서
jar uvf startup.jar org
명령을 실행한다. 컴파일된 class 들이 org 아래에 있어야 한다.
startup.jar가 업데이트 되면
jarsigner -keystore C:\java\jks\keystore -storepass 1111 -keypass 1111 startup.jar ardent
하여 사인을 한다.
해결안된 문제, 위의 newActivation에서 새로운 명령행 인자를 받아도
실행중인 웹스타트 프로그램에 넘겨줄 방법이 없다.
열심히 연구중.....