Examples of create()


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

      InitialContext jndiContext = new InitialContext();
      Object obj = jndiContext.lookup("spec.CallerBean");
      obj = PortableRemoteObject.narrow(obj, CalledSessionHome.class);
      CalledSessionHome home = (CalledSessionHome) obj;
      log.debug("Found spec.CallerBean Home");
      CalledSession bean = home.create();
      log.debug("Created spec.CallerBean");
      log.debug("Bean.invokeEcho('testLocalMethodAccess') -> "+bean.invokeEcho("testLocalMethodAccess"));
      bean.remove();
      sc.logout();
   }

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

         InitialContext ic = new InitialContext();
         Context enc = (Context) ic.lookup("java:comp/env");
         Object ref = enc.lookup("ejb/CallerHome");
         CalledSessionLocalHome home = (CalledSessionLocalHome) PortableRemoteObject.narrow(ref,
            CalledSessionLocalHome.class);
         CalledSessionLocal bean = home.create();
         String echo2 = bean.invokeEcho(arg + "Level1");
         log.debug("echo, callee.invokeEcho=" + echo2);
         return echo2;
      }
      catch (Exception e)

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

      login();
      Object obj = getInitialContext().lookup("jaas.CustomPrincipalHome");
      obj = PortableRemoteObject.narrow(obj, CustomPrincipalHome.class);
      CustomPrincipalHome home = (CustomPrincipalHome) obj;
      log.debug("Found CustomPrincipalHome");
      CustomPrincipal bean = home.create();
      log.debug("Created CustomPrincipal");

      boolean isCustomType = bean.validateCallerPrincipal(CustomPrincipalImpl.class);
      bean.remove();
      logout();

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

         {
            bean3 = home3.findByPrimaryKey("validateCallerContext");
         }
         catch(FinderException e)
         {
            bean3 = home3.create("validateCallerContext");           
         }
         bean3.echo("validateCallerContext");
      }
      catch(Exception e)
      {

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

      login();
      Object obj = getInitialContext().lookup("security-proxy/ProxiedStatelessBean");
      obj = PortableRemoteObject.narrow(obj, IOSessionHome.class);
      IOSessionHome home = (IOSessionHome) obj;
      log.debug("Found IOSessionHome");
      IOSession bean = home.create();
      log.debug("Created IOSession");
     
      try
      {
         // This should not be allowed

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

         String name = message.getStringProperty("name");
         ProjRepositoryHome home = (ProjRepositoryHome) iniCtx.lookup("java:comp/env/ejb/ProjRepository");
         NameParser parser = iniCtx.getNameParser("");
         Name projName = parser.parse(name);
         // This requires the ProjectAdmin role
         ProjRepository bean = home.create(projName);
         // This requires CreateFolder role
         Name programs = parser.parse("/Programs Files");
         bean.createFolder(programs);
         // This requires DeleteFolder role
         bean.deleteFolder(programs, true);

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

      RunAsServiceRemote bean = null;
      try
      {
         InitialContext ctx = new InitialContext();
         RunAsServiceRemoteHome home = (RunAsServiceRemoteHome) ctx.lookup("jacc/RunAs");
         bean = home.create();
      }
      catch(Exception e)
      {
         throw new EJBException("Failed to create RunAsServiceRemote", e);
      }

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

      InitialContext ctx = new InitialContext(env);
      Object obj = ctx.lookup("jacc/Secured");
      obj = PortableRemoteObject.narrow(obj, SecuredServiceRemoteHome.class);
      SecuredServiceRemoteHome home = (SecuredServiceRemoteHome) obj;
      log.debug("Found SecuredServiceRemoteHome");
      SecuredServiceRemote bean = home.create();
      log.debug("Created SecuredServiceRemote");

      Principal callerIdentity = new SimplePrincipal("jduke");
      Principal runAsIdentity = new SimplePrincipal("runAsUser");
      HashSet expectedCallerRoles = new HashSet();

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

      log.debug("+++ testDomainInteraction()");
      Object obj = getInitialContext().lookup("spec.UserInRoleContextSession");
      obj = PortableRemoteObject.narrow(obj, SecurityContextHome.class);
      SecurityContextHome home = (SecurityContextHome) obj;
      log.debug("Found UserInRoleContextSession");
      SecurityContext bean = home.create();
      log.debug("Created spec.UserInRoleContextSession");
      HashSet roles = new HashSet();
      roles.add("Role1");
      roles.add("Role2");
      bean.testDomainInteraction(roles);

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

      Object obj = jndiContext.lookup("spec.StatefulSession");
      obj = PortableRemoteObject.narrow(obj, StatefulSessionHome.class);
      StatefulSessionHome home = (StatefulSessionHome) obj;
      log.debug("Found StatefulSessionHome");
      // The create should be allowed to call getCallerPrincipal
      StatefulSession bean = home.create("testStatefulCreateCaller");
      // Need to invoke a method to ensure an ejbCreate call
      bean.echo("testStatefulCreateCaller");
      log.debug("Bean.echo(), ok");

      logout();
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.