<div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div><span style="font-weight: bold; background-color: rgb(255, 255, 255); color: rgb(0, 0, 0);">hi, everyone!</span></div><div><span style="font-weight: bold; background-color: rgb(255, 255, 255); color: rgb(0, 0, 0);"><br></span></div><div><span style="background-color: rgb(255, 255, 255); font-weight: bold; color: rgb(0, 0, 0);">&nbsp;&nbsp; first, we call getReactor in new ScenarioClient().</span></div><div><span style="color:#000080;font-weight:bold;"><br></span></div><div><span style="color:#000080;font-weight:bold;">public </span>ScenarioClient(String hostname, <span style="color:#000080;font-weight:bold;">int </span>port) <span style="color:#000080;font-weight:bold;">throws </span>ClientConnectionException {</div><pre style="background-color:#ffffff;color:#000000;font-family:'DejaVu Sans Mono';font-size:11.3pt;">    <span style="color:#000080;font-weight:bold;">this</span>.<span style="color:#660e7a;font-weight:bold;">reactor </span>= ReactorFactory.<span style="font-style:italic;">getReactor</span>(ProviderFactory.<span style="font-style:italic;">getProvider</span>(), ReactorType.<span style="color:#660e7a;font-weight:bold;font-style:italic;">STOMP</span>);<br>    <span style="color:#000080;font-weight:bold;">final </span>ReactorClient client = <span style="color:#000080;font-weight:bold;">this</span>.<span style="color:#660e7a;font-weight:bold;">reactor</span>.createClient(hostname, port);<br>    client.setClientPolicy(<span style="color:#000080;font-weight:bold;">new </span>DefaultStompConnectionPolicy());<br>    <span style="color:#000080;font-weight:bold;">this</span>.<span style="color:#660e7a;font-weight:bold;">worker </span>= ReactorFactory.<span style="font-style:italic;">getWorker</span>(<span style="color:#660e7a;font-weight:bold;font-style:italic;">PARALLELISM</span>);<br>    <span style="color:#000080;font-weight:bold;">this</span>.<span style="color:#660e7a;font-weight:bold;">jsonClient </span>= <span style="color:#000080;font-weight:bold;">this</span>.<span style="color:#660e7a;font-weight:bold;">worker</span>.register(client);<br>    <span style="color:#000080;font-weight:bold;">this</span>.<span style="color:#660e7a;font-weight:bold;">jsonClient</span>.setRetryPolicy(<span style="color:#000080;font-weight:bold;">new </span>DefaultStompClientPolicy());<br></pre><div>}</div><div><br></div><div>and ReactorFactory.getReactor will call getSslStompReactor that is a static way in ReactorFactory.<br></div><div><br></div><div><pre style="background-color:#ffffff;color:#000000;font-family:'DejaVu Sans Mono';font-size:11.3pt;"><span style="color:#000080;font-weight:bold;">private static </span>Reactor getSslStompReactor(ManagerProvider provider) <span style="color:#000080;font-weight:bold;">throws </span>ClientConnectionException {<br>    <span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0); font-weight: bold;">if </span>(<span style="color: rgb(255, 0, 0); font-style: italic;">sslStompReactor </span>!= <span style="color: rgb(255, 0, 0); font-weight: bold;">null</span>) {<br>        <span style="color: rgb(255, 0, 0); font-weight: bold;">return </span><span style="color: rgb(255, 0, 0); font-style: italic;">sslStompReactor</span>;<br>    }</span><br>    <span style="color:#000080;font-weight:bold;">synchronized </span>(ReactorFactory.<span style="color:#000080;font-weight:bold;">class</span>) {<br>        <span style="color:#000080;font-weight:bold;">if </span>(<span style="color:#660e7a;font-style:italic;">sslStompReactor </span>!= <span style="color:#000080;font-weight:bold;">null</span>) {<br>            <span style="color:#000080;font-weight:bold;">return </span><span style="color:#660e7a;font-style:italic;">sslStompReactor</span>;<br>        }<br>        <span style="color:#000080;font-weight:bold;">try </span>{<br>            <span style="color:#660e7a;font-style:italic;">sslStompReactor </span>= <span style="color:#000080;font-weight:bold;">new </span>SSLStompReactor(provider.getSSLContext());<br>        } <span style="color:#000080;font-weight:bold;">catch </span>(IOException | GeneralSecurityException e) {<br>            <span style="color:#000080;font-weight:bold;">throw new </span>ClientConnectionException(e);<br>        }<br>    }<br>    <span style="color:#000080;font-weight:bold;">return </span><span style="color:#660e7a;font-style:italic;">sslStompReactor</span>;<br>}<br><br>if we determine "sslStompReactor != null" may caused if engine is running, then engine.p12 changed, but we<br>use old certs and keys, will that?<br><br><br><br><br></pre></div></div><br><br><span title="neteasefooter"><p>&nbsp;</p></span>