public final class ListeningDICookie extends AbstractDICookie
private static finalExecutor
LISTENING = newRequestProcessor
("Listening"); int startListening() throwsException
{ListeningDICookie
config =ListeningDICookie
.create(-1);DebuggerInfo
info =DebuggerInfo
.create(ListeningDICookie
.ID, config); LISTENING.execute(() -> {DebuggerManager
.getDebuggerManager().startDebugging(info); }); int port = config.getPortNumber(); assertNotSame("Listening on a real port", -1, port); return port; }
Modifier and Type | Field and Description |
---|---|
static String |
ID
Public ID used for registration in Meta-inf/debugger.
|
Modifier and Type | Method and Description |
---|---|
static ListeningDICookie |
create(int portNumber)
Creates a new instance of ListeningDICookie for given parameters.
|
static ListeningDICookie |
create(com.sun.jdi.connect.ListeningConnector listeningConnector,
Map<String,? extends com.sun.jdi.connect.Connector.Argument> args)
Creates a new instance of ListeningDICookie for given parameters.
|
static ListeningDICookie |
create(String name)
Creates a new instance of ListeningDICookie for given parameters.
|
Map<String,? extends com.sun.jdi.connect.Connector.Argument> |
getArgs()
Returns map of arguments to be used.
|
com.sun.jdi.connect.ListeningConnector |
getListeningConnector()
Returns instance of ListeningConnector.
|
int |
getPortNumber()
Returns port number.
|
String |
getSharedMemoryName()
Returns shared memory block name.
|
com.sun.jdi.VirtualMachine |
getVirtualMachine()
Creates a new instance of VirtualMachine for this DebuggerInfo Cookie.
|
public static final String ID
public static ListeningDICookie create(com.sun.jdi.connect.ListeningConnector listeningConnector, Map<String,? extends com.sun.jdi.connect.Connector.Argument> args)
listeningConnector
- a instance of ListeningConnectorargs
- arguments to be usedpublic static ListeningDICookie create(int portNumber)
private static finalExecutor
LISTENING = newRequestProcessor
("Listening"); int startListening() throwsException
{ListeningDICookie
config =ListeningDICookie
.create(-1);DebuggerInfo
info =DebuggerInfo
.create(ListeningDICookie
.ID, config); LISTENING.execute(() -> {DebuggerManager
.getDebuggerManager().startDebugging(info); }); int port = config.getPortNumber(); assertNotSame("Listening on a real port", -1, port); return port; }
portNumber
- a number of port to listen on, use -1
to
let the system select a random port since 3.12public static ListeningDICookie create(String name)
name
- a name of shared memory block to listen onpublic com.sun.jdi.connect.ListeningConnector getListeningConnector()
public Map<String,? extends com.sun.jdi.connect.Connector.Argument> getArgs()
public int getPortNumber()
public String getSharedMemoryName()
public com.sun.jdi.VirtualMachine getVirtualMachine() throws IOException, com.sun.jdi.connect.IllegalConnectorArgumentsException
getVirtualMachine
in class AbstractDICookie
ConnectException
- When a connection is refusedIOException
com.sun.jdi.connect.IllegalConnectorArgumentsException