From: Jan S. <st...@us...> - 2001-10-14 21:56:34
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/connect In directory usw-pr-cvs1:/tmp/cvs-serv23334 Modified Files: LaunchConnector.java ShmemAttachConnector.java ShmemLaunchConnector.java ShmemListenConnector.java ShmemTransport.java SocketAttachConnector.java SocketLaunchConnector.java SocketListenConnector.java SocketTransport.java Log Message: Connectors updated. Index: LaunchConnector.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/connect/LaunchConnector.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** LaunchConnector.java 2001/09/29 21:01:33 1.2 --- LaunchConnector.java 2001/10/14 21:56:31 1.3 *************** *** 72,116 **** arg.setValue("\""); args.put(arg.name(), arg); - //profiling args - List choices=new ArrayList(4); - choices.add("off"); - choices.add("object"); - choices.add("method"); - choices.add("trace"); - arg=new SelectedArgumentImpl(false, bundle.getString("AllocLevel"), - bundle.getString("AllocLevelDesc"), "allocLevel", choices); - arg.setValue("trace"); - args.put(arg.name(), arg); - arg=new BooleanArgumentImpl(false, bundle.getString("AllocThread"), - bundle.getString("AllocThreadDesc"), "allocThread"); - ((Connector.BooleanArgument)arg).setValue(true); - args.put(arg.name(), arg); - arg=new IntegerArgumentImpl(false, bundle.getString("AllocThraceDepth"), - bundle.getString("AllocTraceDepthDesc"), "allocTraceDepth", 1, 100); - ((Connector.IntegerArgument)arg).setValue(2); - args.put(arg.name(), arg); - choices=new ArrayList(3); - choices.add("off"); - choices.add("method"); - choices.add("trace"); - arg=new SelectedArgumentImpl(false, bundle.getString("CPULevel"), - bundle.getString("CPULevelDesc"), "cpuLevel", choices); - arg.setValue("trace"); - args.put(arg.name(), arg); - arg=new BooleanArgumentImpl(false, bundle.getString("CPUThread"), - bundle.getString("CPUThreadDesc"), "cpuThread"); - ((Connector.BooleanArgument)arg).setValue(true); - args.put(arg.name(), arg); - arg=new IntegerArgumentImpl(false, bundle.getString("CPUTraceDepth"), - bundle.getString("CPUTraceDepthDesc"), "cpuTraceDepth", 1, 100); - ((Connector.IntegerArgument)arg).setValue(2); - args.put(arg.name(), arg); - choices=new ArrayList(2); - choices.add("exact"); - choices.add("sampling"); - arg=new SelectedArgumentImpl(false, bundle.getString("CPUMethod"), - bundle.getString("CPUMethodDesc"), "cpuMethod", choices); - arg.setValue("sampling"); - args.put(arg.name(), arg); return args; } --- 72,75 ---- *************** *** 119,122 **** --- 78,84 ---- /* * $Log$ + * Revision 1.3 2001/10/14 21:56:31 stolis + * Connectors updated. + * * Revision 1.2 2001/09/29 21:01:33 stolis * Plural added in licenses. Index: ShmemAttachConnector.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/connect/ShmemAttachConnector.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** ShmemAttachConnector.java 2001/09/29 21:01:33 1.2 --- ShmemAttachConnector.java 2001/10/14 21:56:31 1.3 *************** *** 21,26 **** package net.sourceforge.javaprofiler.jpiimpl.connect; - import IProf; - import CommunSetupShMem; import java.util.Map; import java.util.HashMap; --- 21,24 ---- *************** *** 29,32 **** --- 27,32 ---- import net.sourceforge.javaprofiler.jpi.VirtualMachine; import net.sourceforge.javaprofiler.jpi.connect.*; + import net.sourceforge.javaprofiler.jpiimpl.VirtualMachineImpl; + import net.sourceforge.javaprofiler.jpiimpl.commun.*; /** *************** *** 41,50 **** * Attaches to VM using shared memory. */ ! public VirtualMachine connect(Map arguments) throws IllegalConnectorArgumentsException, ConnectingException { ! ((ShmemTransport)transport()).initialize(); String address=null; Iterator iter=arguments.keySet().iterator(); while (iter.hasNext()) { ! Connector.Argument arg=(Connector.Argument)iter.next(); if ("address".equals(arg.name())) { String val=arg.value(); --- 41,49 ---- * Attaches to VM using shared memory. */ ! public VirtualMachine connect(Map arguments) throws IllegalConnectorArgumentsException, ConnectingException { String address=null; Iterator iter=arguments.keySet().iterator(); while (iter.hasNext()) { ! Connector.Argument arg=(Connector.Argument)arguments.get(iter.next()); if ("address".equals(arg.name())) { String val=arg.value(); *************** *** 54,64 **** } } ! if (address!=null) { throw new IllegalConnectorArgumentsException("Wrong or missing shared memory area address.", "address"); } ! IProf prof=new IProf(new CommunSetupShMem(address, 256*1024)); ! prof.runClient(); ! //PENDING ! return null; } --- 53,65 ---- } } ! if (address==null) { throw new IllegalConnectorArgumentsException("Wrong or missing shared memory area address.", "address"); } ! IProf iprof=new IProf(new CommunSetupShMem(address, 256*1024)); ! if (iprof.run()) { ! return new VirtualMachineImpl(iprof); ! } else { ! throw new ConnectingException("Unable to connect to the profiled process."); ! } } *************** *** 126,129 **** --- 127,133 ---- /* * $Log$ + * Revision 1.3 2001/10/14 21:56:31 stolis + * Connectors updated. + * * Revision 1.2 2001/09/29 21:01:33 stolis * Plural added in licenses. Index: ShmemLaunchConnector.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/connect/ShmemLaunchConnector.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** ShmemLaunchConnector.java 2001/09/29 21:01:33 1.2 --- ShmemLaunchConnector.java 2001/10/14 21:56:31 1.3 *************** *** 38,43 **** * Launches the VM and connects to it through shared memory. */ ! public VirtualMachine connect(Map arguments) throws IllegalConnectorArgumentsException, ConnectingException { ! ((ShmemTransport)transport()).initialize(); //PENDING return null; --- 38,42 ---- * Launches the VM and connects to it through shared memory. */ ! public VirtualMachine connect(Map arguments) throws IllegalConnectorArgumentsException, ConnectingException { //PENDING return null; *************** *** 53,75 **** return ShmemTransport.getDefault(); } ! ! /** ! * Returns the arguments accepted by this Connector and their default values. ! * The keys of the returned map are string argument names. The values are ! * {@link Connector.Argument} containing information about the argument ! * and its default value. ! * ! * @return the map associating argument names with argument information ! * and default value. ! */ ! public Map defaultArguments() { ! Map args=super.defaultArguments(); ! Connector.Argument arg=new StringArgumentImpl(false, bundle.getString("Address"), ! bundle.getString("LaunchAddress"), "address"); ! arg.setValue(""); ! args.put(arg.name(), arg); ! return args; ! } ! /** * Returns a type of this connector. Three currently supported types are --- 52,56 ---- return ShmemTransport.getDefault(); } ! /** * Returns a type of this connector. Three currently supported types are *************** *** 107,110 **** --- 88,94 ---- /* * $Log$ + * Revision 1.3 2001/10/14 21:56:31 stolis + * Connectors updated. + * * Revision 1.2 2001/09/29 21:01:33 stolis * Plural added in licenses. Index: ShmemListenConnector.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/connect/ShmemListenConnector.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** ShmemListenConnector.java 2001/09/29 21:01:33 1.2 --- ShmemListenConnector.java 2001/10/14 21:56:31 1.3 *************** *** 21,26 **** package net.sourceforge.javaprofiler.jpiimpl.connect; - import IProf; - import CommunSetupShMem; import java.util.Map; import java.util.HashMap; --- 21,24 ---- *************** *** 29,32 **** --- 27,31 ---- import net.sourceforge.javaprofiler.jpi.VirtualMachine; import net.sourceforge.javaprofiler.jpi.connect.*; + import net.sourceforge.javaprofiler.jpiimpl.commun.*; /** *************** *** 41,50 **** * Listens for connections initiated by other VMs. */ ! public VirtualMachine connect(Map arguments) throws IllegalConnectorArgumentsException, ConnectingException { ! ((ShmemTransport)transport()).initialize(); String address=null; Iterator iter=arguments.keySet().iterator(); while (iter.hasNext()) { ! Connector.Argument arg=(Connector.Argument)iter.next(); if ("address".equals(arg.name())) { String val=arg.value(); --- 40,48 ---- * Listens for connections initiated by other VMs. */ ! public VirtualMachine connect(Map arguments) throws IllegalConnectorArgumentsException, ConnectingException { String address=null; Iterator iter=arguments.keySet().iterator(); while (iter.hasNext()) { ! Connector.Argument arg=(Connector.Argument)arguments.get(iter.next()); if ("address".equals(arg.name())) { String val=arg.value(); *************** *** 57,62 **** throw new IllegalConnectorArgumentsException("Wrong or missing shared memory area address.", "address"); } ! IProf prof=new IProf(new CommunSetupShMem(address, 256*1024)); ! prof.runClient(); //PENDING return null; --- 55,60 ---- throw new IllegalConnectorArgumentsException("Wrong or missing shared memory area address.", "address"); } ! //IProf prof=new IProf(new CommunSetupShMem(address, 256*1024)); ! //prof.runClient(); //PENDING return null; *************** *** 126,129 **** --- 124,130 ---- /* * $Log$ + * Revision 1.3 2001/10/14 21:56:31 stolis + * Connectors updated. + * * Revision 1.2 2001/09/29 21:01:33 stolis * Plural added in licenses. Index: ShmemTransport.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/connect/ShmemTransport.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** ShmemTransport.java 2001/09/29 21:01:33 1.2 --- ShmemTransport.java 2001/10/14 21:56:31 1.3 *************** *** 21,24 **** --- 21,26 ---- package net.sourceforge.javaprofiler.jpiimpl.connect; + import java.util.ResourceBundle; + import net.sourceforge.javaprofiler.jpi.connect.Transport; *************** *** 42,53 **** /** - * Initializes this transport. Loads the <code>pt_shmem</code> shared library - * (<code>pt_shmem.dll</code> or <code>libpt_shmem.so</code>). - */ - protected void initialize() { - System.loadLibrary("pt_shmem"); - } - - /** * Returns singleton instance of this class. * --- 44,47 ---- *************** *** 73,79 **** --- 67,85 ---- } + /** + * Returns short human-readable description of this transport. + * + * @return short human-readable description of this transport. + */ + public String label() { + return ResourceBundle.getBundle("net.sourceforge.javaprofiler.jpiimpl.bundle").getString("ShmemTransport"); + } + } /* * $Log$ + * Revision 1.3 2001/10/14 21:56:31 stolis + * Connectors updated. + * * Revision 1.2 2001/09/29 21:01:33 stolis * Plural added in licenses. Index: SocketAttachConnector.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/connect/SocketAttachConnector.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** SocketAttachConnector.java 2001/09/29 21:01:33 1.2 --- SocketAttachConnector.java 2001/10/14 21:56:31 1.3 *************** *** 21,32 **** package net.sourceforge.javaprofiler.jpiimpl.connect; - import IProf; - import CommunSetupSocket; import java.util.Map; ! import java.util.HashMap; import java.util.Iterator; import java.util.ResourceBundle; import net.sourceforge.javaprofiler.jpi.VirtualMachine; import net.sourceforge.javaprofiler.jpi.connect.*; /** --- 21,32 ---- package net.sourceforge.javaprofiler.jpiimpl.connect; import java.util.Map; ! import java.util.TreeMap; import java.util.Iterator; import java.util.ResourceBundle; import net.sourceforge.javaprofiler.jpi.VirtualMachine; import net.sourceforge.javaprofiler.jpi.connect.*; + import net.sourceforge.javaprofiler.jpiimpl.VirtualMachineImpl; + import net.sourceforge.javaprofiler.jpiimpl.commun.*; /** *************** *** 47,51 **** Iterator iter=arguments.keySet().iterator(); while (iter.hasNext()) { ! Connector.Argument arg=(Connector.Argument)iter.next(); if ("port".equals(arg.name())) { if (arg.isValid(arg.value())) { --- 47,51 ---- Iterator iter=arguments.keySet().iterator(); while (iter.hasNext()) { ! Connector.Argument arg=(Connector.Argument)arguments.get(iter.next()); if ("port".equals(arg.name())) { if (arg.isValid(arg.value())) { *************** *** 63,70 **** throw new IllegalConnectorArgumentsException("Wrong or missing port number.", "port"); } ! IProf prof=new IProf(new CommunSetupSocket(CommunSetupSocket.CLIENT_MODE, host, port)); ! prof.runClient(); ! //PENDING ! return null; } --- 63,72 ---- throw new IllegalConnectorArgumentsException("Wrong or missing port number.", "port"); } ! IProf iprof=new IProf(new CommunSetupSocket(CommunSetupSocket.CLIENT_MODE, host, port)); ! if (iprof.run()) { ! return new VirtualMachineImpl(iprof); ! } else { ! throw new ConnectingException("Unable to connect to the profiled process."); ! } } *************** *** 89,93 **** */ public Map defaultArguments() { ! Map args=new HashMap(2); Connector.Argument arg=new StringArgumentImpl(false, bundle.getString("Host"), bundle.getString("AttachHost"), "host"); --- 91,95 ---- */ public Map defaultArguments() { ! Map args=new TreeMap(); Connector.Argument arg=new StringArgumentImpl(false, bundle.getString("Host"), bundle.getString("AttachHost"), "host"); *************** *** 136,139 **** --- 138,144 ---- /* * $Log$ + * Revision 1.3 2001/10/14 21:56:31 stolis + * Connectors updated. + * * Revision 1.2 2001/09/29 21:01:33 stolis * Plural added in licenses. Index: SocketLaunchConnector.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/connect/SocketLaunchConnector.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** SocketLaunchConnector.java 2001/09/29 21:01:33 1.2 --- SocketLaunchConnector.java 2001/10/14 21:56:31 1.3 *************** *** 52,74 **** return SocketTransport.getDefault(); } ! ! /** ! * Returns the arguments accepted by this Connector and their default values. ! * The keys of the returned map are string argument names. The values are ! * {@link Connector.Argument} containing information about the argument ! * and its default value. ! * ! * @return the map associating argument names with argument information ! * and default value. ! */ ! public Map defaultArguments() { ! Map args=super.defaultArguments(); ! Connector.IntegerArgument arg=new IntegerArgumentImpl(false, bundle.getString("Port"), ! bundle.getString("LaunchPort"), "port", 0, 65535); ! arg.setValue(0); ! args.put(arg.name(), arg); ! return args; ! } ! /** * Returns a type of this connector. Three currently supported types are --- 52,56 ---- return SocketTransport.getDefault(); } ! /** * Returns a type of this connector. Three currently supported types are *************** *** 106,109 **** --- 88,94 ---- /* * $Log$ + * Revision 1.3 2001/10/14 21:56:31 stolis + * Connectors updated. + * * Revision 1.2 2001/09/29 21:01:33 stolis * Plural added in licenses. Index: SocketListenConnector.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/connect/SocketListenConnector.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** SocketListenConnector.java 2001/09/29 21:01:33 1.2 --- SocketListenConnector.java 2001/10/14 21:56:31 1.3 *************** *** 21,26 **** package net.sourceforge.javaprofiler.jpiimpl.connect; - import IProf; - import CommunSetupSocket; import java.util.Map; import java.util.HashMap; --- 21,24 ---- *************** *** 29,32 **** --- 27,31 ---- import net.sourceforge.javaprofiler.jpi.VirtualMachine; import net.sourceforge.javaprofiler.jpi.connect.*; + import net.sourceforge.javaprofiler.jpiimpl.commun.*; /** *************** *** 46,50 **** Iterator iter=arguments.keySet().iterator(); while (iter.hasNext()) { ! Connector.Argument arg=(Connector.Argument)iter.next(); if ("port".equals(arg.name())) { if (arg.isValid(arg.value())) { --- 45,49 ---- Iterator iter=arguments.keySet().iterator(); while (iter.hasNext()) { ! Connector.Argument arg=(Connector.Argument)arguments.get(iter.next()); if ("port".equals(arg.name())) { if (arg.isValid(arg.value())) { *************** *** 56,61 **** throw new IllegalConnectorArgumentsException("Wrong or missing port number.", "port"); } ! IProf prof=new IProf(new CommunSetupSocket(CommunSetupSocket.SERVER_MODE, "localhost", port)); ! prof.runClient(); //PENDING return null; --- 55,60 ---- throw new IllegalConnectorArgumentsException("Wrong or missing port number.", "port"); } ! //IProf prof=new IProf(new CommunSetupSocket(CommunSetupSocket.SERVER_MODE, "localhost", port)); ! //prof.runClient(); //PENDING return null; *************** *** 125,128 **** --- 124,130 ---- /* * $Log$ + * Revision 1.3 2001/10/14 21:56:31 stolis + * Connectors updated. + * * Revision 1.2 2001/09/29 21:01:33 stolis * Plural added in licenses. Index: SocketTransport.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/connect/SocketTransport.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** SocketTransport.java 2001/09/29 21:01:33 1.2 --- SocketTransport.java 2001/10/14 21:56:31 1.3 *************** *** 21,24 **** --- 21,26 ---- package net.sourceforge.javaprofiler.jpiimpl.connect; + import java.util.ResourceBundle; + import net.sourceforge.javaprofiler.jpi.connect.Transport; *************** *** 64,71 **** --- 66,85 ---- return name; } + + /** + * Returns short human-readable description of this transport. + * + * @return short human-readable description of this transport. + */ + public String label() { + return ResourceBundle.getBundle("net.sourceforge.javaprofiler.jpiimpl.bundle").getString("SocketTransport"); + } } /* * $Log$ + * Revision 1.3 2001/10/14 21:56:31 stolis + * Connectors updated. + * * Revision 1.2 2001/09/29 21:01:33 stolis * Plural added in licenses. |