User: starksm
Date: 01/07/11 01:30:34
Modified: src/main/org/jboss/test/security/ejb EntityBeanImpl.java
Log:
Add basic performace tests of cmp entity findByPrimaryKey and stateless
session transacted method invocations.
Revision Changes Path
1.3 +68 -66
jbosstest/src/main/org/jboss/test/security/ejb/EntityBeanImpl.java
Index: EntityBeanImpl.java
===================================================================
RCS file:
/cvsroot/jboss/jbosstest/src/main/org/jboss/test/security/ejb/EntityBeanImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- EntityBeanImpl.java 2001/06/13 04:55:50 1.2
+++ EntityBeanImpl.java 2001/07/11 08:30:34 1.3
@@ -1,66 +1,68 @@
-package org.jboss.test.security.ejb;
-
-import java.rmi.RemoteException;
-import java.security.Principal;
-import javax.ejb.*;
-
-/** A BMP entity bean that creates beans on the fly with
-a key equal to that passed to findByPrimaryKey. Obviously
-not a real entity bean. It is used to test Principal propagation
-using the echo method.
-
-@author [EMAIL PROTECTED]
-@version $Revision: 1.2 $
-*/
-public class EntityBeanImpl implements EntityBean
-{
- private String key;
- private EntityContext context;
-
- public void ejbActivate()
- {
- System.out.println("EntityBean.ejbActivate() called");
- }
-
- public void ejbPassivate()
- {
- System.out.println("EntityBean.ejbPassivate() called");
- }
-
- public void ejbRemove()
- {
- System.out.println("EntityBean.ejbRemove() called");
- }
- public void ejbLoad()
- {
- System.out.println("EntityBean.ejbLoad() called");
- key = (String) context.getPrimaryKey();
- }
- public void ejbStore()
- {
- System.out.println("EntityBean.ejbStore() called");
- }
-
- public void setEntityContext(EntityContext context)
- {
- this.context = context;
- }
- public void unsetEntityContext()
- {
- this.context = null;
- }
-
- public String echo(String arg)
- {
- System.out.println("EntityBean.echo, arg="+arg);
- Principal p = context.getCallerPrincipal();
- System.out.println("EntityBean.echo, callerPrincipal="+p);
- return p.getName();
- }
-
- public String ejbFindByPrimaryKey(String key)
- {
- System.out.println("EntityBean.ejbFindByPrimaryKey, key="+key);
- return key;
- }
-}
+package org.jboss.test.security.ejb;
+
+import java.rmi.RemoteException;
+import java.security.Principal;
+import javax.ejb.*;
+
+/** A BMP entity bean that creates beans on the fly with
+a key equal to that passed to findByPrimaryKey. Obviously
+not a real entity bean. It is used to test Principal propagation
+using the echo method.
+
+@author [EMAIL PROTECTED]
+@version $Revision: 1.3 $
+*/
+public class EntityBeanImpl implements EntityBean
+{
+ private String key;
+ private EntityContext context;
+
+ public void ejbActivate()
+ {
+ System.out.println("EntityBean.ejbActivate() called");
+ }
+
+ public void ejbPassivate()
+ {
+ System.out.println("EntityBean.ejbPassivate() called");
+ }
+
+ public void ejbRemove()
+ {
+ System.out.println("EntityBean.ejbRemove() called");
+ }
+ public void ejbLoad()
+ {
+ System.out.println("EntityBean.ejbLoad() called");
+ key = (String) context.getPrimaryKey();
+ }
+ public void ejbStore()
+ {
+ System.out.println("EntityBean.ejbStore() called");
+ }
+
+ public void setEntityContext(EntityContext context)
+ {
+ this.context = context;
+ }
+ public void unsetEntityContext()
+ {
+ this.context = null;
+ }
+
+ public String echo(String arg)
+ {
+ System.out.println("EntityBean.echo, arg="+arg);
+ Principal p = context.getCallerPrincipal();
+ boolean isInternalRole = context.isCallerInRole("InternalRole");
+ System.out.println("EntityBean.echo, callerPrincipal="+p);
+ System.out.println("EntityBean.echo,
isCallerInRole('InternalRole')="+isInternalRole);
+ return p.getName();
+ }
+
+ public String ejbFindByPrimaryKey(String key)
+ {
+ System.out.println("EntityBean.ejbFindByPrimaryKey, key="+key);
+ return key;
+ }
+}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development