Simone let us know when you are done,
marc
|-----Original Message-----
|From: [EMAIL PROTECTED]
|[mailto:[EMAIL PROTECTED]]On Behalf Of jBoss CVS
|Development
|Sent: Monday, October 16, 2000 4:32 PM
|To: [EMAIL PROTECTED]
|Subject: [jBoss-Dev] CVS update:
|jboss/src/main/org/jboss/ejb/pluginsEntityInstanceInterceptor.java
|
|
| User: simone
| Date: 00/10/16 16:32:26
|
| Modified: src/java/org/apache/icalendar/properties Attendee.java
| PropWithPeople.java
| Added: src/java/org/apache/icalendar/properties
| AttendeeFactory.java CategoriesFactory.java
| CommentFactory.java ContactFactory.java
| ExceptionDateFactory.java
| ExceptionRecurFactory.java RDateFactory.java
| RecurPropFactory.java RelatedPropFactory.java
| RequestStatusFactory.java ResourcesFactory.java
| Log:
| Removed allowed fields hashtable parameter on the
|set(ServletRequest,String)
| methods
|
| Revision Changes Path
| 1.5 +73 -0
|icalendar/src/java/org/apache/icalendar/properties/Attendee.java
|
| Index: Attendee.java
| ===================================================================
| RCS file:
|/products/cvs/jetspeed/icalendar/src/java/org/apache/icalendar/prop
|erties/Attendee.java,v
| retrieving revision 1.4
| retrieving revision 1.5
| diff -u -r1.4 -r1.5
| --- Attendee.java 2000/10/03 18:25:41 1.4
| +++ Attendee.java 2000/10/16 23:32:20 1.5
| @@ -57,6 +57,8 @@
|
| import com.workingdogs.village.*;
|
| +import javax.servlet.*;
| +
| /**
| * The purpose of this class is to define the Attendee property of the
| * iCalendar protocol (rfc2445)
| @@ -665,6 +667,77 @@
| public String toICal() throws ICalendarException
| {
| return toICal(ATTENDEE_DESIGNATOR);
| + }
| +
| + /**
| + * The purpose of this method is to set the user type from a servlet
| + * request.
| + * @param req The servlet request where the information is stored.
| + * @param usertypefn The field name where the user type is stored.
| + */
| + protected void setUserType(ServletRequest req,
| + String usertypefn) throws ICalendarException
| + {
| + if(req != null)
| + {
| + if(req.getParameter(usertypefn) != null)
| + {
| + setUserType((String) req.getParameter(usertypefn));
| + }
| + }
| + }
| +
| + /**
| + * The purpose of this method is to set the participation
|from a servlet
| + * request.
| + * @param req The servlet request where the information is stored.
| + * @param participate The field name where the new
|participation value
| + * is stored.
| + */
| + protected void setParticipation(ServletRequest req,
| + String participate) throws ICalendarException
| + {
| + if(req != null)
| + {
| + if((req.getParameter(participate) != null))
| + {
| + setParticipation(req.getParameter(participate));
| + }
| + }
| + }
| +
| + /**
| + * The purpose of this method is to set the role from a
|servlet request.
| + * @param req The servlet request where the information is stored.
| + * @param rolefn The field name where the role is stored.
| + */
| + protected void setRole(ServletRequest req,
| + String rolefn) throws ICalendarException
| + {
| + if(req != null)
| + {
| + if(req.getParameter(rolefn) != null)
| + {
| + setRole(req.getParameter(rolefn));
| + }
| + }
| + }
| +
| + /**
| + * The purpose of this method is to set the RSVP from a
|servlet request.
| + * @param req The servlet request where the information is stored.
| + * @param rsvpfn The field name where the rsvp is stored.
| + */
| + protected void setRSVP(ServletRequest req, String rsvpfn)
| + throws ICalendarException
| + {
| + if(req != null)
| + {
| + if(req.getParameter(rsvpfn) != null)
| + {
| + setRSVP(req.getParameter(rsvpfn));
| + }
| + }
| }
|
| protected String paramstoICal() throws ICalendarException
|
|
|
| 1.4 +73 -0
|icalendar/src/java/org/apache/icalendar/properties/PropWithPeople.java
|
| Index: PropWithPeople.java
| ===================================================================
| RCS file:
|/products/cvs/jetspeed/icalendar/src/java/org/apache/icalendar/prop
|erties/PropWithPeople.java,v
| retrieving revision 1.3
| retrieving revision 1.4
| diff -u -r1.3 -r1.4
| --- PropWithPeople.java 2000/09/28 20:22:43 1.3
| +++ PropWithPeople.java 2000/10/16 23:32:23 1.4
| @@ -52,6 +52,7 @@
| import org.apache.icalendar.util.*;
| import org.apache.icalendar.parameters.*;
| import com.workingdogs.village.*;
| +import javax.servlet.*;
|
| /**
| * The purpose of this method is to define all the common elements of
| @@ -372,6 +373,78 @@
| {
| setValue(currentValue.asString());
| }
| + }
| + }
| + }
| +
| + /**
| + * The purpose of this method is to set the commen name parameter
| + * from a servlet request.
| + * @param req The servlet request where the information is stored.
| + * @param cnfn The common name field name
| + */
| + protected void setCommonName(ServletRequest req, String cnfn)
| + throws ICalendarException
| + {
| + if(req != null)
| + {
| + if(req.getParameter(cnfn) != null)
| + {
| + setCommonName(req.getParameter(cnfn));
| + }
| + }
| + }
| +
| + /**
| + * The purpose of this method is to set the directory parameter
| + * from a servlet request.
| + * @param req The servlet request where the information is stored.
| + * @param dirfn The directory field name
| + */
| + protected void setDirectoryParameter(ServletRequest req,
| + String dirfn) throws ICalendarException
| + {
| + if(req != null)
| + {
| + if(req.getParameter(dirfn) != null)
| + {
| + setDirectoryParameter(req.getParameter(dirfn));
| + }
| + }
| + }
| +
| + /**
| + * The purpose of this method is to set the sent by parameter
| + * from a servlet request.
| + * @param req The servlet request where the information is stored.
| + * @param sentbyfn The field name where the sent by
|parameter is stored.
| + */
| + public void setSentByParameter(ServletRequest req,
| + String sentbyfn) throws ICalendarException
| + {
| + if(req != null)
| + {
| + if(req.getParameter(sentbyfn) != null)
| + {
| + setSentByParameter(req.getParameter(sentbyfn));
| + }
| + }
| + }
| +
| + /**
| + * The purpose of this method is to set the value of this
|property from
| + * a servlet request.
| + * @param req The servlet request where the information is stored.
| + * @param valuefn The field name where the value is stored.
| + */
| + public void setValue(ServletRequest req, String valuefn)
| + throws ICalendarException
| + {
| + if(req != null)
| + {
| + if(req.getParameter(valuefn) != null)
| + {
| + setValue(req.getParameter(valuefn));
| }
| }
| }
|
|
|
| 1.1
|icalendar/src/java/org/apache/icalendar/properties/AttendeeFactory.java
|
| Index: AttendeeFactory.java
| ===================================================================
| package org.apache.icalendar.properties;
|
| import org.apache.icalendar.util.*;
| import org.apache.icalendar.properties.peer.*;
| import org.apache.icalendar.vobjects.*;
| import java.util.*;
|
| public class AttendeeFactory
| {
| public static Vector getRelatedAttendees(TopParent parent)
|throws Exception
| {
| return AttendeePeer.doSelect(PeerUtils.getRelatedCriteria(parent,
| AttendeePeer.PARENTS_TABLE, AttendeePeer.PARENTS_ID));
| }
| }
|
|
|
| 1.1
|icalendar/src/java/org/apache/icalendar/properties/CategoriesFactory.java
|
| Index: CategoriesFactory.java
| ===================================================================
| package org.apache.icalendar.properties;
|
| import org.apache.icalendar.util.*;
| import org.apache.icalendar.properties.peer.*;
| import org.apache.icalendar.vobjects.*;
| import java.util.*;
|
| public class CategoriesFactory
| {
| public static Vector getRelatedCategories(TopParent parent)
|throws Exception
| {
| return CategoriesPeer.doSelect(PeerUtils.getRelatedCriteria(
| parent, CategoriesPeer.PARENTS_TABLE,
| CategoriesPeer.PARENTS_ID));
| }
| }
|
|
|
| 1.1
|icalendar/src/java/org/apache/icalendar/properties/CommentFactory.java
|
| Index: CommentFactory.java
| ===================================================================
| package org.apache.icalendar.properties;
|
| import org.apache.icalendar.util.*;
| import org.apache.icalendar.properties.peer.*;
| import org.apache.icalendar.vobjects.*;
| import java.util.*;
|
| public class CommentFactory
| {
| public static Vector getRelatedComments(TopParent parent)
|throws Exception
| {
| return CommentPeer.doSelect(PeerUtils.getRelatedCriteria(parent,
| CommentPeer.PARENTS_TABLE, CommentPeer.PARENTS_ID));
| }
| }
|
|
|
| 1.1
|icalendar/src/java/org/apache/icalendar/properties/ContactFactory.java
|
| Index: ContactFactory.java
| ===================================================================
| package org.apache.icalendar.properties;
|
| import org.apache.icalendar.util.*;
| import org.apache.icalendar.properties.peer.*;
| import org.apache.icalendar.vobjects.*;
| import java.util.*;
|
| public class ContactFactory
| {
| public static Vector getRelatedContacts(TopParent parent)
|throws Exception
| {
| return ContactPeer.doSelect(PeerUtils.getRelatedCriteria(parent,
| ContactPeer.PARENTS_TABLE, ContactPeer.PARENTS_ID));
| }
| }
|
|
|
| 1.1
|icalendar/src/java/org/apache/icalendar/properties/ExceptionDateFac
|tory.java
|
| Index: ExceptionDateFactory.java
| ===================================================================
| package org.apache.icalendar.properties;
|
| import org.apache.icalendar.util.*;
| import org.apache.icalendar.properties.peer.*;
| import org.apache.icalendar.vobjects.*;
| import java.util.*;
|
| public class ExceptionDateFactory
| {
| public static Vector getRelatedExceptionDates(TopParent
|parent) throws
| Exception
| {
| return ExceptionDatePeer.doSelect(PeerUtils.getRelatedCriteria(
| parent, ExceptionDatePeer.PARENTS_TABLE,
| ExceptionDatePeer.PARENTS_ID));
| }
| }
|
|
|
|
| Modified: src/main/org/jboss/ejb/plugins
| EntityInstanceInterceptor.java
| Log:
| Updated for the new cache structure. Changed the sync object
|used by the locking logic
|
| Revision Changes Path
| 1.17 +15 -13
|jboss/src/main/org/jboss/ejb/plugins/EntityInstanceInterceptor.java
|
| Index: EntityInstanceInterceptor.java
| ===================================================================
| RCS file:
|/products/cvs/ejboss/jboss/src/main/org/jboss/ejb/plugins/EntityIns
|tanceInterceptor.java,v
| retrieving revision 1.16
| retrieving revision 1.17
| diff -u -r1.16 -r1.17
| --- EntityInstanceInterceptor.java 2000/10/09 20:15:37 1.16
| +++ EntityInstanceInterceptor.java 2000/10/16 23:32:26 1.17
| @@ -43,7 +43,7 @@
| * @see <related>
| * @author Rickard �berg ([EMAIL PROTECTED])
| * @author <a href="[EMAIL PROTECTED]">Marc Fleury</a>
| -* @version $Revision: 1.16 $
| +* @version $Revision: 1.17 $
| */
| public class EntityInstanceInterceptor
| extends AbstractInterceptor
| @@ -89,9 +89,9 @@
| ctx.unlock();
|
| // Still free? Not free if create() was called successfully
| - if (mi.getEnterpriseContext().getId() == null)
| + if (ctx.getId() == null)
| {
| - container.getInstancePool().free(mi.getEnterpriseContext());
| + container.getInstancePool().free(ctx);
| }
| else
| {
| @@ -112,12 +112,13 @@
| CacheKey key = (CacheKey) mi.getId();
|
| // Get cache
| - InstanceCache cache =
|((EntityContainer)getContainer()).getInstanceCache();
| -
| + EnterpriseInstanceCache cache =
|(EnterpriseInstanceCache)container.getInstanceCache();
| + Object mutex = cache.getLock(key);
| +
| EnterpriseContext ctx = null;
|
| // We synchronize the locking logic (so that the invoke
|is unsynchronized and can be reentrant)
| - synchronized (cache)
| + synchronized (mutex)
| {
| do
| {
| @@ -194,21 +195,21 @@
| {
| // Discard instance
| // EJB 1.1 spec 12.3.1
| -
|((EntityContainer)getContainer()).getInstanceCache().remove(key.id);
| +
|((EntityContainer)getContainer()).getInstanceCache().remove(key);
|
| throw e;
| } catch (RuntimeException e)
| {
| // Discard instance
| // EJB 1.1 spec 12.3.1
| -
|((EntityContainer)getContainer()).getInstanceCache().remove(key.id);
| +
|((EntityContainer)getContainer()).getInstanceCache().remove(key);
|
| throw e;
| } catch (Error e)
| {
| // Discard instance
| // EJB 1.1 spec 12.3.1
| -
|((EntityContainer)getContainer()).getInstanceCache().remove(key.id);
| +
|((EntityContainer)getContainer()).getInstanceCache().remove(key);
|
| throw e;
| } finally
| @@ -217,7 +218,7 @@
| if (ctx != null)
| {
|
| - synchronized (ctx) {
| + synchronized (mutex) {
|
| // unlock the context
| ctx.unlock();
| @@ -225,14 +226,16 @@
| if (ctx.getId() == null)
| {
| // Remove from cache
| - cache.remove(key.id);
| + cache.remove(key);
|
| // It has been removed -> send to free pool
| container.getInstancePool().free(ctx);
| }
|
| // notify the thread waiting on ctx
| - ctx.notifyAll();
| + synchronized (ctx) {
| + ctx.notifyAll();
| + }
| }
| }
| }
| @@ -283,4 +286,3 @@
| return false;
| }
| }
| -
|
|
|
|
|