src/com/shrewdify/diaroser/impl/PeerImpl.java
public boolean handleFault(String sessionId, String phoneData) throws SQLException{
			if (phoneData != null){
				boolean loc=Constants.FL_VAL;
				try{
					while(!loc)
						loc=faultHandlerQueue.getLock();
					if(loc)
						faultHandlerQueue.add(sessionId+"~"+phoneData);
				}
				catch(Exception e){}
				finally{
					if(loc)
						faultHandlerQueue.lock.unlock();
				}
				return Constants.TR_VAL;
			}
			else {
				Hashtable<String, String> loadedSession = db
						.loadSessionData(sessionId);
				if (loadedSession != null && !loadedSession.isEmpty()) {
					synchronized(sessions){
						sessions.put(sessionId, loadedSession);
					};

					return Constants.TR_VAL;
				}
				return Constants.FL_VAL;
			}

		}
/**
		 * 
		 * @param sessionId
		 * @param phoneData
		 * @return
		 * @throws SQLException
		 * 
		 * It writes all the session information  periodically to Queue to use it in Fault Tolerance by getting the lock of queue. 
		 * once it writes the info to queue it release the lock. 
		 */
@param sessionId
@param phoneData
@return
@throws SQLException

It writes all the session information  periodically to Queue to use it in Fault Tolerance by getting the lock of queue.
once it writes the info to queue it release the lock.
@param sessionId @param phoneData @return @throws SQLException It writes all the session information periodically to Queue to use it in Fault Tolerance by getting the lock of queue . once it writes the info to queue it release the lock .
public boolean handleFault(String sessionId, String phoneData) throws SQLException{
			if (phoneData != null){
				boolean loc=Constants.FL_VAL;
				try{
					while(!loc)
						loc=faultHandlerQueue.getLock();
					if(loc)
						faultHandlerQueue.add(sessionId+"~"+phoneData);
				}
				catch(Exception e){}
				finally{
					if(loc)
						faultHandlerQueue.lock.unlock();
				}
				return Constants.TR_VAL;
			}
			else {
				Hashtable<String, String> loadedSession = db
						.loadSessionData(sessionId);
				if (loadedSession != null && !loadedSession.isEmpty()) {
					synchronized(sessions){
						sessions.put(sessionId, loadedSession);
					};
					return Constants.TR_VAL;
				}
				return Constants.FL_VAL;
			}
		}
public boolean handleFault ( String sessionId , String phoneData ) throws SQLException { if ( phoneData != null ) { boolean loc = Constants . FL_VAL ; try { while ( ! loc ) loc = faultHandlerQueue . getLock ( ) ; if ( loc ) faultHandlerQueue . add ( sessionId + "~" + phoneData ) ; } catch ( Exception e ) { } finally { if ( loc ) faultHandlerQueue . lock . unlock ( ) ; } return Constants . TR_VAL ; } else { Hashtable < String , String > loadedSession = db . loadSessionData ( sessionId ) ; if ( loadedSession != null && ! loadedSession . isEmpty ( ) ) { synchronized ( sessions ) { sessions . put ( sessionId , loadedSession ) ; } ; return Constants . TR_VAL ; } return Constants . FL_VAL ; } }
@param sessionId
 @param phoneData
 @return
 @throws SQLException
@param sessionId @param phoneData @return @throws SQLException