FileDocCategorySizeDatePackage
SecuredStatelessBean.javaAPI DocJBoss 4.2.13117Fri Jul 13 20:53:36 BST 2007org.jboss.ejb3.test.asynchronous

SecuredStatelessBean

public class SecuredStatelessBean extends Object implements SecuredStatelessLocal, SecuredStatelessRemote
author
Kabir Khan
version
$Revision: 57207 $

Fields Summary
public SecuredStatelessLocal
local
Constructors Summary
Methods Summary
public intexcludedMethod(int i)

      return i;
   
private java.lang.ObjectgetReturnOrException(java.lang.Object proxy)

      try
      {
         Future future = Asynch.getFutureResult(proxy);

         while (!future.isDone())
         {
            Thread.sleep(100);
         }
         return future.get();
      }
      catch(InvocationTargetException e)
      {
         return e.getCause();
      }
      catch (InterruptedException e)
      {
         throw new RuntimeException("Bummer");
      }
   
public intlocalSecured(int i)

      return i;
   
public intmethod(int i)

      SecuredStatelessLocal asynchLocal = (SecuredStatelessLocal)Asynch.getAsynchronousProxy(local);

      asynchLocal.excludedMethod(i);
      Object ret = getReturnOrException(asynchLocal);
      if (!(ret instanceof EJBAccessException))
      {
         throw new RuntimeException("Local excluded method call did not cause a SecurityException");
      }

      asynchLocal.localSecured(i);
      ret = getReturnOrException(asynchLocal);
      return (Integer)ret;
   
public intuncheckedMethod(int i)

      return i;