|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.easybeans.tests.enhancer.interceptors.business.bean.StatelessBean
public class StatelessBean
Simple class for testing interceptors.
Field Summary | |
---|---|
private int |
counter
Counter of intercepted methods. |
private int |
otherInterceptorCounter
Counter of intercepted methods by an external interceptor. |
private int |
singleMethodInterceptedCounter
Counter of intercepted calls on singleMethodIntercepted. |
Constructor Summary | |
---|---|
StatelessBean()
|
Method Summary | |
---|---|
int |
addInt(int i,
int j)
Adds two int. |
void |
excludedInterceptorsMethod()
Test that no interceptors are called on this method. |
boolean |
getBoolean(boolean b)
Test method on boolean. |
boolean[] |
getBooleans(boolean[] booleans)
Test method on boolean. |
byte |
getByte(byte i)
Test method on byte. |
byte[] |
getBytes(byte[] bytes)
Test method on byte. |
char |
getChar(char c)
Test method on char. |
char[] |
getChars(char[] chars)
Test method on char. |
int |
getCounter()
|
double |
getDouble(double d)
Test method on double. |
double[] |
getDoubles(double[] doubles)
Test method on double. |
float |
getFloat(float f)
Test method on float. |
float[] |
getFloats(float[] floats)
Test method on float. |
int |
getIncrementSingleMethodInterceptedCounter()
|
int |
getInt(int i)
Test method on int. |
int[] |
getInts(int[] ints)
Test method on int. |
long |
getLong(long l)
Test method on long. |
long[] |
getLongs(long[] longs)
Test method on long. |
int |
getOtherInterceptorCounter()
|
java.lang.Object[] |
getPrimitive(boolean flag,
byte b,
char c,
double d,
float f,
int i,
long l,
java.lang.Object o)
Test method on primitive. |
short |
getShort(short s)
Test method on short. |
short[] |
getShorts(short[] shorts)
Test method on short. |
void |
incrementOtherInterceptorCounter()
Increment the value of the counter used by other interceptors. |
void |
incrementSingleMethodInterceptedCounter()
Increment the value of the counter used by single method interceptor. |
java.lang.Object |
intercepted(javax.ejb.InvocationContext invocationContext)
Do some stuff while intercepting methods. |
void |
methodNotInAllInterface()
-----------------------------------------. |
void |
singleMethodIntercepted()
Test interceptor which is applied only on a single method. |
void |
someCustomizedExceptions()
Throws a user defined exception. |
void |
someCustomizedExceptions2(int value)
Throws user defined exceptions. |
void |
someCustomizedExceptions3(int value)
Throws user defined exceptions. |
void |
throwExceptionByInterceptor()
Method do nothing but the interceptor will throw an exception. |
int |
valueDoubledByInterceptor(int i)
Change the return value by the interceptor. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private int counter
private int otherInterceptorCounter
private int singleMethodInterceptedCounter
Constructor Detail |
---|
public StatelessBean()
Method Detail |
---|
public boolean getBoolean(boolean b)
getBoolean
in interface StatelessLocalItf
b
- value to return
public boolean[] getBooleans(boolean[] booleans)
getBooleans
in interface StatelessLocalItf
booleans
- array to return
public byte getByte(byte i)
getByte
in interface StatelessLocalItf
i
- value to return
public byte[] getBytes(byte[] bytes)
getBytes
in interface StatelessLocalItf
bytes
- array to return
public char getChar(char c)
getChar
in interface StatelessLocalItf
c
- value to return
public char[] getChars(char[] chars)
getChars
in interface StatelessLocalItf
chars
- array to return
public double getDouble(double d)
getDouble
in interface StatelessLocalItf
d
- value to return
public double[] getDoubles(double[] doubles)
getDoubles
in interface StatelessLocalItf
doubles
- array to return
public float getFloat(float f)
getFloat
in interface StatelessLocalItf
f
- value to return
public float[] getFloats(float[] floats)
getFloats
in interface StatelessLocalItf
floats
- array to return
public int getInt(int i)
getInt
in interface StatelessLocalItf
i
- value to return
public int addInt(int i, int j)
addInt
in interface StatelessLocalItf
i
- first valuej
- second value
public int[] getInts(int[] ints)
getInts
in interface StatelessLocalItf
ints
- array to return
public long getLong(long l)
getLong
in interface StatelessLocalItf
l
- value to return
public long[] getLongs(long[] longs)
getLongs
in interface StatelessLocalItf
longs
- array to return
public short getShort(short s)
getShort
in interface StatelessLocalItf
s
- value to return
public short[] getShorts(short[] shorts)
getShorts
in interface StatelessLocalItf
shorts
- array to return
public java.lang.Object[] getPrimitive(boolean flag, byte b, char c, double d, float f, int i, long l, java.lang.Object o)
getPrimitive
in interface StatelessLocalItf
flag
- value to returnb
- value to returnc
- value to returnd
- value to returnf
- value to returni
- value to returnl
- value to returno
- value to return
public void methodNotInAllInterface()
methodNotInAllInterface
in interface StatelessLocalBisItf
public void someCustomizedExceptions() throws TestException
someCustomizedExceptions
in interface StatelessLocalItf
TestException
- an user defined exceptionpublic void someCustomizedExceptions2(int value) throws TestException, TestException2
someCustomizedExceptions2
in interface StatelessLocalItf
value
- depending of the value, throw different exceptions.
TestException
- an user defined exception
TestException2
- another user defined exceptionpublic void someCustomizedExceptions3(int value) throws java.lang.Exception
someCustomizedExceptions3
in interface StatelessLocalItf
value
- depending of the value, throw different exceptions
java.lang.Exception
- another exceptionpublic void throwExceptionByInterceptor()
throwExceptionByInterceptor
in interface StatelessLocalItf
public int valueDoubledByInterceptor(int i)
valueDoubledByInterceptor
in interface StatelessLocalItf
i
- value to be add twice.
public java.lang.Object intercepted(javax.ejb.InvocationContext invocationContext) throws java.lang.Exception
invocationContext
- contains attributes of invocation
java.lang.Exception
- if invocation failspublic int getCounter()
public int getOtherInterceptorCounter()
public void incrementOtherInterceptorCounter()
public void singleMethodIntercepted()
singleMethodIntercepted
in interface StatelessLocalItf
public void incrementSingleMethodInterceptedCounter()
public int getIncrementSingleMethodInterceptedCounter()
public void excludedInterceptorsMethod()
excludedInterceptorsMethod
in interface StatelessLocalItf
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |