|
JProfiler API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jprofiler.api.platform.connection.ConnectionFactory
public abstract class ConnectionFactory
Factory for creating connections to profiled JVMs and saved snapshots.
You can create multiple concurrent connections. For example, you could aggregate information from multiple remote JVMs.
Connection
Constructor Summary | |
---|---|
ConnectionFactory()
|
Method Summary | |
---|---|
static Connection |
createRemoteConnection(java.lang.String hostname,
int port,
int timeout)
Opens a connection to a remote JVM. |
static Connection |
createSnapshotConnection(java.io.File snapshot,
java.io.File configFile)
Opens a connection to a saved snapshot file. |
static Connection |
getLocalConnection()
Opens a connection to the JVM of the current process. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ConnectionFactory()
Method Detail |
---|
public static Connection getLocalConnection() throws java.io.IOException
For technical reasons this implies that the JVM was started with the "nowait" option in the -agentlib:jprofilerti (JVMTI) or -Xrunjprofiler (JVMPI) VM parameters, otherwise the profiling agent would be waiting for a connection and you would not be able to execute this method call.
java.io.IOException
- if the connection failspublic static Connection createSnapshotConnection(java.io.File snapshot, java.io.File configFile) throws java.io.IOException
snapshot
- the snapshot fileconfigFile
- the config.xml file of JProfiler. If this parameter is null, the default config file
from the current user's home directory will be used (if it exists).
java.io.IOException
- if the file does not exist or the connection fails for some other reasonpublic static Connection createRemoteConnection(java.lang.String hostname, int port, int timeout) throws java.io.IOException
hostname
- the host name or the IP address of the remote computerport
- the port on which the remote profiling agent is listening. The default value is 8849.timeout
- the timeout in seconds
java.io.IOException
- if the connection fails or times out
|
JProfiler API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |