FileDocCategorySizeDatePackage
StatelessBean.javaAPI DocJBoss 4.2.12499Fri Jul 13 20:53:10 BST 2007org.jboss.ejb3.test.clientinterceptor

StatelessBean

public class StatelessBean extends Object implements StatelessRemote
author
Kabir Khan
version
$Revision: 60233 $

Fields Summary
boolean
interceptorFired
Constructors Summary
Methods Summary
public java.lang.Objectintercept(javax.interceptor.InvocationContext ctx)

      System.out.println("intercept()");
      String asisData = (String)ctx.getContextData().get("as_is");

      if (!"AS_IS".equals(asisData))
      {
         throw new RuntimeException("Wrong test metadata: " + asisData);
      }

      NeedsMarshallingValue marshalledValue = (NeedsMarshallingValue)ctx.getContextData().get("marshalled");
      if (marshalledValue == null)
      {
         throw new RuntimeException("Null marshalled value");
      }

      if (!marshalledValue.getValue().equals("NEEDS MARSHALLING"))
      {
         throw new RuntimeException("Wrong marshalled value: " + marshalledValue.getValue());
      }

      System.out.println("values ok");
      interceptorFired = true;
      return ctx.proceed();
   
public voidtest()

      System.out.println("test()");
      if (!interceptorFired) throw new RuntimeException("interceptor did not work");