|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.omnaest.utils.proxy.MethodInvocationForwardingCapturer
public class MethodInvocationForwardingCapturer
The MethodInvocationForwardingCapturer allows to create proxies which are put on top of existing object instances. The
created proxy will then capture all method invocations and write them as xml format to a given OutputStream. The method
invocation will also be forwared to the original object method.
To capture
newProxyInstanceCapturing(Object, OutputStream)| Nested Class Summary | |
|---|---|
protected static class |
MethodInvocationForwardingCapturer.ForwardingMethodInvocationHandler
|
protected static class |
MethodInvocationForwardingCapturer.MethodAndArguments
Wrapper for Method and arguments which implements MethodInvocationForwardingCapturer.MethodAndArguments.hashCode() and MethodInvocationForwardingCapturer.MethodAndArguments.equals(Object) |
static class |
MethodInvocationForwardingCapturer.MethodInvocationAndResult
|
protected static interface |
MethodInvocationForwardingCapturer.MethodInvocationComparison
|
protected static class |
MethodInvocationForwardingCapturer.MethodOnly
|
protected static class |
MethodInvocationForwardingCapturer.ReplayingMethodInvocationHandler
|
| Method Summary | ||
|---|---|---|
static void |
closeCapturingOutputStream(OutputStream outputStream)
Closes a given OutputStream which is used by a created proxy. |
|
static ElementStream<MethodInvocationForwardingCapturer.MethodInvocationAndResult> |
newMethodInvocationAndResultElementStream(InputStream inputStream)
Creates an ElementStream of MethodInvocationForwardingCapturer.MethodInvocationAndResult instances from a given InputStream which was
produced by the newProxyInstanceCapturing(Object, OutputStream) before. |
|
static Iterable<MethodInvocationForwardingCapturer.MethodInvocationAndResult> |
newMethodInvocationAndResultIterable(InputStream inputStream)
|
|
static Iterable<MethodInvocationForwardingCapturer.MethodInvocationAndResult> |
newMethodInvocationAndResultIterable(InputStream inputStream,
Range range)
Returns only the MethodInvocationForwardingCapturer.MethodInvocationAndResult instances within the given Range of the index positions of the
order of invocation. |
|
protected static Iterator<MethodInvocationForwardingCapturer.MethodInvocationAndResult> |
newMethodInvocationAndResultIterator(InputStream inputStream)
|
|
static
|
newProxyInstanceCapturing(T object,
OutputStream outputStream)
Returns a new proxy instance which will forward all method invocations to the given object but also captures the invocations to put them into the OutputStream as xml. |
|
static
|
newProxyInstanceReplaying(Class<T> type,
InputStream inputStream,
boolean ignoreArgumentValues)
Returns a new proxy instance which replays a previously recorded behavior when a method of it is invoked. |
|
static
|
newProxyInstanceReplaying(Class<T> type,
InputStream inputStream,
boolean ignoreArgumentValues,
Range range)
Returns a new proxy instance which replays a previously recorded behavior when a method of it is invoked. |
|
protected static com.thoughtworks.xstream.XStream |
newXStream()
|
|
static void |
replayOn(InputStream inputStream,
Object object,
Range... ranges)
Replays previously recorded method invocations on a real Object with the same type. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static <T> T newProxyInstanceCapturing(T object,
OutputStream outputStream)
OutputStream as xml.
object - outputStream -
public static void closeCapturingOutputStream(OutputStream outputStream)
OutputStream which is used by a created proxy.
outputStream -
public static <T> T newProxyInstanceReplaying(Class<T> type,
InputStream inputStream,
boolean ignoreArgumentValues)
newProxyInstanceCapturing(Object, OutputStream)
type - inputStream - ignoreArgumentValues -
public static <T> T newProxyInstanceReplaying(Class<T> type,
InputStream inputStream,
boolean ignoreArgumentValues,
Range range)
newProxyInstanceCapturing(Object, OutputStream)
type - inputStream - ignoreArgumentValues - range -
public static void replayOn(InputStream inputStream,
Object object,
Range... ranges)
Object with the same type. Ranges which will result in only these method invocations being repeated, where
the index position is within at least one given Range. Range parameters are given all method invocations are applied to the given object.
inputStream - object - ranges - protected static com.thoughtworks.xstream.XStream newXStream()
public static ElementStream<MethodInvocationForwardingCapturer.MethodInvocationAndResult> newMethodInvocationAndResultElementStream(InputStream inputStream)
ElementStream of MethodInvocationForwardingCapturer.MethodInvocationAndResult instances from a given InputStream which was
produced by the newProxyInstanceCapturing(Object, OutputStream) before.
inputStream -
protected static Iterator<MethodInvocationForwardingCapturer.MethodInvocationAndResult> newMethodInvocationAndResultIterator(InputStream inputStream)
inputStream -
Iterator,
newMethodInvocationAndResultElementStream(InputStream)public static Iterable<MethodInvocationForwardingCapturer.MethodInvocationAndResult> newMethodInvocationAndResultIterable(InputStream inputStream)
inputStream -
newMethodInvocationAndResultElementStream(InputStream),
Iterable
public static Iterable<MethodInvocationForwardingCapturer.MethodInvocationAndResult> newMethodInvocationAndResultIterable(InputStream inputStream,
Range range)
MethodInvocationForwardingCapturer.MethodInvocationAndResult instances within the given Range of the index positions of the
order of invocation.Range the original Iterable is returned.
inputStream - range -
newMethodInvocationAndResultElementStream(InputStream),
Range,
Iterable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||