Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[hyades-dev] Execution of Internal APIs vs External APIs

Title: Execution of Internal APIs vs External APIs

When creating a standalone client for an Hyades agent (outside the Eclipse framework), I need to be able to perform following tasks:

1. connect to the node (RAC) where the agent needs to run
2. start a process (which may be the agent or cause the agent to be launched)
3. attach to the agent
4. send a message to the agent
5. receive info from the agent

Translated into Hyades components, this becomes:
1. create the node (node =  NodeFactory.CreateNode(hostname) ) and  connect to the node ( connection = node.connect(port) )

2. create process and add listeners ( process = ProcessFactory.createProcess(...), process.addProcessListener(...), process.launch() )

3. create agent and add listener ( agent = AgentFactory.createAgent(...), agent.addAgentListener(...), agent.attach() )
4. send a CustomCommand
5. through agent.startMonitoring(DataProcessor) or AgentListener.handleCommand(CustomCommand)

So following APIs are minimally needed to make this work - plus some other ones if you really are picky about what type of exception is thrown ;-)

import org.eclipse.hyades.internal.execution.local.common.CommandElement;
import org.eclipse.hyades.internal.execution.local.common.CustomCommand;
import org.eclipse.hyades.internal.execution.local.common.DataProcessor;
import org.eclipse.hyades.internal.execution.local.control.Agent;
import org.eclipse.hyades.internal.execution.local.control.AgentFactory;
import org.eclipse.hyades.internal.execution.local.control.AgentListener;
import org.eclipse.hyades.internal.execution.local.control.Connection;
import org.eclipse.hyades.internal.execution.local.control.Node;
import org.eclipse.hyades.internal.execution.local.control.NodeFactory;
import org.eclipse.hyades.internal.execution.local.control.Process;
import org.eclipse.hyades.internal.execution.local.control.ProcessFactory;
import org.eclipse.hyades.internal.execution.local.control.ProcessListener;
import org.eclipse.hyades.internal.execution.local.control.InactiveAgentException;
import org.eclipse.hyades.internal.execution.local.control.NoSuchApplicationException;
import org.eclipse.hyades.internal.execution.local.control.ProcessActiveException;

Note that all these are defined as hyades.internal..

Similarly, for a Java agent, following imports are needed:
import org.eclipse.hyades.execution.invocation.RemoteInvocationException;
import org.eclipse.hyades.internal.execution.local.common.CustomCommand;
import org.eclipse.hyades.internal.execution.remote.AgentControllerListener;
import org.eclipse.hyades.internal.execution.remote.CustomCommandHandler;
import org.eclipse.hyades.internal.execution.remote.MonitorListener;
import org.eclipse.hyades.internal.execution.remote.RemoteClientListener;
import org.eclipse.hyades.internal.execution.remote.RemoteComponentSkeleton;

Note again the need for hyades.internal... packages

Attached are the sample client, agent and pluginconfig.xml for the agent.
<<SampleClient.java>> <<SampleAgent.java>> <<pluginconfig.xml>>


Luc



The contents of this e-mail are intended for the named addressee only. It contains information that may be confidential. Unless you are the named addressee or an authorized designee, you may not copy or use it, or disclose it to anyone else. If you received it in error please notify us immediately and then destroy it.

Attachment: SampleClient.java
Description: Binary data

Attachment: SampleAgent.java
Description: Binary data

Attachment: pluginconfig.xml
Description: Binary data


Back to the top