Examples of EntityHome


Examples of org.jboss.seam.framework.EntityHome

    * provides a type parameter in the class definition
    */
   @Test
   public void testReadEntityClassFromTypeParameter()
   {
      EntityHome typelessHome = new EntityHome();
      typelessHome.setEntityClass(SimpleEntity.class);
      assert typelessHome.getEntityClass() == SimpleEntity.class;
     
      assert new SimpleEntityHomeWithType().getEntityClass() == SimpleEntity.class;

      try
      {
View Full Code Here

Examples of org.jboss.test.perf.interfaces.EntityHome

   public void testFindByPrimaryKey() throws Exception
   {
      getLog().debug("+++ testFindByPrimaryKey()");
      Object obj = getInitialContext().lookup(ENTITY);
      obj = PortableRemoteObject.narrow(obj, EntityHome.class);
      EntityHome home = (EntityHome) obj;
      getLog().debug("Found EntityHome @ jndiName=Entity");
      EntityPK key = new EntityPK(0);
      Entity bean = null;

      getLog().debug("Running with " + iterationCount + " instances...");
View Full Code Here

Examples of org.jboss.test.perf.interfaces.EntityHome

   private void createEntityBeans(int max) throws Exception
   {
      String jndiName = isSecure ? "secure/perf/Entity" : "perfEntity";
      Object obj = getInitialContext().lookup(jndiName);
      obj = PortableRemoteObject.narrow(obj, EntityHome.class);
      EntityHome home = (EntityHome) obj;
      getLog().debug("Creating "+max+" Entity beans");
      for(int n = 0; n < max; n ++)
         home.create(n, n);
   }
View Full Code Here

Examples of org.jboss.test.perf.interfaces.EntityHome

   private void removeEntityBeans(int max) throws Exception
   {
      String jndiName = isSecure ? "secure/perf/Entity" : "perfEntity";
      Object obj = getInitialContext().lookup(jndiName);
      obj = PortableRemoteObject.narrow(obj, EntityHome.class);
      EntityHome home = (EntityHome) obj;
      getLog().debug("Removing "+max+" Entity beans");
      for(int n = 0; n < max; n ++)
         home.remove(new EntityPK(n));
   }
View Full Code Here

Examples of org.jboss.test.security.interfaces.EntityHome

        log.debug("echo, callerPrincipal="+p);
        String echo = null;
        try
        {
            InitialContext ctx = new InitialContext();
            EntityHome home = (EntityHome) ctx.lookup("java:comp/env/ejb/Entity");
            Entity bean = home.findByPrimaryKey(arg);
            echo = bean.echo(arg);
        }
        catch(Exception e)
        {
            log.debug("Entity.echo failed", e);
View Full Code Here

Examples of org.jboss.test.security.interfaces.EntityHome

      log.debug("echo, callerPrincipal="+p);
      String echo = null;
      try
      {
         InitialContext ctx = new InitialContext();
         EntityHome home = (EntityHome) ctx.lookup("java:comp/env/ejb/Entity");
         Entity bean = home.findByPrimaryKey(arg);
         echo = bean.echo(arg);
      }
      catch(Exception e)
      {
         log.debug("failed", e);
View Full Code Here

Examples of org.jboss.test.security.interfaces.EntityHome

         StatefulSession bean2 = home2.create("validateCallerContext");
         bean2.echo("validateCallerContext");
         validatePolicyContextSubject("post stateful", callerPrincipals);
         validateSecurityAssociationSubject("post stateful", callerPrincipals);

         EntityHome home3 = (EntityHome)
            ctx.lookup("java:comp/env/ejb/Entity");
         Entity bean3 = null;
         try
         {
            bean3 = home3.findByPrimaryKey("validateCallerContext");
         }
         catch(FinderException e)
         {
            bean3 = home3.create("validateCallerContext");           
         }
         bean3.echo("validateCallerContext");
      }
      catch(Exception e)
      {
View Full Code Here

Examples of org.jboss.test.security.interfaces.EntityHome

      Queue replyTo = null;
      try
      {
         replyTo = (Queue) message.getJMSReplyTo();
         String arg = message.getStringProperty("arg");
         EntityHome home = (EntityHome) iniCtx.lookup("java:comp/env/ejb/Entity");
         Entity bean = home.findByPrimaryKey(arg);
         String echo = bean.echo(arg);
         log.info("RunAsMDB echo("+arg+") -> "+echo);
         sendReply(replyTo, arg);
      }
      catch(Throwable e)
View Full Code Here

Examples of org.jboss.test.web.interfaces.EntityHome

    {
        try
        {
            InitialContext ctx = new InitialContext();
            Context enc = (Context) ctx.lookup("java:comp/env");
            EntityHome home = (EntityHome) enc.lookup("ejb/Entity");
            try
            {
               //Remove old entity beans from previous test runs
               Entity existing = home.findByPrimaryKey(new EntityPK(12345));
               if(existing != null)
               {
                  existing.remove();
               }
            }
            catch(Exception e)
            {
               //ignore
            }
            Entity bean = home.create(12345, 6789);
            bean.write(7890);
            bean.read();
            bean.remove();
        }
        catch(Exception e)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.