[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [hyades-dev] Execution of Internal APIs vs External APIs
|
I can understand the source of the confusion.
The use case realization in the execution
framework documentation describe the launch sequence in terms of interacting
with interfaces (mostly). It is hard to figure out from these diagrams
how the concrete implementations of these interfaces get instantiated.
In the time period between Hyades1 and Hyades2 using the internal classes
(NodeFactory, ProcessFactory etc.) was the only option. And I am not surprised
that Hyades UI itself is making a very heavy use of these internal classes.
You can take a look at org.eclipse.hyades.trace.ui.internal.util.PDCoreUtil.java
to find this out. A good place to start is PDCoreUtil.launchTrace().
Here in PurifyPlus team we also have
some internal tools that work outside of the Eclipse framework and use
internal classes. The code we wrote looks very similar to what Luc had
posted, and this is largely because there was no other way of implementing
a process launcher back then.
Probably today there is a better way
to use the Execution Framework and I would appreciate if somebody could
point me to the right code sample.
However, the Gene (PDCoreUtil etc.)
is already out of the bottle and if internal classes change, somebody in
the UI team will have a lot of work to do.
I also remember that during F2F meeting
we were talking about another solution for achieving the backward compatibility
with the Execution Framework. We can implement a "RAC Compatibility
Proxy" for the HCE server. Such a proxy will make HCE look like the
old good RAC on the socket side. After that the existing code will just
work and we can relax and implement the whole new execution framework in
the meantime.
--Victor
Richard Duggan <rduggan@xxxxxxxxxx>
Sent by: hyades-dev-admin@xxxxxxxxxxx
11/11/2004 12:18 PM
Please respond to
hyades-dev |
|
To
| hyades-dev@xxxxxxxxxxx
|
cc
| Joseph P Toomey/Lexington/IBM@IBMUS
|
Subject
| Re: [hyades-dev] Execution
of Internal APIs vs External APIs |
|
Luc,
This is not necessary. These internal classes were not intended to
be used
the way you are indicating. There are use-cases documented on the
website
that shows the correct series of calls that should occur. You can
link to
these off of the following page:
http://dev.eclipse.org/viewcvs/indextools.cgi/~checkout~/hyades-home/docs/components/execution_environment/execution_environment.html
Now, when you want to use the classes in the
org.eclipse.hyades.execution.core plugin outside of the eclipse environment
(ie. headless) you need to configure your factories correctly so that the
proper realizations get loaded. I would have to defer to Joseph Toomey
for
the specifics of how to achieve this.
Richard K. Duggan
Problem Determination Enablement
IBM Toronto Laboratory
External: 905-413-2396
Internal: 969-2396
"Plaetinck, Luc"
<Luc.Plaetinck@co
mpuware.com>
To
Sent by:
"'hyades-dev@xxxxxxxxxxx'"
hyades-dev-admin@
<hyades-dev@xxxxxxxxxxx>
eclipse.org
cc
Subject
11/11/2004 03:01
[hyades-dev] Execution of Internal
PM
APIs vs External
APIs
Please respond to
hyades-dev
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. (See attached file: SampleClient.java)(See
attached file: SampleAgent.java)(See attached file: pluginconfig.xml)
Attachment:
SampleClient.java
Description: Binary data
Attachment:
SampleAgent.java
Description: Binary data
Attachment:
pluginconfig.xml
Description: Binary data