[[space_tap]]
== SpaceTap

SpaceTap is a +SpaceListener+ that can be used to monitor a given LocalSpace
for new entries under a given key. 

Once a SpaceTap is created, it register itself as a listener in the 
source LocalSpace and copies all new entries to a destination space.  

.Space Tap
image:images/SpaceTap.jpg[width="400px",alt="SpaceTap"]

If you have a source LocalSpace +ssp+ and a destination LocalSpace +dsp+ and
you want to monitor an entry called "ERRORS", we can use code like this: 

[source,java]
----

   SpaceTap spt = new SpaceTap (ssp, dsp, "ERRORS", "ERRORS.COPY", 5000L);
 
----

[TIP]
====

If your "source" space and "destination" space are the same, you can use
the shorter constructor:
[source,java]
----

   SpaceTap (LocalSpace ssp, Object key, Object tapKey, long timeout);
  
----

====

The SpaceTap can be used for system monitoring purposes as it provides a
non-intrusive way to "tap" any given space queue. 

