xlawrence    2004/12/20 17:31:17 CET

  Modified files:
    src/java/org/jahia/suite/calendar/calServer SyncManager.java 
    src/java/org/jahia/suite/calendar/framework/message 
                                                        
GetCalendarRequestResponse.java 
                                                        
GetGUIDRequestResponse.java 
                                                        
UpdateCalendarRequestResponse.java 
    src/java/org/jahia/suite/calendar/syncClients 
                                                  ICalendarSyncSource.java 
    src/java/org/jahia/suite/calendar/webApp DelEventAction.java 
                                             EditEventAction.java 
  Log:
  Corrected javadoc bugs
  
  Revision  Changes    Path
  1.4       +5 -1      
uwcal_JSR168/src/java/org/jahia/suite/calendar/calServer/SyncManager.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/uwcal_JSR168/src/java/org/jahia/suite/calendar/calServer/SyncManager.java.diff?r1=1.3&r2=1.4&f=h
  1.5       +6 -6      
uwcal_JSR168/src/java/org/jahia/suite/calendar/framework/message/GetCalendarRequestResponse.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/uwcal_JSR168/src/java/org/jahia/suite/calendar/framework/message/GetCalendarRequestResponse.java.diff?r1=1.4&r2=1.5&f=h
  1.5       +8 -8      
uwcal_JSR168/src/java/org/jahia/suite/calendar/framework/message/GetGUIDRequestResponse.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/uwcal_JSR168/src/java/org/jahia/suite/calendar/framework/message/GetGUIDRequestResponse.java.diff?r1=1.4&r2=1.5&f=h
  1.5       +8 -8      
uwcal_JSR168/src/java/org/jahia/suite/calendar/framework/message/UpdateCalendarRequestResponse.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/uwcal_JSR168/src/java/org/jahia/suite/calendar/framework/message/UpdateCalendarRequestResponse.java.diff?r1=1.4&r2=1.5&f=h
  1.10      +1 -1      
uwcal_JSR168/src/java/org/jahia/suite/calendar/syncClients/ICalendarSyncSource.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/uwcal_JSR168/src/java/org/jahia/suite/calendar/syncClients/ICalendarSyncSource.java.diff?r1=1.9&r2=1.10&f=h
  1.3       +26 -15    
uwcal_JSR168/src/java/org/jahia/suite/calendar/webApp/DelEventAction.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/uwcal_JSR168/src/java/org/jahia/suite/calendar/webApp/DelEventAction.java.diff?r1=1.2&r2=1.3&f=h
  1.3       +29 -17    
uwcal_JSR168/src/java/org/jahia/suite/calendar/webApp/EditEventAction.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/uwcal_JSR168/src/java/org/jahia/suite/calendar/webApp/EditEventAction.java.diff?r1=1.2&r2=1.3&f=h
  
  
  
  Index: SyncManager.java
  ===================================================================
  RCS file: 
/home/cvs/repository/uwcal_JSR168/src/java/org/jahia/suite/calendar/calServer/SyncManager.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SyncManager.java  17 Dec 2004 15:46:59 -0000      1.3
  +++ SyncManager.java  20 Dec 2004 16:31:15 -0000      1.4
  @@ -52,7 +52,7 @@
   import org.apache.log4j.Logger;
   
   /**
  - * This class implements interfaces LockEvent and Storable. It thus can be
  + * This class implements interface LockEvent. It thus can be
    * viewed as a Transaction Manager as it is able to grant/release locks for
    * particular events and can store changes in the calendar server.
    *
  @@ -60,6 +60,10 @@
    */
   public class SyncManager implements LockEvent {
       
  +    /**
  +     * Number of seconds the SyncManager will wait before releasing the 
locks in
  +     * any cases. Prevents deadlocks
  +     */
       public static final int TIMEOUT = 45;
       
       // Single Object of this class (Singleton pattern)
  
  
  
  Index: GetCalendarRequestResponse.java
  ===================================================================
  RCS file: 
/home/cvs/repository/uwcal_JSR168/src/java/org/jahia/suite/calendar/framework/message/GetCalendarRequestResponse.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- GetCalendarRequestResponse.java   23 Nov 2004 10:30:17 -0000      1.4
  +++ GetCalendarRequestResponse.java   20 Dec 2004 16:31:16 -0000      1.5
  @@ -55,9 +55,9 @@
        * @param reqID The id of the Request parent of this Response 
        * @param calendar The requested Calendar object
        */
  -    protected GetCalendarRequestResponse(String ID, String reqID, 
  +    protected GetCalendarRequestResponse(String id, String reqID, 
       Calendar calendar) {
  -        super(ID, reqID);
  +        super(id, reqID);
           super.setProperty(CALENDAR, calendar);
       }
       
  @@ -67,8 +67,8 @@
        * @param reqID The id of the Request parent of this Response 
        * @param content The content of this Response
        */
  -    protected GetCalendarRequestResponse(String ID, String reqID, Object 
content) {
  -        super(ID, reqID, content);
  +    protected GetCalendarRequestResponse(String id, String reqID, Object 
content) {
  +        super(id, reqID, content);
       }
       
       /**
  @@ -78,9 +78,9 @@
        * @param content The content of this Response
        * @param calendar The requested Calendar object
        */
  -    protected GetCalendarRequestResponse(String ID, String reqID, Object 
content,
  +    protected GetCalendarRequestResponse(String id, String reqID, Object 
content,
       Calendar calendar) {
  -        super(ID, reqID, content);
  +        super(id, reqID, content);
           super.setProperty(CALENDAR, calendar);
       }
       
  
  
  
  Index: GetGUIDRequestResponse.java
  ===================================================================
  RCS file: 
/home/cvs/repository/uwcal_JSR168/src/java/org/jahia/suite/calendar/framework/message/GetGUIDRequestResponse.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- GetGUIDRequestResponse.java       23 Nov 2004 10:30:17 -0000      1.4
  +++ GetGUIDRequestResponse.java       20 Dec 2004 16:31:16 -0000      1.5
  @@ -54,8 +54,8 @@
        * @param id The id of the Response
        * @param reqID The id of the Request parent of this Response
        */
  -    protected GetGUIDRequestResponse(String ID, String reqID) {
  -        super(ID, reqID);
  +    protected GetGUIDRequestResponse(String id, String reqID) {
  +        super(id, reqID);
       }
       
       /**
  @@ -64,8 +64,8 @@
        * @param reqID The id of the Request parent of this Response
        * @param content The content of this Response
        */
  -    protected GetGUIDRequestResponse(String ID, String reqID, Object 
content) {
  -        super(ID, reqID, content);
  +    protected GetGUIDRequestResponse(String id, String reqID, Object 
content) {
  +        super(id, reqID, content);
       }
       
       /**
  @@ -74,8 +74,8 @@
        * @param reqID The id of the Request parent of this Response
        * @param guid The requested GUID Object
        */
  -    protected GetGUIDRequestResponse(String ID, String reqID, GUID guid) {
  -        super(ID, reqID);
  +    protected GetGUIDRequestResponse(String id, String reqID, GUID guid) {
  +        super(id, reqID);
           super.setProperty(this.GUID, guid);
       }
       
  @@ -86,9 +86,9 @@
        * @param content The content of this Response
        * @param guid The requested GUID Object
        */
  -    protected GetGUIDRequestResponse(String ID, String reqID, Object content,
  +    protected GetGUIDRequestResponse(String id, String reqID, Object content,
       GUID guid) {
  -        super(ID, reqID, content);
  +        super(id, reqID, content);
           super.setProperty(this.GUID, guid);
       }
       
  
  
  
  Index: UpdateCalendarRequestResponse.java
  ===================================================================
  RCS file: 
/home/cvs/repository/uwcal_JSR168/src/java/org/jahia/suite/calendar/framework/message/UpdateCalendarRequestResponse.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- UpdateCalendarRequestResponse.java        23 Nov 2004 10:30:17 -0000      
1.4
  +++ UpdateCalendarRequestResponse.java        20 Dec 2004 16:31:16 -0000      
1.5
  @@ -57,8 +57,8 @@
        * @param id The id of the Response
        * @param reqID The id of the Request parent of this Response 
        */
  -    protected UpdateCalendarRequestResponse(String ID, String reqID) {
  -        super(ID, reqID);
  +    protected UpdateCalendarRequestResponse(String id, String reqID) {
  +        super(id, reqID);
       }
       
       /**
  @@ -67,9 +67,9 @@
        * @param reqID The id of the Request parent of this Response
        * @param content The content Object of this Response
        */
  -    protected UpdateCalendarRequestResponse(String ID, String reqID, 
  +    protected UpdateCalendarRequestResponse(String id, String reqID, 
       Object content) {
  -        super(ID, reqID, content);
  +        super(id, reqID, content);
       }
       
       /**
  @@ -78,8 +78,8 @@
        * @param reqID The id of the Request parent of this Response
        * @param status The status code of the parent UpdateCalendarRequest
        */
  -    protected UpdateCalendarRequestResponse(String ID, String reqID, int 
status) {
  -        super(ID, reqID);
  +    protected UpdateCalendarRequestResponse(String id, String reqID, int 
status) {
  +        super(id, reqID);
           this.status = status;
       }
       
  @@ -90,9 +90,9 @@
        * @param content The content Object of this Response
        * @param status The status code of the parent UpdateCalendarRequest
        */
  -    protected UpdateCalendarRequestResponse(String ID, String reqID, Object 
content,
  +    protected UpdateCalendarRequestResponse(String id, String reqID, Object 
content,
       int status) {
  -        super(ID, reqID, content);
  +        super(id, reqID, content);
           this.status = status;
       }
       
  
  
  
  Index: ICalendarSyncSource.java
  ===================================================================
  RCS file: 
/home/cvs/repository/uwcal_JSR168/src/java/org/jahia/suite/calendar/syncClients/ICalendarSyncSource.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- ICalendarSyncSource.java  17 Dec 2004 15:47:00 -0000      1.9
  +++ ICalendarSyncSource.java  20 Dec 2004 16:31:16 -0000      1.10
  @@ -98,7 +98,7 @@
       
       /**
        * Setter for property sourceDirectory.
  -     * @param name New value of property sourceDirectory.
  +     * @param sourceDirectory New value of property sourceDirectory.
        */
       public void setSourceDirectory(String sourceDirectory) {
           this.sourceDirectory = sourceDirectory;
  
  
  
  Index: DelEventAction.java
  ===================================================================
  RCS file: 
/home/cvs/repository/uwcal_JSR168/src/java/org/jahia/suite/calendar/webApp/DelEventAction.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DelEventAction.java       23 Nov 2004 10:30:19 -0000      1.2
  +++ DelEventAction.java       20 Dec 2004 16:31:16 -0000      1.3
  @@ -41,6 +41,7 @@
   
   import org.jahia.suite.calendar.calServer.SyncManager;
   import org.jahia.suite.calendar.framework.model.SyncEvent;
  +import org.jahia.suite.calendar.framework.SyncException;
   
   import javax.servlet.http.HttpServletRequest;
   
  @@ -54,20 +55,30 @@
       
       public String doAction(HttpServletRequest request,
       UWCalActionForm form) throws Throwable {
  -        SyncManager client = SyncManager.getInstance();
  +        final SyncManager client = SyncManager.getInstance();
  +        SyncEvent event = null;        
  +        String result = null;
           
  -        /* First, we need to check that a concurrent access to the edited 
  -         * Event is not being accessed by another process */
  -        int eventId = form.getEventId();
  -        SyncEvent event = new SyncEvent(new Integer(eventId).toString(), 
  -        "".getBytes(), SyncEvent.DELETED);
  -        client.getLock(event);
  -        
  -        // Once the lock is granted, perform the actual "EditEventAction"
  -        final String result = super.doAction(request, form);
  -        
  -        // Finally, unlock the event and return the result
  -        client.unlock(event);       
  -        return result;
  -    }   
  +        try {
  +            /* First, we need to check that a concurrent access to the edited
  +             * Event is not being accessed by another process */
  +            int eventId = form.getEventId();
  +            event = new SyncEvent(new Integer(eventId).toString(),
  +            "".getBytes(), SyncEvent.DELETED);
  +            client.getLock(event);
  +            
  +            // Once the lock is granted, perform the actual "EditEventAction"
  +            result = super.doAction(request, form);
  +            
  +            // Finally, unlock the event and return the result
  +            client.unlock(event);
  +            
  +        } catch (Exception e) {
  +            throw new SyncException(e.getMessage(), e);
  +            
  +        } finally {
  +            client.unlock(event);
  +            return result;
  +        }
  +    }
   }
  
  
  
  Index: EditEventAction.java
  ===================================================================
  RCS file: 
/home/cvs/repository/uwcal_JSR168/src/java/org/jahia/suite/calendar/webApp/EditEventAction.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- EditEventAction.java      23 Nov 2004 10:30:19 -0000      1.2
  +++ EditEventAction.java      20 Dec 2004 16:31:16 -0000      1.3
  @@ -44,9 +44,10 @@
   
   import org.jahia.suite.calendar.calServer.SyncManager;
   import org.jahia.suite.calendar.framework.model.SyncEvent;
  +import org.jahia.suite.calendar.framework.SyncException;
   
   /**
  - * Extends the Struts UWCalEditEventAction in a way that it first requests a 
  + * Extends the Struts UWCalEditEventAction in a way that it first requests a
    * lock before performing the actual action.
    *
    * @author  Xavier Lawrence
  @@ -54,21 +55,32 @@
   public class EditEventAction extends UWCalEditEventAction {
       
       public String doAction(HttpServletRequest request,
  -    UWCalActionForm form) throws Throwable {        
  -        SyncManager client = SyncManager.getInstance();
  +    UWCalActionForm form) throws Throwable {
  +        final SyncManager client = SyncManager.getInstance();
  +        SyncEvent event = null;
  +        String result = null;
           
  -        /* First, we need to check that a concurrent access to the edited 
  -         * Event is not being accessed by another process */
  -        EventVO temp = form.getEditEvent();
  -        SyncEvent event = new SyncEvent(new 
Integer(temp.getId()).toString(), 
  -        temp.toString().getBytes(), SyncEvent.MODIFIED);
  -        client.getLock(event);
  -        
  -        // Once the lock is granted, perform the actual "EditEventAction"
  -        final String result = super.doAction(request, form);
  -        
  -        // Finally, unlock the event and return the result
  -        client.unlock(event);       
  -        return result;
  -    }   
  +        try {
  +            /* First, we need to check that a concurrent access to the edited
  +             * Event is not being accessed by another process */
  +            EventVO temp = form.getEditEvent();
  +            event = new SyncEvent(new Integer(temp.getId()).toString(),
  +            temp.toString().getBytes(), SyncEvent.MODIFIED);
  +            client.getLock(event);
  +            
  +            
  +            // Once the lock is granted, perform the actual "EditEventAction"
  +            result = super.doAction(request, form);
  +            
  +            // Finally, unlock the event and return the result
  +            client.unlock(event);
  +            
  +        } catch (Exception e) {
  +            throw new SyncException(e.getMessage(), e);
  +            
  +        } finally {
  +            client.unlock(event);
  +            return result;
  +        }
  +    }
   }
  

Reply via email to