Calling System.exit()

"Arpe, Kevin C" <[email protected]> Wed, 25 May 2011 21:02:39 +0800
Newsgroups gmane.comp.java.tn5250j.general
Message-ID <A092B47643AE4B4DA4B006612FDB00AC034C30C9D4@EMAHC102VS01.exchad.jpmchase.net>
--===============6339130331219744372==
Content-Language: en-US
Content-Type: multipart/alternative;
	boundary="_000_A092B47643AE4B4DA4B006612FDB00AC034C30C9D4EMAHC102VS01e_"


--_000_A092B47643AE4B4DA4B006612FDB00AC034C30C9D4EMAHC102VS01e_
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi,=0D=0A=0D=0AI noticed in your code you call System=2Eexit() in a few pla=
ces=2E=0D=0AExample: org=2Etn5250j=2EMy5250=2Emain()=0D=0A=0D=0AThis makes =
it difficult to call this method from other Java code=2E=0D=0A=0D=0AIs ther=
e a recommended way to spawn new connections using the same virtual machine=
?=0D=0AExample: I want to spawn your app from another app=2E=0D=0A=0D=0AOn =
idea, is call java=2Eexe externally and pass the JAR name=2E=0D=0ABut I wou=
ld rather call into your JAR directly -- same virtual machine (VM)=2E=0D=0A=
=0D=0AWhen I use a basic threading design, it won't work because System=2Ee=
xit() terminates the VM=2E=0D=0AHowever, I built a very basic SecurityManag=
er to trap calls to System=2Eexit()=2E=0D=0A[Source: http://stackoverflow=
=2Ecom/questions/309396/java-how-to-test-methods-that-call-system-exit]=0D=
=0ANow my solution works=2E=2E=2E but it is a slight hack=2E=0D=0A=0D=0ACan=
 you please provide the correct API calls=2E=2E=2E or remove System=2Eexit(=
) from your code?=0D=0A=0D=0AWe are big fans here=2E  Keep up the good work=
=2E=0D=0A=0D=0APlease advise=2E=0D=0AThanks,=0D=0AArpe=0D=0A=0D=0A=0D=0AThi=
s email is confidential and subject to important disclaimers and=0D=0Acondi=
tions including on offers for the purchase or sale of=0D=0Asecurities, accu=
racy and completeness of information, viruses,=0D=0Aconfidentiality, legal =
privilege, and legal entity disclaimers,=0D=0Aavailable at http://www=2Ejpm=
organ=2Ecom/pages/disclosures/email=2E  
--_000_A092B47643AE4B4DA4B006612FDB00AC034C30C9D4EMAHC102VS01e_
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:x=3D"urn:schemas-microsoft-com:office:excel" xmlns:p=3D"urn:schemas-m=
icrosoft-com:office:powerpoint" xmlns:a=3D"urn:schemas-microsoft-com:office=
:access" xmlns:dt=3D"uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:s=3D"=
uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:rs=3D"urn:schemas-microsof=
t-com:rowset" xmlns:z=3D"#RowsetSchema" xmlns:b=3D"urn:schemas-microsoft-co=
m:office:publisher" xmlns:ss=3D"urn:schemas-microsoft-com:office:spreadshee=
t" xmlns:c=3D"urn:schemas-microsoft-com:office:component:spreadsheet" xmlns=
:odc=3D"urn:schemas-microsoft-com:office:odc" xmlns:oa=3D"urn:schemas-micro=
soft-com:office:activation" xmlns:html=3D"http://www=2Ew3=2Eorg/TR/REC-html=
40" xmlns:q=3D"http://schemas=2Exmlsoap=2Eorg/soap/envelope/" xmlns:rtc=3D"=
http://microsoft=2Ecom/officenet/conferencing" xmlns:D=3D"DAV:" xmlns:Repl=
=3D"http://schemas=2Emicrosoft=2Ecom/repl/" xmlns:mt=3D"http://schemas=2Emi=
crosoft=2Ecom/sharepoint/soap/meetings/" xmlns:x2=3D"http://schemas=2Emicro=
soft=2Ecom/office/excel/2003/xml" xmlns:ppda=3D"http://www=2Epassport=2Ecom=
/NameSpace=2Exsd" xmlns:ois=3D"http://schemas=2Emicrosoft=2Ecom/sharepoint/=
soap/ois/" xmlns:dir=3D"http://schemas=2Emicrosoft=2Ecom/sharepoint/soap/di=
rectory/" xmlns:ds=3D"http://www=2Ew3=2Eorg/2000/09/xmldsig#" xmlns:dsp=3D"=
http://schemas=2Emicrosoft=2Ecom/sharepoint/dsp" xmlns:udc=3D"http://schema=
s=2Emicrosoft=2Ecom/data/udc" xmlns:xsd=3D"http://www=2Ew3=2Eorg/2001/XMLSc=
hema" xmlns:sub=3D"http://schemas=2Emicrosoft=2Ecom/sharepoint/soap/2002/1/=
alerts/" xmlns:ec=3D"http://www=2Ew3=2Eorg/2001/04/xmlenc#" xmlns:sp=3D"htt=
p://schemas=2Emicrosoft=2Ecom/sharepoint/" xmlns:sps=3D"http://schemas=2Emi=
crosoft=2Ecom/sharepoint/soap/" xmlns:xsi=3D"http://www=2Ew3=2Eorg/2001/XML=
Schema-instance" xmlns:udcs=3D"http://schemas=2Emicrosoft=2Ecom/data/udc/so=
ap" xmlns:udcxf=3D"http://schemas=2Emicrosoft=2Ecom/data/udc/xmlfile" xmlns=
:udcp2p=3D"http://schemas=2Emicrosoft=2Ecom/data/udc/parttopart" xmlns:wf=
=3D"http://schemas=2Emicrosoft=2Ecom/sharepoint/soap/workflow/" xmlns:dsss=
=3D"http://schemas=2Emicrosoft=2Ecom/office/2006/digsig-setup" xmlns:dssi=
=3D"http://schemas=2Emicrosoft=2Ecom/office/2006/digsig" xmlns:mdssi=3D"htt=
p://schemas=2Eopenxmlformats=2Eorg/package/2006/digital-signature" xmlns:mv=
er=3D"http://schemas=2Eopenxmlformats=2Eorg/markup-compatibility/2006" xmln=
s:m=3D"http://schemas=2Emicrosoft=2Ecom/office/2004/12/omml" xmlns:mrels=3D=
"http://schemas=2Eopenxmlformats=2Eorg/package/2006/relationships" xmlns:sp=
wp=3D"http://microsoft=2Ecom/sharepoint/webpartpages" xmlns:ex12t=3D"http:/=
/schemas=2Emicrosoft=2Ecom/exchange/services/2006/types" xmlns:ex12m=3D"htt=
p://schemas=2Emicrosoft=2Ecom/exchange/services/2006/messages" xmlns:pptsl=
=3D"http://schemas=2Emicrosoft=2Ecom/sharepoint/soap/SlideLibrary/" xmlns:s=
psl=3D"http://microsoft=2Ecom/webservices/SharePointPortalServer/PublishedL=
inksService" xmlns:Z=3D"urn:schemas-microsoft-com:" xmlns:st=3D"&#1;" xmlns=
=3D"http://www=2Ew3=2Eorg/TR/REC-html40"><head><meta http-equiv=3DContent-T=
ype content=3D"text/html; charset=3Dus-ascii"><meta name=3DGenerator conten=
t=3D"Microsoft Word 12 (filtered medium)"><style><!--=0D=0A/* Font Definiti=
ons */=0D=0A@font-face=0D=0A	{font-family:SimSun;=0D=0A	panose-1:2 1 6 0 3 =
1 1 1 1 1;}=0D=0A@font-face=0D=0A	{font-family:"Cambria Math";=0D=0A	panose=
-1:2 4 5 3 5 4 6 3 2 4;}=0D=0A@font-face=0D=0A	{font-family:Calibri;=0D=0A	=
panose-1:2 15 5 2 2 2 4 3 2 4;}=0D=0A@font-face=0D=0A	{font-family:"\@SimSu=
n";=0D=0A	panose-1:2 1 6 0 3 1 1 1 1 1;}=0D=0A/* Style Definitions */=0D=0A=
p=2EMsoNormal, li=2EMsoNormal, div=2EMsoNormal=0D=0A	{margin:0in;=0D=0A	mar=
gin-bottom:=2E0001pt;=0D=0A	font-size:12=2E0pt;=0D=0A	font-family:"Times Ne=
w Roman","serif";}=0D=0Aa:link, span=2EMsoHyperlink=0D=0A	{mso-style-priori=
ty:99;=0D=0A	color:blue;=0D=0A	text-decoration:underline;}=0D=0Aa:visited, =
span=2EMsoHyperlinkFollowed=0D=0A	{mso-style-priority:99;=0D=0A	color:purpl=
e;=0D=0A	text-decoration:underline;}=0D=0Aspan=2EEmailStyle17=0D=0A	{mso-st=
yle-type:personal-compose;=0D=0A	font-family:"Calibri","sans-serif";=0D=0A	=
color:windowtext;}=0D=0A=2EMsoChpDefault=0D=0A	{mso-style-type:export-only;=
}=0D=0A@page WordSection1=0D=0A	{size:8=2E5in 11=2E0in;=0D=0A	margin:1=2E0i=
n 1=2E0in 1=2E0in 1=2E0in;}=0D=0Adiv=2EWordSection1=0D=0A	{page:WordSection=
1;}=0D=0A--></style><!--[if gte mso 9]><xml>=0D=0A<o:shapedefaults v:ext=3D=
"edit" spidmax=3D"1026" />=0D=0A</xml><![endif]--><!--[if gte mso 9]><xml>=
=0D=0A<o:shapelayout v:ext=3D"edit">=0D=0A<o:idmap v:ext=3D"edit" data=3D"1=
" />=0D=0A</o:shapelayout></xml><![endif]--></head><body lang=3DEN-US link=
=3Dblue vlink=3Dpurple><div class=3DWordSection1><p class=3DMsoNormal><span=
 style=3D'font-size:11=2E0pt;font-family:"Calibri","sans-serif"'>Hi,<o:p></=
o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11=2E0pt;font-=
family:"Calibri","sans-serif"'><o:p>&nbsp;</o:p></span></p><p class=3DMsoNo=
rmal><span style=3D'font-size:11=2E0pt;font-family:"Calibri","sans-serif"'>=
I noticed in your code you call System=2Eexit() in a few places=2E<o:p></o:=
p></span></p><p class=3DMsoNormal><span style=3D'font-size:11=2E0pt;font-fa=
mily:"Calibri","sans-serif"'>Example: org=2Etn5250j=2EMy5250=2Emain()<o:p><=
/o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11=2E0pt;font=
-family:"Calibri","sans-serif"'><o:p>&nbsp;</o:p></span></p><p class=3DMsoN=
ormal><span style=3D'font-size:11=2E0pt;font-family:"Calibri","sans-serif"'=
>This makes it difficult to call this method from other Java code=2E<o:p></=
o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11=2E0pt;font-=
family:"Calibri","sans-serif"'><o:p>&nbsp;</o:p></span></p><p class=3DMsoNo=
rmal><span style=3D'font-size:11=2E0pt;font-family:"Calibri","sans-serif"'>=
Is there a recommended way to spawn new connections using the same virtual =
machine?<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size=
:11=2E0pt;font-family:"Calibri","sans-serif"'>Example: I want to spawn your=
 app from another app=2E<o:p></o:p></span></p><p class=3DMsoNormal><span st=
yle=3D'font-size:11=2E0pt;font-family:"Calibri","sans-serif"'><o:p>&nbsp;</=
o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11=2E0pt;font-=
family:"Calibri","sans-serif"'>On idea, is call java=2Eexe externally and p=
ass the JAR name=2E<o:p></o:p></span></p><p class=3DMsoNormal><span style=
=3D'font-size:11=2E0pt;font-family:"Calibri","sans-serif"'>But I would rath=
er call into your JAR directly -- same virtual machine (VM)=2E<o:p></o:p></=
span></p><p class=3DMsoNormal><span style=3D'font-size:11=2E0pt;font-family=
:"Calibri","sans-serif"'><o:p>&nbsp;</o:p></span></p><p class=3DMsoNormal><=
span style=3D'font-size:11=2E0pt;font-family:"Calibri","sans-serif"'>When I=
 use a basic threading design, it won't work because System=2Eexit() termin=
ates the VM=2E<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'fon=
t-size:11=2E0pt;font-family:"Calibri","sans-serif"'>However, I built a very=
 basic SecurityManager to trap calls to System=2Eexit()=2E<o:p></o:p></span=
></p><p class=3DMsoNormal><span style=3D'font-size:11=2E0pt;font-family:"Ca=
libri","sans-serif"'>[Source: http://stackoverflow=2Ecom/questions/309396/j=
ava-how-to-test-methods-that-call-system-exit]<o:p></o:p></span></p><p clas=
s=3DMsoNormal><span style=3D'font-size:11=2E0pt;font-family:"Calibri","sans=
-serif"'>Now my solution works&#8230; but it is a slight hack=2E<o:p></o:p>=
</span></p><p class=3DMsoNormal><span style=3D'font-size:11=2E0pt;font-fami=
ly:"Calibri","sans-serif"'><o:p>&nbsp;</o:p></span></p><p class=3DMsoNormal=
><span style=3D'font-size:11=2E0pt;font-family:"Calibri","sans-serif"'>Can =
you please provide the correct API calls&#8230; or remove System=2Eexit() f=
rom your code?<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'fon=
t-size:11=2E0pt;font-family:"Calibri","sans-serif"'><o:p>&nbsp;</o:p></span=
></p><p class=3DMsoNormal><span style=3D'font-size:11=2E0pt;font-family:"Ca=
libri","sans-serif"'>We are big fans here=2E&nbsp; Keep up the good work=2E=
<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11=2E0p=
t;font-family:"Calibri","sans-serif"'><o:p>&nbsp;</o:p></span></p><p class=
=3DMsoNormal><span style=3D'font-size:11=2E0pt;font-family:"Calibri","sans-=
serif"'>Please advise=2E<o:p></o:p></span></p><p class=3DMsoNormal><span st=
yle=3D'font-size:11=2E0pt;font-family:"Calibri","sans-serif"'>Thanks,<o:p><=
/o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11=2E0pt;font=
-family:"Calibri","sans-serif"'>Arpe<o:p></o:p></span></p></div></body></ht=
ml>=0D=0A<p><span STYLE=3D"color :#000000;background-color :#FFFFFF">=0D=0A=
This email is confidential and subject to important disclaimers and conditi=
ons including on offers for the purchase or sale of securities, accuracy an=
d completeness of information, viruses, confidentiality, legal privilege, a=
nd legal entity disclaimers, available at http://www=2Ejpmorgan=2Ecom/pages=
/disclosures/email=2E  =0D=0A</span></p>
--_000_A092B47643AE4B4DA4B006612FDB00AC034C30C9D4EMAHC102VS01e_--



--===============6339130331219744372==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
--===============6339130331219744372==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Tn5250j-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tn5250j-general

--===============6339130331219744372==--