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

How to use
Agent
in
org.rhq.core.domain.resource

Best Java code snippets using org.rhq.core.domain.resource.Agent (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Gson g =
  • Codota Iconnew Gson()
  • Codota IconGsonBuilder gsonBuilder;gsonBuilder.create()
  • Codota Iconnew GsonBuilder().create()
  • Smart code suggestions by Codota
}
origin: stackoverflow.com

public void run() {
   ...
   // Agent agent = new Agent();
   agent = new Agent(); // works fine: you are initiliazing the class member
   ...
   parameter = getParameter();
}
origin: org.rhq/rhq-core-domain

public PartitionEventDetails(PartitionEvent partitionEvent, Agent agent, Server server) {
  this.partitionEvent = partitionEvent;
  this.agentName = agent.getName();
  this.serverName = server.getName();
}
origin: stackoverflow.com

 Agent a = new Agent();   //creates an instance of Agent in variable a
a.generateAgent();       //creates another instance which is discarded
             //this static method unnecessarily called on an instance
             //the method is static, but there is no such thing as a 
             //static object, only object instances.

Agent b = new Agent();   //creates a third instance
b.generateAgent();       //creates a fourth instance, this one thown away

a.sayHelloTo();     //method called on the first instance you created
origin: stackoverflow.com

 public class DiscussionDirector {
 public void discuss() {
  Agent a = new Agent();//Here you create a new agent on the HEAP
  a.generateAgent();//And here you call into the Agent class to do the same thing
   //note that generateAgent returns an Object that you're 'forgetting' about.
  return;
 }
}
origin: stackoverflow.com

 Agent a = new Agent("Harry");
Agent b = new Agent("Joe");
a.introduce(b);
b.introduce(a);
System.out.println( a.getNameAndNeighbor() );

//produces "my name is Harry and my neighbor's name is Joe"
origin: org.rhq/rhq-enterprise-server

  if (!agentByToken.getName().equals(request.getName())) {
    String msg = "The agent asking for registration is already registered with the name ["
      + agentByToken.getName() + "], it cannot change its name to [" + request.getName() + "]";
    throw new AgentRegistrationException(msg);
  } else {
    Agent agentByAddressPort = getAgentManager().getAgentByAddressAndPort(request.getAddress(),
      request.getPort());
    if (agentByAddressPort != null && !agentByAddressPort.getName().equals(request.getName())) {
        + "] is trying to register the same address/port [" + request.getAddress() + ":"
        + request.getPort() + "] that is already registered under a different name ["
        + agentByAddressPort.getName() + "]";
      throw new AgentRegistrationException(msg);
  request.getPort());
if (agentByAddressPort != null) {
  if (!agentByAddressPort.getName().equals(request.getName())) {
    String msg = "The agent asking for registration is trying to register the same address/port ["
      + request.getAddress()
      + request.getPort()
      + "] that is already registered under a different name ["
      + agentByAddressPort.getName()
      + "]. If this new agent is actually the same as the original, then re-register with the same name"
      + " and same security token. Otherwise, you should uninventory the Platform resource for agent ["
log.info("Got agent registration request for existing agent: " + agentByName.getName() + "["
  + agentByName.getAddress() + ":" + agentByName.getPort() + "][" + request.getAgentVersion()
  + "] - Will " + (request.getRegenerateToken() ? "" : "not") + " regenerate a new token");
origin: org.rhq/rhq-enterprise-server

if (agent.getName().startsWith(ResourceHandlerBean.DUMMY_AGENT_NAME_PREFIX)
  && agent.getAgentToken().startsWith(ResourceHandlerBean.DUMMY_AGENT_TOKEN_PREFIX)) {
  return Collections.<MeasurementData> emptySet();
origin: stackoverflow.com

 public class Helper 
{
  public static void main(String[] args) 
  {
    try 
    {
      Agent agent = new Agent();
      System.out.println(agent.getInner().newInstance().toString());
    }
    catch (InstantiationException e) {  e.printStackTrace();  }
    catch (IllegalAccessException e) {  e.printStackTrace();  }
  }
}
origin: stackoverflow.com

 public class Client {
  public static void main(String[] args) {
    StockTrade stock = new StockTrade();
    BuyStockOrder bsc = new BuyStockOrder (stock);
    SellStockOrder ssc = new SellStockOrder (stock);
    Agent agent = new Agent();

    agent.placeOrder(bsc); // Buy Shares
    agent.placeOrder(ssc); // Sell Shares
  }
}
origin: org.rhq/rhq-core-domain

Agent writeAgent = new Agent("reflectiveAgent", "reflectiveAddress", 0, "reflectiveEndpoint", "reflectiveToken");
boolean equalsParentResource = writeParentResource.equals(readResource.getParentResource());
boolean equalsResourceType = writeResourceType.equals(readResource.getResourceType());
boolean equalsAgent = writeAgent.equals(readResource.getAgent());
origin: org.rhq/rhq-enterprise-server

@ExcludeDefaultInterceptors
public void deleteAgent(Agent agent) {
  agent = entityManager.find(Agent.class, agent.getId());
  failoverListManager.deleteServerListsForAgent(agent);
  entityManager.remove(agent);
  Query q = entityManager.createNamedQuery(AgentInstall.QUERY_DELETE_BY_NAME);
  q.setParameter("agentName", agent.getName());
  q.executeUpdate();
  destroyAgentClient(agent);
  LOG.info("Removed agent: " + agent);
}
origin: org.rhq/rhq-enterprise-server

String agent_address = agent.getAddress();
int agent_port = agent.getPort();
if ((agent_client == null) || !agent_client.getAgent().getAgentToken().equals(agent.getAgentToken())) {
  String remote_uri;
  InvokerLocator locator = m_knownAgents.getAgent(agent_address, agent_port);
  } else {
    remote_uri = agent.getRemoteEndpoint();
origin: org.rhq/rhq-enterprise-server

@Override
public void destroyKnownAgentClient(Agent agent) {
  AgentClient agent_client;
  // first see if its already cached, if not we need to create one
  synchronized (m_knownAgentClients) {
    String agent_address = agent.getAddress();
    int agent_port = agent.getPort();
    agent_client = m_knownAgentClients.remove(getEndpointKey(agent_address, agent_port));
    if (agent_client != null) {
      agent_client.stopSending();
    }
    // purge the spool file, if it exists
    File spool_file = null;
    try {
      ClientCommandSenderConfiguration sender_config = getSenderConfiguration(agent);
      if (sender_config.commandSpoolFileName != null) {
        spool_file = new File(sender_config.dataDirectory, sender_config.commandSpoolFileName);
        if (spool_file.exists()) {
          // first truncate it, in case Windows is locking it; then try to delete
          new FileOutputStream(spool_file, false).close();
          spool_file.delete();
        }
      }
    } catch (Exception e) {
      LOG.warn("Failed to truncate/delete spool for deleted agent [" + agent + "]"
        + " please manually remove the file: " + spool_file, e);
    }
  }
  return;
}
origin: org.rhq/rhq-enterprise-server

if ((0 == level) && (null != next.getServer())) {
  bestBucket = ServerBucket.getBestBucket(buckets, serverList, next.getAffinityGroup(), next
    .getServer().getName());
} else {
  bestBucket = ServerBucket.getBestBucket(buckets, serverList, next.getAffinityGroup(), null);
origin: org.rhq/rhq-enterprise-server

public AgentSendCallback(Agent targetAgent) {
  token = targetAgent.getAgentToken();
}
origin: org.rhq/rhq-enterprise-server

if (checkAffinity && affinityGroup.equals(agent.getAffinityGroup())) {
  continue;
origin: org.rhq/rhq-enterprise-server

if (resourceIdWithAgent.getAgent().getName().startsWith(ResourceHandlerBean.DUMMY_AGENT_NAME_PREFIX)
  && resourceIdWithAgent.getAgent().getAgentToken()
    .startsWith(ResourceHandlerBean.DUMMY_AGENT_TOKEN_PREFIX)) {
  values.addAll(Collections.<MeasurementData> emptySet());
origin: org.rhq/rhq-enterprise-server

@SuppressWarnings("unused")
private void logServerList(String debugTitle, Map<Agent, List<ServerBucket>> agentServerListMap) {
  //if (!log.isInfoEnabled())
  //    return;
  StringBuilder sb = new StringBuilder("\nServerList (");
  sb.append(debugTitle);
  sb.append(") :");
  for (Agent agent : agentServerListMap.keySet()) {
    sb.append("\n\n Agent: " + agent.getName());
    for (ServerBucket bucket : agentServerListMap.get(agent)) {
      sb.append("\n   ");
      sb.append(bucket.assignedLoad);
      sb.append(" : ");
      sb.append(bucket.server.getName());
    }
  }
  sb.append("\n\n");
  System.out.println(sb.toString());
  log.info(sb.toString());
}
origin: stackoverflow.com

 public static Agent generateAgent() {//Declares the type of object being given back
 Agent randomAgent = new Agent();
 //eliding everything else
 return randomAgent;
}
origin: org.rhq/rhq-enterprise-server

} else if (agent.getName().startsWith(ResourceHandlerBean.DUMMY_AGENT_NAME_PREFIX)
  && agent.getAgentToken().startsWith(ResourceHandlerBean.DUMMY_AGENT_TOKEN_PREFIX)) {
  return getResourceById(subject, resourceId).getCurrentAvailability();
org.rhq.core.domain.resourceAgent

Javadoc

A JON agent.

Most used methods

  • <init>
    Constructor for Agent.
  • getName
    The agent's name will usually, but is not required to, be the fully qualified domain name of the mac
  • equals
  • generateAgent
  • getAddress
    Returns the machine address that is used to connect to the agent. This can be either an IP address o
  • getAffinityGroup
    Returns the AffinityGroup this agent currently belongs to.
  • getAgentToken
    Returns the token string that allows the agent to talk back to the server. If the agent provides an
  • getId
  • getInner
  • getNameAndNeighbor
  • getPort
    Returns the port number that the agent is listening to when accepting messages from the server.
  • getRemoteEndpoint
    The remote endpoint is the full connection string that is to be used to connect to the agent. If nul
  • getPort,
  • getRemoteEndpoint,
  • getServer,
  • getStatus,
  • introduce,
  • isBackFilled,
  • placeOrder,
  • printWithTrace,
  • sayHelloTo,
  • setAddress

Popular in Java

  • Making http requests using okhttp
  • compareTo (BigDecimal)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • startActivity (Activity)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • PrintWriter (java.io)
    Prints formatted representations of objects to a text-output stream. This class implements all of th
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • Iterator (java.util)
    An iterator over a collection. Iterator takes the place of Enumeration in the Java Collections Frame
  • StringTokenizer (java.util)
    The string tokenizer class allows an application to break a string into tokens. The tokenization met
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
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