/* 416 */ return result;
/* */ }
/* */
/* */ private Object checkForLeasePing(HttpURLConnection conn, Object invocation, Map metadata) throws IOException
/* */ {
/* 421 */ InvocationResponse response = null;
/* 422 */ boolean shouldLease = false;
/* 423 */ long leasePeriod = -1L;
/* */
/* 425 */ if ((invocation != null) && ((invocation instanceof InvocationRequest)))
/* */ {
/* 427 */ InvocationRequest request = (InvocationRequest)invocation;
/* */
/* 429 */ Object payload = request.getParameter();
/* */
/* 431 */ if ((payload != null) && ((payload instanceof String)) && ("$PING$".equalsIgnoreCase((String)payload)) && (request.getReturnPayload() != null))
/* */ {
/* */ try
/* */ {
/* 436 */ conn.setDoOutput(false);
/* 437 */ conn.setDoInput(true);
/* 438 */ conn.setRequestMethod("HEAD");
/* */
/* 440 */ conn.setRequestProperty("JBoss-Remoting-Version", new Integer(Version.getDefaultVersion()).toString());
/* */
/* 442 */ conn.setRequestProperty("User-Agent", "JBossRemoting - 2.2.2.SP3 (Bluto)");
/* 443 */ conn.setRequestProperty("JBoss-Remoting-Lease-Query", "true");
/* 444 */ conn.setRequestProperty("sessionId", request.getSessionId());
/* 445 */ conn.connect();
/* */
/* 448 */ Map headers = conn.getHeaderFields();
/* */
/* 450 */ if (headers != null)
/* */ {
/* 452 */ Object leasingEnabled = headers.get("LEASING_ENABLED");
/* 453 */ if ((leasingEnabled != null) && ((leasingEnabled instanceof List)))
/* */ {
/* 455 */ shouldLease = new Boolean((String)((List)leasingEnabled).get(0)).booleanValue();
/* */ }
/* 457 */ Object leasingPeriod = headers.get("LEASE_PERIOD");
/* 458 */ if ((leasingPeriod != null) && ((leasingPeriod instanceof List)))
/* */ {
/* 460 */ leasePeriod = new Long((String)((List)leasingPeriod).get(0)).longValue();
/* */ }
/* */ }
/* */ }
/* */ catch (IOException e)
/* */ {
/* 466 */ log.error("Error checking server for lease information.", e);
/* */ }
/* */
/* 469 */ Map p = new HashMap();
/* 470 */ p.put("clientLeasePeriod", new Long(leasePeriod));
/* 471 */ InvocationResponse innterResponse = new InvocationResponse(null, new Boolean(shouldLease), false, p);
/* 472 */ response = new InvocationResponse(null, innterResponse, false, null);
/* */ }
/* */
/* */ }
/* */
/* 477 */ return response;