Codota Logo
IAgentService
Code IndexAdd Codota to your IDE (free)

How to use
IAgentService
in
rocks.inspectit.shared.all.cmr.service

Best Java code snippets using rocks.inspectit.shared.all.cmr.service.IAgentService (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
BufferedReader b =
  • Codota IconInputStream in;new BufferedReader(new InputStreamReader(in))
  • Codota IconReader in;new BufferedReader(in)
  • Codota IconFile file;new BufferedReader(new FileReader(file))
  • Smart code suggestions by Codota
}
origin: inspectIT/inspectIT

  @Override
  protected InstrumentationDefinition performRemoteCall(IAgentService service) throws Exception {
    return agentService.analyze(platformIdent, hash, type);
  }
};
origin: inspectIT/inspectIT

  @Override
  protected Collection<JmxAttributeDescriptor> performRemoteCall(IAgentService service) throws Exception {
    return agentService.analyzeJmxAttributes(platformIdent, descriptors);
  }
};
origin: inspectIT/inspectIT

  @Override
  protected List<IAgentMessage<?>> performRemoteCall(IAgentService service) throws Exception {
    return agentService.fetchAgentMessages(platformIdent);
  }
};
origin: inspectIT/inspectIT

  @Override
  protected Void performRemoteCall(IAgentService service) throws Exception {
    service.unregister(platformIdent);
    return null;
  }
};
origin: inspectIT/inspectIT

  @Override
  protected AgentConfig performRemoteCall(IAgentService service) throws Exception {
    return agentService.register(networkInterfaces, agentName, version);
  }
};
origin: inspectIT/inspectIT

/**
 * {@inheritDoc}
 */
@Override
protected Void performRemoteCall(IAgentService remoteObject) throws Exception {
  remoteObject.instrumentationApplied(platformIdent, methodToSensorMap);
  return null;
}
origin: inspectIT/inspectIT

@Test(expectedExceptions = { BusinessException.class })
public void businessException() throws Exception {
  when(client.isConnected()).thenReturn(true);
  doThrow(BusinessException.class).when(agentService).unregister(anyLong());
  long platformId = 10L;
  try {
    connection.unregister(platformId);
  } finally {
    verify(agentService, times(1)).unregister(platformId);
    verifyNoMoreInteractions(agentService);
  }
}
origin: inspectIT/inspectIT

@Test
public void register() throws Exception {
  AgentConfig agentConfiguration = mock(AgentConfig.class);
  when(client.isConnected()).thenReturn(true);
  doReturn(agentConfiguration).when(agentService).register(Matchers.<List<String>> any(), anyString(), anyString());
  String agentName = "agentName";
  String version = "version";
  AgentConfig receivedAgentConfiguration = connection.register(agentName, version);
  assertThat(receivedAgentConfiguration, is(agentConfiguration));
  verify(agentService, times(1)).register(Matchers.<List<String>> any(), eq(agentName), eq(version));
  verifyNoMoreInteractions(agentService);
}
origin: inspectIT/inspectIT

@Test
public void instrumentationApplied() throws Exception {
  when(client.isConnected()).thenReturn(true);
  Map<Long, long[]> methodToSensorMap = mock(Map.class);
  when(methodToSensorMap.isEmpty()).thenReturn(false);
  long id = 7;
  connection.instrumentationApplied(id, methodToSensorMap);
  verify(agentService, times(1)).instrumentationApplied(id, methodToSensorMap);
  verifyNoMoreInteractions(agentService);
}
origin: inspectIT/inspectIT

@Test
public void analyzeAndInstrument() throws Exception {
  InstrumentationDefinition instrumentationResult = mock(InstrumentationDefinition.class);
  when(client.isConnected()).thenReturn(true);
  doReturn(instrumentationResult).when(agentService).analyze(anyLong(), anyString(), Matchers.<Type> any());
  long id = 7;
  String hash = "hash";
  Type type = mock(Type.class);
  InstrumentationDefinition receivedResult = connection.analyze(id, hash, type);
  assertThat(receivedResult, is(instrumentationResult));
  verify(agentService, times(1)).analyze(id, hash, type);
  verifyNoMoreInteractions(agentService);
}
origin: inspectIT/inspectIT

@Test
public void analyzeJmxAttributes() throws Exception {
  Collection<JmxAttributeDescriptor> result = mock(Collection.class);
  when(client.isConnected()).thenReturn(true);
  doReturn(result).when(agentService).analyzeJmxAttributes(anyLong(), Matchers.<Collection<JmxAttributeDescriptor>> any());
  long id = 7;
  Collection<JmxAttributeDescriptor> descriptors = Collections.emptyList();
  Collection<JmxAttributeDescriptor> receivedResult = connection.analyzeJmxAttributes(id, descriptors);
  assertThat(receivedResult, is(result));
  verify(agentService, times(1)).analyzeJmxAttributes(id, descriptors);
  verifyNoMoreInteractions(agentService);
}
origin: inspectIT/inspectIT

@Test
public void unregister() throws Exception {
  when(client.isConnected()).thenReturn(true);
  long platformId = 10L;
  connection.unregister(platformId);
  verify(agentService, times(1)).unregister(platformId);
  verifyNoMoreInteractions(agentService);
}
origin: inspectIT/inspectIT

@Test(expectedExceptions = { BusinessException.class })
public void businessException() throws Exception {
  when(client.isConnected()).thenReturn(true);
  doThrow(BusinessException.class).when(agentService).register(Matchers.<List<String>> any(), anyString(), anyString());
  String agentName = "agentName";
  String version = "version";
  try {
    connection.register(agentName, version);
  } finally {
    verify(agentService, times(1)).register(Matchers.<List<String>> any(), eq(agentName), eq(version));
    verifyNoMoreInteractions(agentService);
  }
}
origin: inspectIT/inspectIT

@Test
public void fetchAgentMessages() throws Exception {
  IAgentMessage<?> message = mock(IAgentMessage.class);
  List<IAgentMessage<?>> messages = Arrays.<IAgentMessage<?>> asList(message);
  when(client.isConnected()).thenReturn(true);
  long id = 7;
  when(agentService.fetchAgentMessages(id)).thenReturn(messages);
  List<IAgentMessage<?>> result = connection.fetchAgentMessages(id);
  assertThat(result, is(equalTo(messages)));
  verify(agentService).fetchAgentMessages(id);
  verifyNoMoreInteractions(agentService);
}
origin: inspectIT/inspectIT

@Test(expectedExceptions = { ServerUnavailableException.class })
public void timeout() throws Exception {
  when(client.isConnected()).thenReturn(true);
  doThrow(TimeoutException.class).when(agentService).instrumentationApplied(anyLong(), Matchers.<Map<Long, long[]>> any());
  Map<Long, long[]> methodToSensorMap = mock(Map.class);
  when(methodToSensorMap.isEmpty()).thenReturn(false);
  long id = 7;
  try {
    connection.instrumentationApplied(id, methodToSensorMap);
  } catch (ServerUnavailableException e) {
    assertThat(e.isServerTimeout(), is(true));
    throw e;
  } finally {
    verify(agentService, times(1)).instrumentationApplied(id, methodToSensorMap);
    verifyNoMoreInteractions(agentService);
  }
}
origin: inspectIT/inspectIT

@Test(expectedExceptions = { BusinessException.class })
public void businessException() throws Exception {
  when(client.isConnected()).thenReturn(true);
  doThrow(BusinessException.class).when(agentService).analyze(anyLong(), anyString(), Matchers.<Type> any());
  long id = 7;
  String hash = "hash";
  Type type = mock(Type.class);
  try {
    connection.analyze(id, hash, type);
  } finally {
    verify(agentService, times(1)).analyze(id, hash, type);
    verifyNoMoreInteractions(agentService);
  }
}
origin: inspectIT/inspectIT

@Test(expectedExceptions = { BusinessException.class })
public void businessException() throws Exception {
  when(client.isConnected()).thenReturn(true);
  doThrow(BusinessException.class).when(agentService).analyzeJmxAttributes(anyLong(), Matchers.<Collection<JmxAttributeDescriptor>> any());
  long id = 7;
  Collection<JmxAttributeDescriptor> descriptors = Collections.emptyList();
  try {
    connection.analyzeJmxAttributes(id, descriptors);
  } finally {
    verify(agentService, times(1)).analyzeJmxAttributes(id, descriptors);
    verifyNoMoreInteractions(agentService);
  }
}
origin: inspectIT/inspectIT

@Test(expectedExceptions = { ServerUnavailableException.class })
public void timeout() throws Exception {
  when(client.isConnected()).thenReturn(true);
  doThrow(TimeoutException.class).when(agentService).unregister(anyLong());
  long platformId = 10L;
  try {
    connection.unregister(platformId);
  } catch (ServerUnavailableException e) {
    assertThat(e.isServerTimeout(), is(true));
    throw e;
  } finally {
    verify(agentService, times(1)).unregister(platformId);
    verifyNoMoreInteractions(agentService);
  }
}
origin: inspectIT/inspectIT

@Test(expectedExceptions = { ServerUnavailableException.class })
public void timeout() throws Exception {
  when(client.isConnected()).thenReturn(true);
  doThrow(TimeoutException.class).when(agentService).register(Matchers.<List<String>> any(), anyString(), anyString());
  String agentName = "agentName";
  String version = "version";
  try {
    connection.register(agentName, version);
  } catch (ServerUnavailableException e) {
    assertThat(e.isServerTimeout(), is(true));
    throw e;
  } finally {
    verify(agentService, times(1)).register(Matchers.<List<String>> any(), eq(agentName), eq(version));
    verifyNoMoreInteractions(agentService);
  }
}
origin: inspectIT/inspectIT

@Test(expectedExceptions = { ServerUnavailableException.class })
public void timeout() throws Exception {
  when(client.isConnected()).thenReturn(true);
  long id = 7;
  when(agentService.fetchAgentMessages(id)).thenThrow(TimeoutException.class);
  try {
    connection.fetchAgentMessages(id);
  } catch (ServerUnavailableException e) {
    assertThat(e.isServerTimeout(), is(true));
    throw e;
  } finally {
    verify(agentService).fetchAgentMessages(id);
    verifyNoMoreInteractions(agentService);
  }
}
rocks.inspectit.shared.all.cmr.serviceIAgentService

Javadoc

Interface for agent communication with the CMR.

Most used methods

  • analyze
    Analyzes the given type and adds instrumentation points if necessary, returning the instrumentation
  • analyzeJmxAttributes
    Analyzes the given JmxAttributeDescriptor and decides which ones will be monitored, based on the cur
  • fetchAgentMessages
    Fetches all IAgentMessage which are available at the CMR. The returned list is an ordered list, orde
  • instrumentationApplied
    Informs the CMR that the methods have been instrumented on the agent.
  • register
    Registers the agent with the CMR. The CMR will answer with the AgentConfig containing all necessary
  • unregister
    Unregisters the platform in the CMR by sending the agent id.

Popular in Java

  • Start an intent from android
  • setScale (BigDecimal)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • setContentView (Activity)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Iterator (java.util)
    An iterator over a collection. Iterator takes the place of Enumeration in the Java Collections Frame
  • Notification (javax.management)
  • Table (org.hibernate.mapping)
    A relational table
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now