DefaultTraceCollector implements TraceCollector, SessionManager { @Override public void deactivate() { try { if (fragmentManager.hasFragmentBuilder()) { fragmentManager.clear(); } } catch (Throwable t) { if (log.isLoggable(warningLogLevel)) { log.log(warningLogLevel, "deactivate failed", t); } } } DefaultTraceCollector();  DefaultTraceCollector(BatchTraceRecorder batchTraceRecorder); String getTenantId(); void setTenantId(String tenantId); @Override void setTraceId(String location, String value); @Override String getTraceId(); @Override void setTransaction(String location, String name); @Override String getTransaction(); @Override void setLevel(String location, String level); @Override String getLevel(); @Override void consumerStart(String location, String uri, String type, String operation, String id); @Override void consumerEnd(String location, String uri, String type, String operation); @Override void componentStart(String location, String uri, String type, String operation); @Override void componentEnd(String location, String uri, String type, String operation); @Override void producerStart(String location, String uri, String type, String operation, String id); @Override void producerEnd(String location, String uri, String type, String operation); @Override boolean isInProcessed(String location); @Override boolean isInContentProcessed(String location); @Override boolean isOutProcessed(String location); @Override boolean isOutContentProcessed(String location); @Override void processIn(String location, Map<String, ?> headers, Object... values); @Override void processOut(String location, Map<String, ?> headers, Object... values); @Override void setProperty(String location, String name, String value); @Override void initInBuffer(String location, Object obj); @Override boolean isInBufferActive(String location, Object obj); @Override void appendInBuffer(String location, Object obj, byte[] data, int offset, int len); @Override void recordInBuffer(String location, Object obj); @Override void initOutBuffer(String location, Object obj); @Override boolean isOutBufferActive(String location, Object obj); @Override void appendOutBuffer(String location, Object obj, byte[] data, int offset, int len); @Override void recordOutBuffer(String location, Object obj); @Override boolean activate(String uri, String  operation); @Override boolean activate(String uri, String operation, String id); @Override boolean isActive(); @Override void deactivate(); @Override void retainNode(String id); @Override void releaseNode(String id); @Override Node retrieveNode(String id); @Override void initiateCorrelation(String id); @Override boolean isCorrelated(String id); @Override void correlate(String id); @Override void completeCorrelation(String id, boolean allowSpawn); @Override void unlink(); @Override void suppress(); @Override void ignoreNode(); @Override void assertComplete(); @Override void setState(Object context, String name, Object value, boolean session); @Override Object getState(Object context, String name, boolean session); @Override SessionManager session();  }
@Test public void testDeactivate() { DefaultTraceCollector collector = new DefaultTraceCollector(); assertFalse(collector.isActive()); collector.getFragmentManager().getFragmentBuilder(); assertTrue(collector.isActive()); collector.deactivate(); assertFalse(collector.isActive()); }