Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 140242

Summary: Expose functionality from RemoteComponentSkeleton in the LoggingAgent class
Product: z_Archived Reporter: Robert Danek <rdanek>
Component: TPTPAssignee: Cindy Jin <jx_china>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P1 CC: ashishp, eyuen7, jx_china, labadie, qiyanli
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: closed460

Description Robert Danek CLA 2006-05-04 16:17:01 EDT
RemoteComponentSkeleton is an internal class and we need some of its methods moved to LoggingAgent (which is non-internal). 

- Allow agent type to be set to something other than 'Logging Agent'. 

- Expose requestMonitorThroughPeer* methods (there's several of them) in the LoggingAgent class. 

- allow user to obtain Agent UUID, Node UUID, Process UUID, and pid. 
 
- allow user to register Monitor listeners and custom command listeners
Comment 1 Paul Slauenwhite CLA 2006-07-14 12:35:03 EDT
Also, broadcastMessage().
Comment 2 Paul Slauenwhite CLA 2006-07-14 12:37:24 EDT
Also, broadcastMessage().
Comment 3 Paul Slauenwhite CLA 2006-07-14 12:37:37 EDT
Increasing priority to P1.
Comment 4 Elson Yuen CLA 2006-07-14 16:46:35 EDT
I also need 
- a constructor of the LoggingAgent that can specify a UUID type.
- to allow user to set a command handler
Comment 5 Paul Slauenwhite CLA 2006-08-22 11:16:31 EDT
Also, add:

public String getAgentUUID()
public long getPID()
Comment 6 Paul Slauenwhite CLA 2006-08-22 11:19:33 EDT
(In reply to comment #5)
> Also, add:
> public String getAgentUUID()
> public long getPID()

Required for setting the context of trace data logged via a Logging Agent.  For example, processCreate, agentCreate and traceStart events.
Comment 7 Paul Slauenwhite CLA 2006-08-22 12:19:05 EDT
(In reply to comment #0)
> - Allow agent type to be set to something other than 'Logging Agent'. 

Why do you need the agent type to be set to something other than 'Logging'?
Comment 8 Robert Danek CLA 2006-08-22 12:22:22 EDT
In response to comment #7:

I've dug through the TPTP code, and it doesn't appear that the setting the agent type in RemoteComponentSkeleton propagates anywhere else. However, what we are doing is writing the "agentType" out in the trace header, and the type we're specifying is the one returned by the getType method of RemoteComponentSkeleton. Since we set it to 'Profiler' type, we obviously get 'Profiler' back. We still will have to write "Profiler" type out in the trace header, and I suppose we could do that by simply hard coding it, instead of calling the getType method. The reason we have to write 'agentType="Profiler"' out in the trace header, based on what I've been told by the UI folks, is that it sets up the default views to be used when opening data associated with the agent in the profiling monitor in the workbench. 
Comment 9 Paul Slauenwhite CLA 2006-08-22 12:22:27 EDT
(In reply to comment #4)
> I also need 
> - a constructor of the LoggingAgent that can specify a UUID type.
> - to allow user to set a command handler

Did you mean Agnet Type instead of UUID type?
Comment 10 Paul Slauenwhite CLA 2006-09-06 11:41:41 EDT
Also consider:

getNodeUUID()
generateUUID()
getJVMUUID()
Comment 11 Cindy Jin CLA 2006-09-08 00:17:29 EDT
Following methods are added to the LoggingAgent:
 public LoggingAgent(String name,String type) 
 public LoggingAgent(String name, int bufferSize,String type) 
public void addCommandListener(final LoggingAgentCustomCommandHandler listener)
public void addMonitorListener(final LoggingAgentMonitorListener listener)
public void broadcastMessage(byte[] message, int offset, int length, long contextId)
public void broadcastMessage(String message, long contextId)
public String generateUUID()
public String getAgentUUID()
public String getNodeUUID()
public String getPID()
public String getType()
public void requestMonitorThroughPeer(InetAddress addr, long pid, String agentName, long timeout) 
public void requestMonitorThroughPeer(InetAddress addr, String agentUUID, long timeout)
public void requestMonitorThroughPeer_p(InetAddress addr, long port, long pid, String agentName, long timeout)
public void requestMonitorThroughPeer_p(InetAddress addr, long port, String agentUUID, long timeout)

Following classes are added to support these APIs.
LoggingAgentCustomCommand.java
LoggingAgentCustomCommandHandler.java
LoggingAgentMonitorListener.java
LoggingAgentNotRegisteredException.java
Comment 12 Cindy Jin CLA 2006-11-13 09:52:15 EST
Setting target when this was resolved.
Comment 13 Paul Slauenwhite CLA 2009-06-30 12:16:59 EDT
As of TPTP 4.6.0, TPTP is in maintenance mode and focusing on improving quality by resolving relevant enhancements/defects and increasing test coverage through test creation, automation, Build Verification Tests (BVTs), and expanded run-time execution. As part of the TPTP Bugzilla housecleaning process (see http://wiki.eclipse.org/Bugzilla_Housecleaning_Processes), this enhancement/defect is verified/closed by the Project Lead since this enhancement/defect has been resolved and unverified for more than 1 year and considered to be fixed. If this enhancement/defect is still unresolved and reproducible in the latest TPTP release (http://www.eclipse.org/tptp/home/downloads/), please re-open.