/** * This method handles all outgoing and incoming data. * @param to TransferObject * @return Object */ public Object execute(TransferObject to) { if(to.isLongConnection()){ Monitor.Enter(theLock); try { if(longClientSession == null){ longClientSession = new LongClientSession(hostIp, hostPort, timeout, retryCount); } return longClientSession.start(to); } finally { Monitor.Exit(theLock); } }else{ if(shortClientSession == null){ shortClientSession = new ShortClientSession(hostIp, hostPort, timeout, retryCount); } return shortClientSession.start(to); } }
/** * This method handles all outgoing and incoming data. * @param to TransferObject * @return Object */ public Object execute(TransferObject to) { if (to.isLongConnection()) { Monitor.Enter(theLock); try { if (longClientSession == null) { longClientSession = new LongClientSession(hostIp, hostPort, timeout, retryCount); } return(longClientSession.start(to)); } finally { Monitor.Exit(theLock); } } else { if (shortClientSession == null) { shortClientSession = new ShortClientSession(hostIp, hostPort, timeout, retryCount); } return(shortClientSession.start(to)); } }