Examples of create()


Examples of org.jboss.test.security.interfaces.StatelessSessionHome.create()

      StatelessSessionHome home = (StatelessSessionHome) obj;
      log.debug("Found null.StatelessSession Home");
      StatelessSession bean = null;
      try
      {
         bean = home.create();
         fail("Invoking create() should fail");
      }
      catch (Exception e)
      {
         Throwable t = e.getCause();

Examples of org.jboss.test.security.interfaces.StatelessSessionLocalHome.create()

         InitialContext ic = new InitialContext();
         Context enc = (Context) ic.lookup("java:comp/env");
         Object ref = enc.lookup("ejb/local/CalleeHome");
         StatelessSessionLocalHome localHome = (StatelessSessionLocalHome) PortableRemoteObject.narrow(ref,
            StatelessSessionLocalHome.class);
         StatelessSessionLocal localBean = localHome.create();
         String echo2 = localBean.echo(arg);
         log.debug("echo#1, callee.echo=" + echo2);
         echo2 = localBean.echo(arg);
         log.debug("echo#2, callee.echo=" + echo2);
      }

Examples of org.jboss.test.security.interfaces.SubjectSessionHome.create()

      InitialContext ctx = new InitialContext(env);
      Object obj = ctx.lookup("caller-info.SubjectSessionFacade");
      obj = PortableRemoteObject.narrow(obj, SubjectSessionHome.class);
      SubjectSessionHome home = (SubjectSessionHome) obj;
      log.debug("Found CustomPrincipalHome");
      SubjectSession bean = home.create();
      log.debug("Created CustomPrincipal");

      HashSet principals = new HashSet();
      principals.add(new SimplePrincipal("CallerInfoFacadeRole"));
      principals.add(new SimplePrincipal("CallerInfoStatelessRole"));

Examples of org.jboss.test.security.interfaces.UsefulStatelessSessionHome.create()

   {
      login("anil","opensource".toCharArray());
      Object obj = getInitialContext().lookup("bean1.UsefulStatelessSessionBean");
      obj = PortableRemoteObject.narrow(obj, UsefulStatelessSessionHome.class);
      UsefulStatelessSessionHome home = (UsefulStatelessSessionHome) obj;
      UsefulStatelessSession bean = home.create()
      assertEquals("NiceUser is true", "true", ""+bean.isCallerInRole("NiceUser") );
      assertEquals("BadRole is false", "false", ""+bean.isCallerInRole("BadRole") );
      bean.remove();
      logout();
   }

Examples of org.jboss.test.securitymgr.interfaces.BadHome.create()

   private Bad getBadSession() throws Exception
   {
      Object obj = getInitialContext().lookup("secmgr.BadHome");
      BadHome home = (BadHome) obj;
      log.debug("Found secmgr.BadHome");
      Bad bean = home.create();
      log.debug("Created Bad");
      return bean;
   }
}

Examples of org.jboss.test.securitymgr.interfaces.IOSessionHome.create()

   private IOSession getIOSession() throws Exception
   {
      Object obj = getInitialContext().lookup("secmgr.IOSessionHome");
      IOSessionHome home = (IOSessionHome) obj;
      log.debug("Found secmgr.IOSessionHome");
      IOSession bean = home.create();
      log.debug("Created IOSession");
      return bean;
   }

   private void doFail(String msg)

Examples of org.jboss.test.session.interfaces.CountedSessionHome.create()

      CountedSessionHome countedHome = (CountedSessionHome)getInitialContext().lookup("CountedSession");
     
      CounterSession counter = counterHome.create();
      counter.clearCounters();
     
      CountedSession counted = countedHome.create();
      assertEquals("createCounter", 1, counter.getCreateCounter());
      assertEquals("removeCounter", 1, counter.getRemoveCounter());
     
      counted.doSomething(0);
      assertEquals("createCounter", 2, counter.getCreateCounter());

Examples of org.jboss.test.session.interfaces.CounterSessionHome.create()

   public void testEjbRemoveCalledForEveryCall() throws Exception
   {
      CounterSessionHome counterHome = (CounterSessionHome)getInitialContext().lookup("CounterSession");
      CountedSessionHome countedHome = (CountedSessionHome)getInitialContext().lookup("CountedSession");
     
      CounterSession counter = counterHome.create();
      counter.clearCounters();
     
      CountedSession counted = countedHome.create();
      assertEquals("createCounter", 1, counter.getCreateCounter());
      assertEquals("removeCounter", 1, counter.getRemoveCounter());

Examples of org.jboss.test.sessionsync.interfaces.ActionExecutorHome.create()

    * @throws Exception
    */
   public void testBeforeCompletion() throws Exception
   {
      ActionExecutorHome executorHome = (ActionExecutorHome) getInitialContext().lookup("ActionExecutorBean");
      ActionExecutor executor = executorHome.create();

      StatefulSessionHome sessionHome = (StatefulSessionHome) getInitialContext().lookup("StatefulSessionBean");
      final StatefulSession session = sessionHome.create();
      try
      {

Examples of org.jboss.test.sessionsync.interfaces.StatefulSessionHome.create()

   {
      ActionExecutorHome executorHome = (ActionExecutorHome) getInitialContext().lookup("ActionExecutorBean");
      ActionExecutor executor = executorHome.create();

      StatefulSessionHome sessionHome = (StatefulSessionHome) getInitialContext().lookup("StatefulSessionBean");
      final StatefulSession session = sessionHome.create();
      try
      {

         assertEquals("after-begin", executor.execute(new GetAfterBeginEntryAction(session.getHandle())));
         assertEquals("before-completion", executor.execute(new GetBeforeCompletionEntryAction(session.getHandle())));
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.