Ejemplo n.º 1
0
        /**
         * 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);
		    }
	    }
Ejemplo n.º 2
0
 /**
  * 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));
     }
 }