Introduce a new client listener interface for the Java agent
[lttng-ust.git] / liblttng-ust-java-agent / java / lttng-ust-agent-common / org / lttng / ust / agent / client / LttngTcpSessiondClient.java
index 8fb0f5a5b81db230d218b5ac040174f00c9b231d..d8788d320c416a9b9538bed603f7a9b45a8ca4cf 100644 (file)
@@ -31,8 +31,6 @@ import java.nio.ByteOrder;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
-import org.lttng.ust.agent.AbstractLttngAgent;
-
 /**
  * Client for agents to connect to a local session daemon, using a TCP socket.
  *
@@ -56,21 +54,26 @@ public class LttngTcpSessiondClient implements Runnable {
        private DataInputStream inFromSessiond;
        private DataOutputStream outToSessiond;
 
-       private final AbstractLttngAgent<?> logAgent;
+       private final ILttngTcpClientListener logAgent;
+       private final int domainValue;
        private final boolean isRoot;
 
-
        /**
         * Constructor
         *
         * @param logAgent
-        *            The logging agent this client will operate on.
+        *            The listener this client will operate on, typically an LTTng
+        *            agent.
+        * @param domainValue
+        *            The integer to send to the session daemon representing the
+        *            tracing domain to handle.
         * @param isRoot
         *            True if this client should connect to the root session daemon,
         *            false if it should connect to the user one.
         */
-       public LttngTcpSessiondClient(AbstractLttngAgent<?> logAgent, boolean isRoot) {
+       public LttngTcpSessiondClient(ILttngTcpClientListener logAgent, int domainValue, boolean isRoot) {
                this.logAgent = logAgent;
+               this.domainValue = domainValue;
                this.isRoot = isRoot;
        }
 
@@ -206,7 +209,7 @@ public class LttngTcpSessiondClient implements Runnable {
                ByteBuffer buf = ByteBuffer.wrap(data);
                String pid = ManagementFactory.getRuntimeMXBean().getName().split("@")[0];
 
-               buf.putInt(logAgent.getDomain().value());
+               buf.putInt(domainValue);
                buf.putInt(Integer.parseInt(pid));
                buf.putInt(protocolMajorVersion);
                buf.putInt(protocolMinorVersion);
This page took 0.02351 seconds and 4 git commands to generate.